Changes

Jump to: navigation, search

BetaT

541 bytes added, 17:53, 3 April 2017
Optimizing Problems
== Optimizing Problems ==
 
 
__global__ void Initalize(float* u, float* un, int nx, int nt, float dx)
{
int i = blockIdx.x * blockDim.x + threadIdx.x;
int j = blockIdx.y * blockDim.y + threadIdx.y;
if (i < nx && j < nx)
{
if (i*dx >= 0.5 && i*dx <= 1)
{
u[i * nx] = 2;
}
else
{
u[i * nx] = 1;
}
}
}
 
__global__ void Calculate (float* u, float* un,int nx, int c, float dx, float dt)
212
edits

Navigation menu