cuIBM
A GPU-based Immersed Boundary Method code
generateQT.inl
Go to the documentation of this file.
1 
9 
10 
19 template <>
21 {
22  const int blocksize = 256;
23 
24  int nx = domInfo->nx,
25  ny = domInfo->ny;
26 
27  int QSize = 4*nx*ny-2*(nx+ny);
28 
29  int *QRows = thrust::raw_pointer_cast(&(Q.row_indices[0])),
30  *QCols = thrust::raw_pointer_cast(&(Q.column_indices[0]));
31  int *tags_r = thrust::raw_pointer_cast(&(tagsD[0]));
32 
33  real *QVals = thrust::raw_pointer_cast(&(Q.values[0]));
34 
35  dim3 dimGrid( int((QSize-0.5)/blocksize) + 1, 1);
36  dim3 dimBlock(blocksize, 1);
37 
38  kernels::updateQ <<<dimGrid, dimBlock>>> (QRows, QCols, QVals, QSize, tags_r);
39 } // updateQ
40 
41 
45 template <typename memoryType>
47 {
49  updateQ();
51 } // generateQT
double real
Is a float or a double depending on the machine precision.
Definition: types.h:116
virtual void generateQT()
Compute the divergence operator (transpose of the gradient one).
Definition: generateQT.inl:46
Solves the Navier-Stokes equations in a rectangular domain.
Declaration of the kernels to generate gradient matrix and interpolation matrix.
virtual void generateQT()
__global__ void updateQ(int *QRows, int *QCols, real *QVals, int QSize, int *tags)
Update the gradient operator at forcing nodes.
Definition: generateQT.cu:65