46 use,
intrinsic :: iso_c_binding, only : c_ptr, c_int
64 wa1_d, wa2_d, wa3_d, f_u_d, f_v_d, f_w_d, &
65 B_d, h1_d, mu, rho, n) &
66 bind(c, name =
'pnpn_prs_res_part1_hip')
67 use,
intrinsic :: iso_c_binding
70 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
71 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
72 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
73 type(c_ptr),
value :: B_d, h1_d
81 bind(c, name =
'pnpn_prs_res_part2_hip')
82 use,
intrinsic :: iso_c_binding
84 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
91 bind(c, name =
'pnpn_prs_res_part3_hip')
92 use,
intrinsic :: iso_c_binding
95 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
103 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
104 bind(c, name =
'pnpn_vel_res_update_hip')
105 use,
intrinsic :: iso_c_binding
107 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
108 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
109 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
116 wa1_d, wa2_d, wa3_d, f_u_d, f_v_d, f_w_d, &
117 B_d, h1_d, mu, rho, n) &
118 bind(c, name =
'pnpn_prs_res_part1_cuda')
119 use,
intrinsic :: iso_c_binding
122 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
123 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
124 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
125 type(c_ptr),
value :: B_d, h1_d
126 real(c_rp) :: mu, rho
133 bind(c, name =
'pnpn_prs_res_part2_cuda')
134 use,
intrinsic :: iso_c_binding
136 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
143 bind(c, name =
'pnpn_prs_res_part3_cuda')
144 use,
intrinsic :: iso_c_binding
147 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
155 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
156 bind(c, name =
'pnpn_vel_res_update_cuda')
157 use,
intrinsic :: iso_c_binding
159 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
160 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
161 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
168 wa1_d, wa2_d, wa3_d, f_u_d, f_v_d, f_w_d, &
169 B_d, h1_d, mu, rho, n) &
170 bind(c, name =
'pnpn_prs_res_part1_opencl')
171 use,
intrinsic :: iso_c_binding
174 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
175 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
176 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
177 type(c_ptr),
value :: B_d, h1_d
178 real(c_rp) :: mu, rho
185 bind(c, name =
'pnpn_prs_res_part2_opencl')
186 use,
intrinsic :: iso_c_binding
188 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
195 n) bind(c, name = 'pnpn_prs_res_part3_opencl')
196 use,
intrinsic :: iso_c_binding
199 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
207 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
208 bind(c, name =
'pnpn_vel_res_update_opencl')
209 use,
intrinsic :: iso_c_binding
211 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
212 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
213 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
219 subroutine pnpn_prs_res_part1_metal(ta1_d, ta2_d, ta3_d, &
220 wa1_d, wa2_d, wa3_d, f_u_d, f_v_d, f_w_d, &
221 B_d, h1_d, mu, rho, n) &
222 bind(c, name =
'pnpn_prs_res_part1_metal')
223 use,
intrinsic :: iso_c_binding
226 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
227 type(c_ptr),
value :: wa1_d, wa2_d, wa3_d
228 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
229 type(c_ptr),
value :: B_d, h1_d
230 real(c_rp) :: mu, rho
232 end subroutine pnpn_prs_res_part1_metal
236 subroutine pnpn_prs_res_part2_metal(p_res_d, wa1_d, wa2_d, wa3_d, n) &
237 bind(c, name =
'pnpn_prs_res_part2_metal')
238 use,
intrinsic :: iso_c_binding
240 type(c_ptr),
value :: p_res_d, wa1_d, wa2_d, wa3_d
242 end subroutine pnpn_prs_res_part2_metal
246 subroutine pnpn_prs_res_part3_metal(p_res_d, ta1_d, ta2_d, ta3_d, dtbd, &
247 n) bind(c, name = 'pnpn_prs_res_part3_metal')
248 use,
intrinsic :: iso_c_binding
251 type(c_ptr),
value :: p_res_d, ta1_d, ta2_d, ta3_d
254 end subroutine pnpn_prs_res_part3_metal
258 subroutine pnpn_vel_res_update_metal(u_res_d, v_res_d, w_res_d, &
259 ta1_d, ta2_d, ta3_d, f_u_d, f_v_d, f_w_d, n) &
260 bind(c, name =
'pnpn_vel_res_update_metal')
261 use,
intrinsic :: iso_c_binding
263 type(c_ptr),
value :: u_res_d, v_res_d, w_res_d
264 type(c_ptr),
value :: ta1_d, ta2_d, ta3_d
265 type(c_ptr),
value :: f_u_d, f_v_d, f_w_d
267 end subroutine pnpn_vel_res_update_metal
275 f_x, f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, Ax, bd, dt,&
277 type(
field_t),
intent(inout) :: p, u, v, w
278 type(
field_t),
intent(in) :: u_e, v_e, w_e
279 type(
field_t),
intent(inout) :: p_res
280 type(
field_t),
intent(in) :: f_x, f_y, f_z
281 type(
coef_t),
intent(inout) :: c_Xh
282 type(
gs_t),
intent(inout) :: gs_Xh
285 class(
ax_t),
intent(inout) :: Ax
286 real(kind=
rp),
intent(in) :: bd
287 real(kind=
rp),
intent(in) :: dt
288 type(
field_t),
intent(in) :: mu
289 type(
field_t),
intent(in) :: rho
290 type(c_ptr),
intent(inout) :: event
291 real(kind=
rp) :: dtbd
292 real(kind=
rp) :: mu_val, rho_val
294 type(
field_t),
pointer :: ta1, ta2, ta3, wa1, wa2, wa3, work1, work2
295 integer :: temp_indices(8)
299 mu_val = mu%x(1,1,1,1)
300 rho_val = rho%x(1,1,1,1)
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)
320 wa1%x_d, wa2%x_d, wa3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, &
321 c_xh%B_d, c_xh%h1_d, mu_val, rho_val, n)
325 wa1%x_d, wa2%x_d, wa3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, &
326 c_xh%B_d, c_xh%h1_d, mu_val, rho_val, n)
329 wa1%x_d, wa2%x_d, wa3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, &
330 c_xh%B_d, c_xh%h1_d, mu_val, rho_val, n)
332 call pnpn_prs_res_part1_metal(ta1%x_d, ta2%x_d, ta3%x_d, &
333 wa1%x_d, wa2%x_d, wa3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, &
334 c_xh%B_d, c_xh%h1_d, mu_val, rho_val, n)
339 call rotate_cyc(ta1%x_d, ta2%x_d, ta3%x_d, 1, c_xh)
340 call gs_xh%op(ta1%x, ta2%x, ta3%x, n, gs_op_add, event)
341 call rotate_cyc(ta1%x_d, ta2%x_d, ta3%x_d, 0, c_xh)
343 call device_opcolv(ta1%x_d, ta2%x_d, ta3%x_d, c_xh%Binv_d, gdim, n)
345 call cdtp(wa1%x, ta1%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
346 call cdtp(wa2%x, ta2%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
347 call cdtp(wa3%x, ta3%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
349 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
358 call pnpn_prs_res_part2_metal(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
368 call bc_sym_surface%apply_surfvec_dev(wa1%x_d, wa2%x_d, wa3%x_d, ta1%x_d, &
379 call pnpn_prs_res_part3_metal(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, dtbd, &
389 call bc_prs_surface%apply_surfvec_dev(ta1%x_d, ta2%x_d, ta3%x_d, &
400 call pnpn_prs_res_part3_metal(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, dtbd,&
409 p, f_x, f_y, f_z, c_Xh, msh, Xh, mu, rho, bd, dt, n)
410 class(
ax_t),
intent(in) :: Ax
411 type(
mesh_t),
intent(inout) :: msh
412 type(
space_t),
intent(inout) :: Xh
413 type(
field_t),
intent(inout) :: p, u, v, w
414 type(
field_t),
intent(inout) :: u_res, v_res, w_res
415 type(
field_t),
intent(in) :: f_x, f_y, f_z
416 type(
coef_t),
intent(inout) :: c_Xh
417 type(
field_t),
intent(in) :: mu
418 type(
field_t),
intent(in) :: rho
419 real(kind=
rp),
intent(in) :: bd
420 real(kind=
rp),
intent(in) :: dt
421 integer,
intent(in) :: n
422 integer :: temp_indices(3)
423 type(
field_t),
pointer :: ta1, ta2, ta3
424 real(kind=
rp) :: mu_val, rho_val
427 mu_val = mu%x(1,1,1,1)
428 rho_val = rho%x(1,1,1,1)
434 call ax%compute_vector(u_res%x, v_res%x, w_res%x, &
435 u%x, v%x, w%x, c_xh, msh, xh)
441 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
445 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
448 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
451 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
453 call pnpn_vel_res_update_metal(u_res%x_d, v_res%x_d, w_res%x_d, &
454 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
Apply cyclic boundary condition to a vector field.
Defines a Matrix-vector product.
subroutine, public device_rzero(a_d, n, strm)
Zero a real vector.
subroutine, public device_cfill(a_d, c, n, strm)
Set all elements to a constant c .
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.
subroutine pnpn_prs_res_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)
subroutine pnpn_vel_res_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)
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_part3_opencl(void *p_res, void *ta1, void *ta2, void *ta3, real *dtbd, int *n)
void pnpn_prs_res_part1_opencl(void *ta1, void *ta2, void *ta3, void *wa1, void *wa2, void *wa3, void *f_u, void *f_v, void *f_w, void *B, void *h1, real *mu, real *rho, int *n)
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_prs_res_part3_cuda(void *p_res, void *ta1, void *ta2, void *ta3, real *dtbd, 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_res_part1_cuda(void *ta1, void *ta2, void *ta3, void *wa1, void *wa2, void *wa3, void *f_u, void *f_v, void *f_w, void *B, void *h1, real *mu, real *rho, 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.
Abstract type to compute pressure residual.
Abstract type to compute velocity residual.
The function space for the SEM solution fields.