14 use,
intrinsic :: iso_c_binding, only : c_ptr, c_int
38 wa1_d, wa2_d, wa3_d, s11_d, s22_d, s33_d, &
39 s12_d, s13_d, s23_d, f_u_d, f_v_d, f_w_d, &
40 B_d, h1_d, rho_d, n) &
41 bind(c, name =
'pnpn_prs_stress_res_part1_hip')
42 use,
intrinsic :: iso_c_binding
45 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
46 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
47 type(c_ptr),
value :: s11_d, s22_d, s33_d, s12_d, s13_d, s23_d
48 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
49 type(c_ptr),
value :: B_d, h1_d, rho_d
56 bind(c, name =
'pnpn_prs_res_part2_hip')
57 use,
intrinsic :: iso_c_binding
59 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
66 wa1_d, wa2_d, wa3_d, dtbd, n) &
67 bind(c, name =
'pnpn_prs_stress_res_part3_hip')
68 use,
intrinsic :: iso_c_binding
71 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
72 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
80 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
81 bind(c, name =
'pnpn_vel_res_update_hip')
82 use,
intrinsic :: iso_c_binding
84 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
85 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
86 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
93 wa1_d, wa2_d, wa3_d, s11_d, s22_d, s33_d, &
94 s12_d, s13_d, s23_d, f_u_d, f_v_d, f_w_d, &
95 B_d, h1_d, rho_d, n) &
96 bind(c, name =
'pnpn_prs_stress_res_part1_cuda')
97 use,
intrinsic :: iso_c_binding
100 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
101 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
102 type(c_ptr),
value :: s11_d, s22_d, s33_d, s12_d, s13_d, s23_d
103 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
104 type(c_ptr),
value :: B_d, h1_d, rho_d
111 bind(c, name =
'pnpn_prs_res_part2_cuda')
112 use,
intrinsic :: iso_c_binding
114 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
121 wa1_d, wa2_d, wa3_d, dtbd, n) &
122 bind(c, name =
'pnpn_prs_stress_res_part3_cuda')
123 use,
intrinsic :: iso_c_binding
126 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
127 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
135 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
136 bind(c, name =
'pnpn_vel_res_update_cuda')
137 use,
intrinsic :: iso_c_binding
139 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
140 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
141 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
148 wa1_d, wa2_d, wa3_d, s11_d, s22_d, s33_d, &
149 s12_d, s13_d, s23_d, f_u_d, f_v_d, f_w_d, &
150 B_d, h1_d, rho_d, n) &
151 bind(c, name =
'pnpn_prs_stress_res_part1_opencl')
152 use,
intrinsic :: iso_c_binding
155 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
156 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
157 type(c_ptr),
value :: s11_d, s22_d, s33_d, s12_d, s13_d, s23_d
158 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
159 type(c_ptr),
value :: B_d, h1_d, rho_d
166 bind(c, name =
'pnpn_prs_res_part2_opencl')
167 use,
intrinsic :: iso_c_binding
169 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
176 wa1_d, wa2_d, wa3_d, dtbd, n) &
177 bind(c, name =
'pnpn_prs_stress_res_part3_opencl')
178 use,
intrinsic :: iso_c_binding
181 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
182 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
191 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
192 bind(c, name =
'pnpn_vel_res_update_opencl')
193 use,
intrinsic :: iso_c_binding
195 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
196 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
197 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
203 subroutine pnpn_prs_stress_res_part1_metal(ta1_d, ta2_d, ta3_d, &
204 wa1_d, wa2_d, wa3_d, s11_d, s22_d, s33_d, &
205 s12_d, s13_d, s23_d, f_u_d, f_v_d, f_w_d, &
206 B_d, h1_d, rho_d, n) &
207 bind(c, name =
'pnpn_prs_stress_res_part1_metal')
208 use,
intrinsic :: iso_c_binding
211 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
212 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
213 type(c_ptr),
value :: s11_d, s22_d, s33_d, s12_d, s13_d, s23_d
214 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
215 type(c_ptr),
value :: B_d, h1_d, rho_d
217 end subroutine pnpn_prs_stress_res_part1_metal
221 subroutine pnpn_prs_res_part2_metal(p_res_d, wa1_d, wa2_d, wa3_d, n) &
222 bind(c, name =
'pnpn_prs_res_part2_metal')
223 use,
intrinsic :: iso_c_binding
225 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
227 end subroutine pnpn_prs_res_part2_metal
231 subroutine pnpn_prs_stress_res_part3_metal(p_res_d, ta1_d, ta2_d, ta3_d, &
232 wa1_d, wa2_d, wa3_d, dtbd, n) &
233 bind(c, name =
'pnpn_prs_stress_res_part3_metal')
234 use,
intrinsic :: iso_c_binding
237 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
238 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
241 end subroutine pnpn_prs_stress_res_part3_metal
245 subroutine pnpn_vel_res_update_metal(u_res_d, v_res_d, w_res_d, &
246 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
247 bind(c, name =
'pnpn_vel_res_update_metal')
248 use,
intrinsic :: iso_c_binding
250 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
251 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
252 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
254 end subroutine pnpn_vel_res_update_metal
261 w_e, f_x, f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, Ax, bd,&
263 type(
field_t),
intent(inout) :: p, u, v, w
264 type(
field_t),
intent(in) :: u_e, v_e, w_e
265 type(
field_t),
intent(inout) :: p_res
266 type(
field_t),
intent(in) :: f_x, f_y, f_z
267 type(
coef_t),
intent(inout) :: c_Xh
268 type(
gs_t),
intent(inout) :: gs_Xh
271 class(
ax_t),
intent(inout) :: Ax
272 real(kind=
rp),
intent(in) :: bd
273 real(kind=
rp),
intent(in) :: dt
274 type(
field_t),
intent(in) :: mu
275 type(
field_t),
intent(in) :: rho
276 type(c_ptr),
intent(inout) :: event
277 real(kind=
rp) :: dtbd
278 integer :: n, nelv, lxyz, gdim
281 type(
field_t),
pointer :: ta1, ta2, ta3, wa1, wa2, wa3, work1, work2
282 type(
field_t),
pointer :: s11, s22, s33, s12, s13, s23
283 integer :: temp_indices(14)
314 call curl(ta1, ta2, ta3, u_e, v_e, w_e, work1, work2, c_xh, event)
315 call curl(wa1, wa2, wa3, ta1, ta2, ta3, work1, work2, c_xh, event)
323 call strain_rate(s11%x_d, s22%x_d, s33%x_d, s12%x_d, s13%x_d, s23%x_d, &
324 u_e%x_d, v_e%x_d, w_e%x_d, c_xh)
329 call dudxyz(ta1%x_d, mu%x_d, c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d, c_xh)
330 call dudxyz(ta2%x_d, mu%x_d, c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d, c_xh)
331 call dudxyz(ta3%x_d, mu%x_d, c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d, c_xh)
335 wa1%x_d, wa2%x_d, wa3%x_d, &
336 s11%x_d, s22%x_d, s33%x_d, s12%x_d, s13%x_d, s23%x_d, &
337 f_x%x_d, f_y%x_d, f_z%x_d, &
338 c_xh%B_d, c_xh%h1_d, rho%x_d, n)
341 wa1%x_d, wa2%x_d, wa3%x_d, &
342 s11%x_d, s22%x_d, s33%x_d, s12%x_d, s13%x_d, s23%x_d, &
343 f_x%x_d, f_y%x_d, f_z%x_d, &
344 c_xh%B_d, c_xh%h1_d, rho%x_d, n)
347 wa1%x_d, wa2%x_d, wa3%x_d, &
348 s11%x_d, s22%x_d, s33%x_d, s12%x_d, s13%x_d, s23%x_d, &
349 f_x%x_d, f_y%x_d, f_z%x_d, &
350 c_xh%B_d, c_xh%h1_d, rho%x_d, n)
352 call pnpn_prs_stress_res_part1_metal(ta1%x_d, ta2%x_d, ta3%x_d, &
353 wa1%x_d, wa2%x_d, wa3%x_d, &
354 s11%x_d, s22%x_d, s33%x_d, s12%x_d, s13%x_d, s23%x_d, &
355 f_x%x_d, f_y%x_d, f_z%x_d, &
356 c_xh%B_d, c_xh%h1_d, rho%x_d, n)
359 call rotate_cyc(ta1%x_d, ta2%x_d, ta3%x_d, 1, c_xh)
360 call gs_xh%op(ta1%x, ta2%x, ta3%x, n, gs_op_add)
361 call rotate_cyc(ta1%x_d, ta2%x_d, ta3%x_d, 0, c_xh)
363 call device_opcolv(ta1%x_d, ta2%x_d, ta3%x_d, c_xh%Binv_d, gdim, n)
366 call cdtp(wa1%x, ta1%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
367 call cdtp(wa2%x, ta2%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
368 call cdtp(wa3%x, ta3%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
371 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
380 call pnpn_prs_res_part2_metal(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
390 call bc_sym_surface%apply_surfvec_dev(wa1%x_d, wa2%x_d, wa3%x_d, &
391 ta1%x_d , ta2%x_d, ta3%x_d)
398 call bc_prs_surface%apply_surfvec_dev(ta1%x_d, ta2%x_d, ta3%x_d, &
403 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
406 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
409 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
411 call pnpn_prs_stress_res_part3_metal(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d,&
412 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
420 w_res, p, f_x, f_y, f_z, c_Xh, msh, Xh, mu, rho, bd, dt, n)
421 class(
ax_t),
intent(in) :: Ax
422 type(
mesh_t),
intent(inout) :: msh
423 type(
space_t),
intent(inout) :: Xh
424 type(
field_t),
intent(inout) :: p, u, v, w
425 type(
field_t),
intent(inout) :: u_res, v_res, w_res
426 type(
field_t),
intent(in) :: f_x, f_y, f_z
427 type(
coef_t),
intent(inout) :: c_Xh
428 type(
field_t),
intent(in) :: mu
429 type(
field_t),
intent(in) :: rho
430 real(kind=
rp),
intent(in) :: bd
431 real(kind=
rp),
intent(in) :: dt
432 real(kind=
rp) :: bddt
433 integer :: temp_indices(3)
434 type(
field_t),
pointer :: ta1, ta2, ta3
435 integer,
intent(in) :: n
447 call ax%compute_vector(u_res%x, v_res%x, w_res%x, u%x, v%x, w%x, c_xh,&
455 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
460 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
463 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
466 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
468 call pnpn_vel_res_update_metal(u_res%x_d, v_res%x_d, w_res%x_d, &
469 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
Compute derivative of a scalar field along a single direction.
Apply cyclic boundary condition to a vector field.
Compute the strain rate tensor of a vector field.
Defines a Matrix-vector product.
subroutine, public device_invcol1(a_d, n, strm)
Invert a vector .
subroutine, public device_rzero(a_d, n, strm)
Zero a real vector.
subroutine, public device_cmult(a_d, c, n, strm)
Multiplication by constant c .
subroutine, public device_copy(a_d, b_d, n, strm)
Copy a vector .
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
subroutine, public device_opcolv(a1_d, a2_d, a3_d, c_d, gdim, n)
Dirichlet condition applied in the facet normal direction.
integer, parameter, public c_rp
integer, parameter, public rp
Global precision used in computations.
subroutine, public opgrad(ux, uy, uz, u, coef, es, ee)
Compute the weak gradient of a scalar field, i.e. the gradient multiplied by the mass matrix.
subroutine, public curl(w1, w2, w3, u1, u2, u3, work1, work2, coef, event)
subroutine, public cdtp(dtx, x, dr, ds, dt, coef, es, ee)
Apply D^T to a scalar field, where D is the derivative matrix.
Residuals in the Pn-Pn formulation (device version)
subroutine pnpn_vel_res_stress_device_compute(ax, u, v, w, u_res, v_res, w_res, p, f_x, f_y, f_z, c_xh, msh, xh, mu, rho, bd, dt, n)
subroutine pnpn_prs_res_stress_device_compute(p, p_res, u, v, w, u_e, v_e, w_e, f_x, f_y, f_z, c_xh, gs_xh, bc_prs_surface, bc_sym_surface, ax, bd, dt, mu, rho, event)
Defines Pressure and velocity residuals in the Pn-Pn formulation.
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Defines a function space.
void pnpn_prs_res_part2_opencl(void *p_res, void *wa1, void *wa2, void *wa3, int *n)
void pnpn_vel_res_update_opencl(void *u_res, void *v_res, void *w_res, void *ta1, void *ta2, void *ta3, void *f_u, void *f_v, void *f_w, int *n)
void pnpn_prs_res_part2_cuda(void *p_res, void *wa1, void *wa2, void *wa3, int *n)
void pnpn_vel_res_update_cuda(void *u_res, void *v_res, void *w_res, void *ta1, void *ta2, void *ta3, void *f_u, void *f_v, void *f_w, int *n)
void pnpn_prs_stress_res_part1_opencl(void *ta1, void *ta2, void *ta3, void *wa1, void *wa2, void *wa3, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, void *f_u, void *f_v, void *f_w, void *B, void *h1, void *rho, int *n)
void pnpn_prs_stress_res_part3_opencl(void *p_res, void *ta1, void *ta2, void *ta3, void *wa1, void *wa2, void *wa3, real *dtbd, int *n)
void pnpn_prs_stress_res_part1_cuda(void *ta1, void *ta2, void *ta3, void *wa1, void *wa2, void *wa3, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, void *f_u, void *f_v, void *f_w, void *B, void *h1, void *rho, int *n)
void pnpn_prs_stress_res_part3_cuda(void *p_res, void *ta1, void *ta2, void *ta3, void *wa1, void *wa2, void *wa3, real *dtbd, int *n)
Base type for a matrix-vector product providing .
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Dirichlet condition in facet normal direction.
Device implementation of the pressure residual for the PnPn fluid with full viscous stress formulatio...
Device implementation of the velocity residual for the PnPn fluid with full viscous stress formulatio...
Abstract type to compute pressure residual.
Abstract type to compute velocity residual.
The function space for the SEM solution fields.