cuIBM
A GPU-based Immersed Boundary Method code
generateBC2.inl
Go to the documentation of this file.
1 
9 
10 
15 template<>
17 {
18  // raw pointers for cup arrays
19  real *dxD = thrust::raw_pointer_cast(&(domInfo->dxD[0])),
20  *dyD = thrust::raw_pointer_cast(&(domInfo->dyD[0]));
21 
22  real *bc2_r = thrust::raw_pointer_cast(&(bc2[0])),
23  *xminus = thrust::raw_pointer_cast(&(bc[XMINUS][0])),
24  *xplus = thrust::raw_pointer_cast(&(bc[XPLUS][0])),
25  *yminus = thrust::raw_pointer_cast(&(bc[YMINUS][0])),
26  *yplus = thrust::raw_pointer_cast(&(bc[YPLUS][0]));
27 
28  int nx = domInfo->nx,
29  ny = domInfo->ny;
30 
31  // initialize array with zeros
32  cusp::blas::fill(bc2, 0.0);
33 
34  const int blockSize = 256;
35  dim3 dimGrid( int((nx+ny-0.5)/blockSize) + 1, 1);
36  dim3 dimBlock(blockSize, 1);
37 
38  kernels::fillBC2_v <<<dimGrid, dimBlock>>> (bc2_r, yminus, yplus, dxD, nx, ny);
39  kernels::fillBC2_u <<<dimGrid, dimBlock>>> (bc2_r, xminus, xplus, dyD, nx, ny);
40 } // generateBC2
double real
Is a float or a double depending on the machine precision.
Definition: types.h:116
right boundary
Definition: types.h:50
bottom boundary
Definition: types.h:51
left boundary
Definition: types.h:49
virtual void generateBC2()
top boundary
Definition: types.h:52
Declaration of the kernels to generate elements of the right hand-side of the Poisson solver...