35 #ifndef __FLUID_PRS_STRESS_RES_KERNEL__
36 #define __FLUID_PRS_STRESS_RES_KERNEL__
38 template<
typename T >
45 const T * __restrict__ s11,
46 const T * __restrict__ s22,
47 const T * __restrict__ s33,
48 const T * __restrict__ s12,
49 const T * __restrict__ s13,
50 const T * __restrict__ s23,
51 const T * __restrict__ f_u,
52 const T * __restrict__ f_v,
53 const T * __restrict__ f_w,
54 const T * __restrict__ B,
55 const T * __restrict__ rho,
58 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
59 const int str = blockDim.x * gridDim.x;
61 for (
int i = idx;
i < n;
i += str) {
62 wa1[
i] -= 2.0 * (ta1[
i] * s11[
i]
65 wa2[
i] -= 2.0 * (ta1[
i] * s12[
i]
68 wa3[
i] -= 2.0 * (ta1[
i] * s13[
i]
72 ta1[
i] = (f_u[
i] / rho[
i]) - ((wa1[
i] / rho[
i]) * B[
i]);
73 ta2[
i] = (f_v[
i] / rho[
i]) - ((wa2[
i] / rho[
i]) * B[
i]);
74 ta3[
i] = (f_w[
i] / rho[
i]) - ((wa3[
i] / rho[
i]) * B[
i]);
79 template<
typename T >
81 const T * __restrict__ ta1,
82 const T * __restrict__ ta2,
83 const T * __restrict__ ta3,
84 const T * __restrict__ wa1,
85 const T * __restrict__ wa2,
86 const T * __restrict__ wa3,
90 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
91 const int str = blockDim.x * gridDim.x;
93 for (
int i = idx;
i < n;
i += str) {
94 p_res[
i] = p_res[
i] - (dtbd * (ta1[
i] + ta2[
i] + ta3[
i]))
95 - (wa1[
i] + wa2[
i] + wa3[
i]);
__global__ void prs_stress_res_part1_kernel(T *__restrict__ ta1, T *__restrict__ ta2, T *__restrict__ ta3, T *__restrict__ wa1, T *__restrict__ wa2, T *__restrict__ wa3, const T *__restrict__ s11, const T *__restrict__ s22, const T *__restrict__ s33, const T *__restrict__ s12, const T *__restrict__ s13, const T *__restrict__ s23, 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)
__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)