37 int idx = threadIdx.x + blockIdx.x*blockDim.x;
39 if ( idx >= N )
return;
41 int I = (offset + idx*stride),
43 bc1[I] += bc[idx] * C * 0.5*(dx[i] + dx[i+1]);
68 int idx = threadIdx.x + blockIdx.x*blockDim.x;
70 if ( idx >= N )
return;
72 int I = (offset + idx*stride),
74 bc1[numU + I] += bc[idx+numUbc] * C * 0.5*(dy[j] + dy[j+1]);
98 void bc1ConvectiveU(
real *bc1,
int N,
int nx,
int offset,
int stride,
real *dx,
real *dy,
real C,
real *bc,
real *q,
real beta)
100 int idx = threadIdx.x + blockIdx.x*blockDim.x;
102 if ( idx >= N )
return;
104 int I = (offset + idx*stride),
108 bc[idx] = (1.0-beta)*bc[idx] + beta*q[I]/dy[j];
110 bc1[I] += bc[idx] * C * 0.5*(dx[i] + dx[i+1]);
136 void bc1ConvectiveV(
real *bc1,
int N,
int nx,
int numU,
int offset,
int stride,
real *dx,
real *dy,
real C,
real *bc,
int numUbc,
real *q,
real beta)
138 int idx = threadIdx.x + blockIdx.x*blockDim.x;
140 if ( idx >= N )
return;
142 int I = (offset + idx*stride),
146 bc[idx+numUbc] = (1.0-beta)*bc[idx+numUbc] + beta*q[numU + I]/dx[i];
148 bc1[numU + I] += bc[idx+numUbc] * C * 0.5*(dy[j] + dy[j+1]);
173 int idx = threadIdx.x + blockIdx.x*blockDim.x;
175 if ( idx >= N )
return;
177 int I = (offset + idx*stride),
182 bc[idx] = sin(M_PI*time/T);
184 bc1[I] += bc[idx] * C * 0.5*(dx[i] + dx[i+1]);
Declaration of the kernels to generate right hand-side terms of the intermediate velocity flux solver...
__global__ void bc1DirichletV(real *bc1, int N, int nx, int numU, int offset, int stride, real *dy, real C, real *bc, int numUbc)
Computes inhomogeneous term from the discrete Laplacian operator for the v-velocity at a given bounda...
double real
Is a float or a double depending on the machine precision.
Contains all the custom-written CUDA kernels.
__global__ void bc1DirichletU(real *bc1, int N, int nx, int offset, int stride, real *dx, real C, real *bc)
Computes inhomogeneous term from the discrete Laplacian operator for the u-velocity at a given bounda...
__global__ void bc1SpecialU(real *bc1, int N, int nx, int offset, int stride, real *dx, real C, real *bc, real time)
Computes inhomogeneous term from the discrete Laplacian operator for the u-velocity at a given bounda...
__global__ void bc1ConvectiveV(real *bc1, int N, int nx, int numU, int offset, int stride, real *dx, real *dy, real C, real *bc, int numUbc, real *q, real beta)
Computes inhomogeneous term from the discrete Laplacian operator for the v-velocity at a given bounda...
__global__ void bc1ConvectiveU(real *bc1, int N, int nx, int offset, int stride, real *dx, real *dy, real C, real *bc, real *q, real beta)
Computes inhomogeneous term from the discrete Laplacian operator for the u-velocity at a given bounda...