mirror of
https://github.com/smyalygames/FiniteVolumeGPU.git
synced 2026-01-14 15:48:43 +01:00
Refactoring
This commit is contained in:
@@ -134,6 +134,7 @@ __global__ void WAFKernel(
|
||||
const unsigned int w = BLOCK_WIDTH;
|
||||
const unsigned int h = BLOCK_HEIGHT;
|
||||
const unsigned int gc = 2;
|
||||
const unsigned int vars = 3;
|
||||
|
||||
//Shared memory variables
|
||||
__shared__ float Q[3][h+4][w+4];
|
||||
@@ -161,10 +162,7 @@ __global__ void WAFKernel(
|
||||
//Compute fluxes along the x axis and evolve
|
||||
computeFluxF(Q, F, g_, dx_, dt_);
|
||||
__syncthreads();
|
||||
|
||||
evolveF<w, h, gc>(Q[0], F[0], dx_, dt_);
|
||||
evolveF<w, h, gc>(Q[1], F[1], dx_, dt_);
|
||||
evolveF<w, h, gc>(Q[2], F[2], dx_, dt_);
|
||||
evolveF<w, h, gc, vars>(Q, F, dx_, dt_);
|
||||
__syncthreads();
|
||||
|
||||
//Fix boundary conditions
|
||||
@@ -176,10 +174,7 @@ __global__ void WAFKernel(
|
||||
//Compute fluxes along the y axis and evolve
|
||||
computeFluxG(Q, F, g_, dy_, dt_);
|
||||
__syncthreads();
|
||||
|
||||
evolveG<w, h, gc>(Q[0], F[0], dy_, dt_);
|
||||
evolveG<w, h, gc>(Q[1], F[1], dy_, dt_);
|
||||
evolveG<w, h, gc>(Q[2], F[2], dy_, dt_);
|
||||
evolveG<w, h, gc, vars>(Q, F, dy_, dt_);
|
||||
__syncthreads();
|
||||
}
|
||||
//Step 1 => evolve y first, then x
|
||||
@@ -187,10 +182,7 @@ __global__ void WAFKernel(
|
||||
//Compute fluxes along the y axis and evolve
|
||||
computeFluxG(Q, F, g_, dy_, dt_);
|
||||
__syncthreads();
|
||||
|
||||
evolveG<w, h, gc>(Q[0], F[0], dy_, dt_);
|
||||
evolveG<w, h, gc>(Q[1], F[1], dy_, dt_);
|
||||
evolveG<w, h, gc>(Q[2], F[2], dy_, dt_);
|
||||
evolveG<w, h, gc, vars>(Q, F, dy_, dt_);
|
||||
__syncthreads();
|
||||
|
||||
//Fix boundary conditions
|
||||
@@ -202,10 +194,7 @@ __global__ void WAFKernel(
|
||||
//Compute fluxes along the x axis and evolve
|
||||
computeFluxF(Q, F, g_, dx_, dt_);
|
||||
__syncthreads();
|
||||
|
||||
evolveF<w, h, gc>(Q[0], F[0], dx_, dt_);
|
||||
evolveF<w, h, gc>(Q[1], F[1], dx_, dt_);
|
||||
evolveF<w, h, gc>(Q[2], F[2], dx_, dt_);
|
||||
evolveF<w, h, gc, vars>(Q, F, dx_, dt_);
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user