35 #ifndef __FLUID_PRS_RES_KERNEL__
36 #define __FLUID_PRS_RES_KERNEL__
38 template<
typename T >
42 const T * __restrict__ wa1,
43 const T * __restrict__ wa2,
44 const T * __restrict__ wa3,
45 const T * __restrict__ f_u,
46 const T * __restrict__ f_v,
47 const T * __restrict__ f_w,
48 const T * __restrict__ B,
54 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
55 const int str = blockDim.x * gridDim.x;
56 const T inv_rho = 1.0 / rho;
58 for (
int i = idx;
i < n;
i += str) {
60 ta1[
i] = (f_u[
i] / rho) - ((wa1[
i] * (mu / rho)) * B[
i]);
61 ta2[
i] = (f_v[
i] / rho) - ((wa2[
i] * (mu / rho)) * B[
i]);
62 ta3[
i] = (f_w[
i] / rho) - ((wa3[
i] * (mu / rho)) * B[
i]);
68 template<
typename T >
70 const T * __restrict__ wa1,
71 const T * __restrict__ wa2,
72 const T * __restrict__ wa3,
75 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
76 const int str = blockDim.x * gridDim.x;
78 for (
int i = idx;
i < n;
i += str) {
79 p_res[
i] = (-p_res[
i]) + (wa1[
i] + wa2[
i] + wa3[
i]);
83 template<
typename T >
85 const T * __restrict__ ta1,
86 const T * __restrict__ ta2,
87 const T * __restrict__ ta3,
91 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
92 const int str = blockDim.x * gridDim.x;
94 for (
int i = idx;
i < n;
i += str) {
95 p_res[
i] = p_res[
i] - (dtbd * (ta1[
i] + ta2[
i] + ta3[
i]));
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ h1
__global__ void prs_res_part3_kernel(T *__restrict__ p_res, const T *__restrict__ ta1, const T *__restrict__ ta2, const T *__restrict__ ta3, const T dtbd, const int n)
__global__ void prs_res_part2_kernel(T *__restrict__ p_res, const T *__restrict__ wa1, const T *__restrict__ wa2, const T *__restrict__ wa3, const int n)
__global__ void prs_res_part1_kernel(T *__restrict__ ta1, T *__restrict__ ta2, T *__restrict__ ta3, const T *__restrict__ wa1, const T *__restrict__ wa2, const T *__restrict__ wa3, const T *__restrict__ f_u, const T *__restrict__ f_v, const T *__restrict__ f_w, const T *__restrict__ B, T *__restrict__ h1, const T mu, const T rho, const int n)