35 #ifndef __FLUID_PRS_STRESS_RES_KERNEL__
36 #define __FLUID_PRS_STRESS_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,
49 const T * __restrict__ rho,
52 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
53 const int str = blockDim.x * gridDim.x;
55 for (
int i = idx;
i < n;
i += str) {
56 ta1[
i] = (f_u[
i] / rho[
i]) - ((wa1[
i] / rho[
i]) * B[
i]);
57 ta2[
i] = (f_v[
i] / rho[
i]) - ((wa2[
i] / rho[
i]) * B[
i]);
58 ta3[
i] = (f_w[
i] / rho[
i]) - ((wa3[
i] / rho[
i]) * B[
i]);
63 template<
typename T >
65 const T * __restrict__ ta1,
66 const T * __restrict__ ta2,
67 const T * __restrict__ ta3,
68 const T * __restrict__ wa1,
69 const T * __restrict__ wa2,
70 const T * __restrict__ wa3,
74 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
75 const int str = blockDim.x * gridDim.x;
77 for (
int i = idx;
i < n;
i += str) {
78 p_res[
i] = p_res[
i] - (dtbd * (ta1[
i] + ta2[
i] + ta3[
i]))
79 - (wa1[
i] + wa2[
i] + wa3[
i]);
__global__ void prs_stress_res_part3_kernel(T *__restrict__ p_res, const T *__restrict__ ta1, const T *__restrict__ ta2, const T *__restrict__ ta3, const T *__restrict__ wa1, const T *__restrict__ wa2, const T *__restrict__ wa3, const T dtbd, const int n)
__global__ void prs_stress_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, const T *__restrict__ rho, const int n)