cuIBM
A GPU-based Immersed Boundary Method code
generateBC2.inl
Go to the documentation of this file.
1 
9 
10 
18 template<>
20 {
21  // raw pointers for cup arrays
22  real *dxD = thrust::raw_pointer_cast(&(domInfo->dxD[0])),
23  *dyD = thrust::raw_pointer_cast(&(domInfo->dyD[0]));
24 
25  real *bc2_r = thrust::raw_pointer_cast(&(bc2[0])),
26  *xminus = thrust::raw_pointer_cast(&(bc[XMINUS][0])),
27  *xplus = thrust::raw_pointer_cast(&(bc[XPLUS][0])),
28  *yminus = thrust::raw_pointer_cast(&(bc[YMINUS][0])),
29  *yplus = thrust::raw_pointer_cast(&(bc[YPLUS][0])),
30  *uB = thrust::raw_pointer_cast(&(B.uB[0])),
31  *vB = thrust::raw_pointer_cast(&(B.vB[0]));
32 
33  int nx = domInfo->nx,
34  ny = domInfo->ny;
35 
36  cusp::blas::fill(bc2, 0.0);
37 
38  const int blockSize = 256;
39  dim3 dimGrid( int((nx+ny-0.5)/blockSize) + 1, 1);
40  dim3 dimBlock(blockSize, 1);
41  kernels::fillBC2_v <<<dimGrid, dimBlock>>> (bc2_r, yminus, yplus, dxD, nx, ny);
42  kernels::fillBC2_u <<<dimGrid, dimBlock>>> (bc2_r, xminus, xplus, dyD, nx, ny);
43 
44  dim3 dimGridB( int((B.totalPoints-0.5)/blockSize) + 1, 1);
45  kernels::fillBC2_uvB <<<dimGridB, dimBlock>>> (bc2_r, uB, vB, B.totalPoints, nx, ny);
46 } // 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...