Neko 1.99.6
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
pnpn_res_stress_device.F90
Go to the documentation of this file.
1
3 use gather_scatter, only : gs_t, gs_op_add
5 use field, only : field_t
6 use ax_product, only : ax_t
7 use coefs, only : coef_t
11 use mesh, only : mesh_t
12 use num_types, only : rp, c_rp
13 use space, only : space_t
14 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
18 implicit none
19 private
20
24 contains
25 procedure, nopass :: compute => pnpn_prs_res_stress_device_compute
27
31 contains
32 procedure, nopass :: compute => pnpn_vel_res_stress_device_compute
34
35#ifdef HAVE_HIP
36 interface
37 subroutine pnpn_prs_stress_res_part1_hip(ta1_d, ta2_d, ta3_d, &
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
43 import c_rp
44 implicit none
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
50 integer(c_int) :: n
52 end interface
53
54 interface
55 subroutine pnpn_prs_res_part2_hip(p_res_d, wa1_d, wa2_d, wa3_d, n) &
56 bind(c, name = 'pnpn_prs_res_part2_hip')
57 use, intrinsic :: iso_c_binding
58 implicit none
59 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
60 integer(c_int) :: n
61 end subroutine pnpn_prs_res_part2_hip
62 end interface
63
64 interface
65 subroutine pnpn_prs_stress_res_part3_hip(p_res_d, ta1_d, ta2_d, ta3_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
69 import c_rp
70 implicit none
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
73 real(c_rp) :: dtbd
74 integer(c_int) :: n
76 end interface
77
78 interface
79 subroutine pnpn_vel_res_update_hip(u_res_d, v_res_d, w_res_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
83 implicit none
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
87 integer(c_int) :: n
88 end subroutine pnpn_vel_res_update_hip
89 end interface
90#elif HAVE_CUDA
91 interface
92 subroutine pnpn_prs_stress_res_part1_cuda(ta1_d, ta2_d, ta3_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
98 import c_rp
99 implicit none
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
105 integer(c_int) :: n
106 end subroutine pnpn_prs_stress_res_part1_cuda
107 end interface
108
109 interface
110 subroutine pnpn_prs_res_part2_cuda(p_res_d, wa1_d, wa2_d, wa3_d, n) &
111 bind(c, name = 'pnpn_prs_res_part2_cuda')
112 use, intrinsic :: iso_c_binding
113 implicit none
114 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
115 integer(c_int) :: n
116 end subroutine pnpn_prs_res_part2_cuda
117 end interface
118
119 interface
120 subroutine pnpn_prs_stress_res_part3_cuda(p_res_d, ta1_d, ta2_d, ta3_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
124 import c_rp
125 implicit none
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
128 real(c_rp) :: dtbd
129 integer(c_int) :: n
130 end subroutine pnpn_prs_stress_res_part3_cuda
131 end interface
132
133 interface
134 subroutine pnpn_vel_res_update_cuda(u_res_d, v_res_d, w_res_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
138 implicit none
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
142 integer(c_int) :: n
143 end subroutine pnpn_vel_res_update_cuda
144 end interface
145#elif HAVE_OPENCL
146 interface
147 subroutine pnpn_prs_stress_res_part1_opencl(ta1_d, ta2_d, ta3_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
153 import c_rp
154 implicit none
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
160 integer(c_int) :: n
162 end interface
163
164 interface
165 subroutine pnpn_prs_res_part2_opencl(p_res_d, wa1_d, wa2_d, wa3_d, n) &
166 bind(c, name = 'pnpn_prs_res_part2_opencl')
167 use, intrinsic :: iso_c_binding
168 implicit none
169 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
170 integer(c_int) :: n
171 end subroutine pnpn_prs_res_part2_opencl
172 end interface
173
174 interface
175 subroutine pnpn_prs_stress_res_part3_opencl(p_res_d, ta1_d, ta2_d, ta3_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
179 import c_rp
180 implicit none
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
183 real(c_rp) :: dtbd
184 integer(c_int) :: n
186 end interface
187
188
189 interface
190 subroutine pnpn_vel_res_update_opencl(u_res_d, v_res_d, w_res_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
194 implicit none
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
198 integer(c_int) :: n
199 end subroutine pnpn_vel_res_update_opencl
200 end interface
201#elif HAVE_METAL
202 interface
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
209 import c_rp
210 implicit none
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
216 integer(c_int) :: n
217 end subroutine pnpn_prs_stress_res_part1_metal
218 end interface
219
220 interface
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
224 implicit none
225 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
226 integer(c_int) :: n
227 end subroutine pnpn_prs_res_part2_metal
228 end interface
229
230 interface
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
235 import c_rp
236 implicit none
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
239 real(c_rp) :: dtbd
240 integer(c_int) :: n
241 end subroutine pnpn_prs_stress_res_part3_metal
242 end interface
243
244 interface
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
249 implicit none
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
253 integer(c_int) :: n
254 end subroutine pnpn_vel_res_update_metal
255 end interface
256#endif
257
258contains
259
260 subroutine pnpn_prs_res_stress_device_compute(p, p_res, u, v, w, u_e, v_e,&
261 w_e, f_x, f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, Ax, bd,&
262 dt, mu, rho, event)
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
269 type(facet_normal_t), intent(in) :: bc_prs_surface
270 type(facet_normal_t), intent(in) :: bc_sym_surface
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
279 integer :: i, e
280 ! Work arrays
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)
284
285 ! Work arrays
286 call neko_scratch_registry%request_field(ta1, temp_indices(1), .false.)
287 call neko_scratch_registry%request_field(ta2, temp_indices(2), .false.)
288 call neko_scratch_registry%request_field(ta3, temp_indices(3), .false.)
289 call neko_scratch_registry%request_field(wa1, temp_indices(4), .false.)
290 call neko_scratch_registry%request_field(wa2, temp_indices(5), .false.)
291 call neko_scratch_registry%request_field(wa3, temp_indices(6), .false.)
292 call neko_scratch_registry%request_field(work1, temp_indices(7), .false.)
293 call neko_scratch_registry%request_field(work2, temp_indices(8), .false.)
294
295 ! Stress tensor
296 call neko_scratch_registry%request_field(s11, temp_indices(9), .false.)
297 call neko_scratch_registry%request_field(s22, temp_indices(10), .false.)
298 call neko_scratch_registry%request_field(s33, temp_indices(11), .false.)
299 call neko_scratch_registry%request_field(s12, temp_indices(12), .false.)
300 call neko_scratch_registry%request_field(s13, temp_indices(13), .false.)
301 call neko_scratch_registry%request_field(s23, temp_indices(14), .false.)
302
303 n = c_xh%dof%size()
304 lxyz = c_xh%Xh%lxyz
305 nelv = c_xh%msh%nelv
306 gdim = c_xh%msh%gdim
307
308 call device_copy(c_xh%h1_d, rho%x_d, n)
309 call device_invcol1(c_xh%h1_d, n)
310 call device_rzero(c_xh%h2_d, n)
311 c_xh%ifh2 = .false.
312
313 ! mu times the double curl of the velocity
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)
316
317 call device_col2(wa1%x_d, mu%x_d, n)
318 call device_col2(wa2%x_d, mu%x_d, n)
319 call device_col2(wa3%x_d, mu%x_d, n)
320
321
322 ! The strain rate tensor
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)
325
326
327 ! Gradient of viscosity * 2
328 !call opgrad(ta1%x, ta2%x, ta3%x, mu%x, 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)
332
333#ifdef HAVE_HIP
334 call pnpn_prs_stress_res_part1_hip(ta1%x_d, ta2%x_d, ta3%x_d, &
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)
339#elif HAVE_CUDA
340 call pnpn_prs_stress_res_part1_cuda(ta1%x_d, ta2%x_d, ta3%x_d, &
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)
345#elif HAVE_OPENCL
346 call pnpn_prs_stress_res_part1_opencl(ta1%x_d, ta2%x_d, ta3%x_d, &
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)
351#elif HAVE_METAL
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)
357#endif
358
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)
362
363 call device_opcolv(ta1%x_d, ta2%x_d, ta3%x_d, c_xh%Binv_d, gdim, n)
364
365 ! Compute the components of the divergence of the rhs
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)
369
370 ! The laplacian of the pressure
371 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
372
373#ifdef HAVE_HIP
374 call pnpn_prs_res_part2_hip(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
375#elif HAVE_CUDA
376 call pnpn_prs_res_part2_cuda(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
377#elif HAVE_OPENCL
378 call pnpn_prs_res_part2_opencl(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
379#elif HAVE_METAL
380 call pnpn_prs_res_part2_metal(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
381#endif
382
383 !
384 ! Surface velocity terms
385 !
386 call device_rzero(wa1%x_d, n)
387 call device_rzero(wa2%x_d, n)
388 call device_rzero(wa3%x_d, n)
389
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)
392
393 dtbd = bd / dt
394 call device_rzero(ta1%x_d, n)
395 call device_rzero(ta2%x_d, n)
396 call device_rzero(ta3%x_d, n)
397
398 call bc_prs_surface%apply_surfvec_dev(ta1%x_d, ta2%x_d, ta3%x_d, &
399 u%x_D, v%x_d, w%x_d)
400
401#ifdef HAVE_HIP
402 call pnpn_prs_stress_res_part3_hip(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, &
403 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
404#elif HAVE_CUDA
405 call pnpn_prs_stress_res_part3_cuda(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, &
406 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
407#elif HAVE_OPENCL
408 call pnpn_prs_stress_res_part3_opencl(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d,&
409 wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
410#elif HAVE_METAL
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)
413#endif
414
415 call neko_scratch_registry%relinquish_field(temp_indices)
416
418
419 subroutine pnpn_vel_res_stress_device_compute(Ax, u, v, w, u_res, v_res, &
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
436 integer :: i
437
438 call device_copy(c_xh%h1_d, mu%x_d, n)
439 call device_copy(c_xh%h2_d, rho%x_d, n)
440
441 bddt = bd / dt
442 call device_cmult(c_xh%h2_d, bddt, n)
443
444 c_xh%ifh2 = .true.
445
446 ! Viscous stresses
447 call ax%compute_vector(u_res%x, v_res%x, w_res%x, u%x, v%x, w%x, c_xh,&
448 msh, xh)
449
450 call neko_scratch_registry%request_field(ta1, temp_indices(1), .false.)
451 call neko_scratch_registry%request_field(ta2, temp_indices(2), .false.)
452 call neko_scratch_registry%request_field(ta3, temp_indices(3), .false.)
453
454 ! Pressure gradient
455 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
456
457 ! Sum all the terms
458#ifdef HAVE_HIP
459 call pnpn_vel_res_update_hip(u_res%x_d, v_res%x_d, w_res%x_d, &
460 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
461#elif HAVE_CUDA
462 call pnpn_vel_res_update_cuda(u_res%x_d, v_res%x_d, w_res%x_d, &
463 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
464#elif HAVE_OPENCL
465 call pnpn_vel_res_update_opencl(u_res%x_d, v_res%x_d, w_res%x_d, &
466 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
467#elif HAVE_METAL
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)
470#endif
471
472 call neko_scratch_registry%relinquish_field(temp_indices)
473
475
476end module pnpn_res_stress_device
Compute derivative of a scalar field along a single direction.
Definition operators.f90:78
Apply cyclic boundary condition to a vector field.
Compute the strain rate tensor of a vector field.
Defines a Matrix-vector product.
Definition ax.f90:34
Coefficients.
Definition coef.f90:34
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.
Defines a field.
Definition field.f90:34
Gather-scatter.
Defines a mesh.
Definition mesh.f90:34
integer, parameter, public c_rp
Definition num_types.f90:13
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Operators.
Definition operators.f90:34
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.
Definition pnpn_res.f90:34
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.
Definition space.f90:34
void pnpn_prs_res_part2_opencl(void *p_res, void *wa1, void *wa2, void *wa3, int *n)
Definition pnpn_res.c:88
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)
Definition pnpn_res.c:143
void pnpn_prs_res_part2_cuda(void *p_res, void *wa1, void *wa2, void *wa3, int *n)
Definition pnpn_res.cu:63
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)
Definition pnpn_res.cu:92
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 .
Definition ax.f90:43
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:63
Dirichlet condition in facet normal direction.
Gather-scatter kernel.
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.
Definition pnpn_res.f90:48
Abstract type to compute velocity residual.
Definition pnpn_res.f90:54
The function space for the SEM solution fields.
Definition space.f90:64