Neko 1.99.11
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
pnpn_res_device.F90
Go to the documentation of this file.
1! Copyright (c) 2022-2025, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
34 use gather_scatter, only : gs_t, gs_op_add
35 use operators, only : curl, cdtp, rotate_cyc, opgrad
36 use field, only : field_t
37 use ax_product, only : ax_t
38 use coefs, only : coef_t
40 use mesh, only : mesh_t
41 use num_types, only : rp, c_rp
42 use space, only : space_t
46 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
48 implicit none
49 private
50
51 type, public, extends(pnpn_prs_res_t) :: pnpn_prs_res_device_t
52 contains
53 procedure, nopass :: compute => pnpn_prs_res_device_compute
55
56 type, public, extends(pnpn_vel_res_t) :: pnpn_vel_res_device_t
57 contains
58 procedure, nopass :: compute => pnpn_vel_res_device_compute
60
61#ifdef HAVE_HIP
62 interface
63 subroutine pnpn_prs_res_part1_hip(ta1_d, ta2_d, ta3_d, &
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
68 import c_rp
69 implicit none
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
74 real(c_rp) :: mu, rho
75 integer(c_int) :: n
76 end subroutine pnpn_prs_res_part1_hip
77 end interface
78
79 interface
80 subroutine pnpn_prs_res_part2_hip(p_res_d, wa1_d, wa2_d, wa3_d, n) &
81 bind(c, name = 'pnpn_prs_res_part2_hip')
82 use, intrinsic :: iso_c_binding
83 implicit none
84 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
85 integer(c_int) :: n
86 end subroutine pnpn_prs_res_part2_hip
87 end interface
88
89 interface
90 subroutine pnpn_prs_res_part3_hip(p_res_d, ta1_d, ta2_d, ta3_d, dtbd, n) &
91 bind(c, name = 'pnpn_prs_res_part3_hip')
92 use, intrinsic :: iso_c_binding
93 import c_rp
94 implicit none
95 type(c_ptr), value :: p_res_d, ta1_d, ta2_d, ta3_d
96 real(c_rp) :: dtbd
97 integer(c_int) :: n
98 end subroutine pnpn_prs_res_part3_hip
99 end interface
100
101 interface
102 subroutine pnpn_vel_res_update_hip(u_res_d, v_res_d, w_res_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
106 implicit none
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
110 integer(c_int) :: n
111 end subroutine pnpn_vel_res_update_hip
112 end interface
113#elif HAVE_CUDA
114 interface
115 subroutine pnpn_prs_res_part1_cuda(ta1_d, ta2_d, ta3_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
120 import c_rp
121 implicit none
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
127 integer(c_int) :: n
128 end subroutine pnpn_prs_res_part1_cuda
129 end interface
130
131 interface
132 subroutine pnpn_prs_res_part2_cuda(p_res_d, wa1_d, wa2_d, wa3_d, n) &
133 bind(c, name = 'pnpn_prs_res_part2_cuda')
134 use, intrinsic :: iso_c_binding
135 implicit none
136 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
137 integer(c_int) :: n
138 end subroutine pnpn_prs_res_part2_cuda
139 end interface
140
141 interface
142 subroutine pnpn_prs_res_part3_cuda(p_res_d, ta1_d, ta2_d, ta3_d, dtbd, n) &
143 bind(c, name = 'pnpn_prs_res_part3_cuda')
144 use, intrinsic :: iso_c_binding
145 import c_rp
146 implicit none
147 type(c_ptr), value :: p_res_d, ta1_d, ta2_d, ta3_d
148 real(c_rp) :: dtbd
149 integer(c_int) :: n
150 end subroutine pnpn_prs_res_part3_cuda
151 end interface
152
153 interface
154 subroutine pnpn_vel_res_update_cuda(u_res_d, v_res_d, w_res_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
158 implicit none
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
162 integer(c_int) :: n
163 end subroutine pnpn_vel_res_update_cuda
164 end interface
165#elif HAVE_OPENCL
166 interface
167 subroutine pnpn_prs_res_part1_opencl(ta1_d, ta2_d, ta3_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
172 import c_rp
173 implicit none
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
179 integer(c_int) :: n
180 end subroutine pnpn_prs_res_part1_opencl
181 end interface
182
183 interface
184 subroutine pnpn_prs_res_part2_opencl(p_res_d, wa1_d, wa2_d, wa3_d, n) &
185 bind(c, name = 'pnpn_prs_res_part2_opencl')
186 use, intrinsic :: iso_c_binding
187 implicit none
188 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
189 integer(c_int) :: n
190 end subroutine pnpn_prs_res_part2_opencl
191 end interface
192
193 interface
194 subroutine pnpn_prs_res_part3_opencl(p_res_d, ta1_d, ta2_d, ta3_d, dtbd, &
195 n) bind(c, name = 'pnpn_prs_res_part3_opencl')
196 use, intrinsic :: iso_c_binding
197 import c_rp
198 implicit none
199 type(c_ptr), value :: p_res_d, ta1_d, ta2_d, ta3_d
200 real(c_rp) :: dtbd
201 integer(c_int) :: n
202 end subroutine pnpn_prs_res_part3_opencl
203 end interface
204
205 interface
206 subroutine pnpn_vel_res_update_opencl(u_res_d, v_res_d, w_res_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
210 implicit none
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
214 integer(c_int) :: n
215 end subroutine pnpn_vel_res_update_opencl
216 end interface
217#elif HAVE_METAL
218 interface
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
224 import c_rp
225 implicit none
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
231 integer(c_int) :: n
232 end subroutine pnpn_prs_res_part1_metal
233 end interface
234
235 interface
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
239 implicit none
240 type(c_ptr), value :: p_res_d, wa1_d, wa2_d, wa3_d
241 integer(c_int) :: n
242 end subroutine pnpn_prs_res_part2_metal
243 end interface
244
245 interface
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
249 import c_rp
250 implicit none
251 type(c_ptr), value :: p_res_d, ta1_d, ta2_d, ta3_d
252 real(c_rp) :: dtbd
253 integer(c_int) :: n
254 end subroutine pnpn_prs_res_part3_metal
255 end interface
256
257 interface
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
262 implicit none
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
266 integer(c_int) :: n
267 end subroutine pnpn_vel_res_update_metal
268 end interface
269#endif
270
271
272contains
273
274 subroutine pnpn_prs_res_device_compute(p, p_res, u, v, w, u_e, v_e, w_e, &
275 f_x, f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, Ax, bd, dt,&
276 mu, rho, event)
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
283 type(facet_normal_t), intent(in) :: bc_prs_surface
284 type(facet_normal_t), intent(in) :: bc_sym_surface
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
293 integer :: n, gdim
294 type(field_t), pointer :: ta1, ta2, ta3, wa1, wa2, wa3, work1, work2
295 integer :: temp_indices(8)
296
297
298 ! We assume the material properties are constant
299 mu_val = mu%x(1,1,1,1)
300 rho_val = rho%x(1,1,1,1)
301
302 call neko_scratch_registry%request_field(ta1, temp_indices(1), .false.)
303 call neko_scratch_registry%request_field(ta2, temp_indices(2), .false.)
304 call neko_scratch_registry%request_field(ta3, temp_indices(3), .false.)
305 call neko_scratch_registry%request_field(wa1, temp_indices(4), .false.)
306 call neko_scratch_registry%request_field(wa2, temp_indices(5), .false.)
307 call neko_scratch_registry%request_field(wa3, temp_indices(6), .false.)
308 call neko_scratch_registry%request_field(work1, temp_indices(7), .false.)
309 call neko_scratch_registry%request_field(work2, temp_indices(8), .false.)
310
311 n = u%dof%size()
312 gdim = c_xh%msh%gdim
313
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
318#ifdef HAVE_HIP
319 call pnpn_prs_res_part1_hip(ta1%x_d, ta2%x_d, ta3%x_d, &
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)
322
323#elif HAVE_CUDA
324 call pnpn_prs_res_part1_cuda(ta1%x_d, ta2%x_d, ta3%x_d, &
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)
327#elif HAVE_OPENCL
328 call pnpn_prs_res_part1_opencl(ta1%x_d, ta2%x_d, ta3%x_d, &
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)
331#elif HAVE_METAL
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)
335#endif
336 c_xh%ifh2 = .false.
337 call device_cfill(c_xh%h1_d, 1.0_rp / rho_val, n)
338
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)
342
343 call device_opcolv(ta1%x_d, ta2%x_d, ta3%x_d, c_xh%Binv_d, gdim, n)
344
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)
348
349 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
350
351#ifdef HAVE_HIP
352 call pnpn_prs_res_part2_hip(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
353#elif HAVE_CUDA
354 call pnpn_prs_res_part2_cuda(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
355#elif HAVE_OPENCL
356 call pnpn_prs_res_part2_opencl(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
357#elif HAVE_METAL
358 call pnpn_prs_res_part2_metal(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, n)
359#endif
360
361 !
362 ! Surface velocity terms
363 call device_rzero(wa1%x_d, n)
364 call device_rzero(wa2%x_d, n)
365 call device_rzero(wa3%x_d, n)
366 dtbd = 1.0_rp
367
368 call bc_sym_surface%apply_surfvec_dev(wa1%x_d, wa2%x_d, wa3%x_d, ta1%x_d, &
369 ta2%x_d, ta3%x_d)
370
371#ifdef HAVE_HIP
372 call pnpn_prs_res_part3_hip(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
373#elif HAVE_CUDA
374 call pnpn_prs_res_part3_cuda(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, dtbd, n)
375#elif HAVE_OPENCL
376 call pnpn_prs_res_part3_opencl(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, dtbd, &
377 n)
378#elif HAVE_METAL
379 call pnpn_prs_res_part3_metal(p_res%x_d, wa1%x_d, wa2%x_d, wa3%x_d, dtbd, &
380 n)
381#endif
382 !
383 dtbd = bd / dt
384
385 call device_rzero(ta1%x_d, n)
386 call device_rzero(ta2%x_d, n)
387 call device_rzero(ta3%x_d, n)
388
389 call bc_prs_surface%apply_surfvec_dev(ta1%x_d, ta2%x_d, ta3%x_d, &
390 u%x_d, v%x_d, w%x_d)
391
392#ifdef HAVE_HIP
393 call pnpn_prs_res_part3_hip(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, dtbd, n)
394#elif HAVE_CUDA
395 call pnpn_prs_res_part3_cuda(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, dtbd, n)
396#elif HAVE_OPENCL
397 call pnpn_prs_res_part3_opencl(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, dtbd,&
398 n)
399#elif HAVE_METAL
400 call pnpn_prs_res_part3_metal(p_res%x_d, ta1%x_d, ta2%x_d, ta3%x_d, dtbd,&
401 n)
402#endif
403
404 call neko_scratch_registry%relinquish_field(temp_indices)
405
406 end subroutine pnpn_prs_res_device_compute
407
408 subroutine pnpn_vel_res_device_compute(Ax, u, v, w, u_res, v_res, w_res, &
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
425
426 ! We assume the material properties are constant
427 mu_val = mu%x(1,1,1,1)
428 rho_val = rho%x(1,1,1,1)
429
430 call device_cfill(c_xh%h1_d, mu_val, n)
431 call device_cfill(c_xh%h2_d, rho_val * (bd / dt), n)
432 c_xh%ifh2 = .true.
433
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)
436
437 call neko_scratch_registry%request_field(ta1, temp_indices(1), .false.)
438 call neko_scratch_registry%request_field(ta2, temp_indices(2), .false.)
439 call neko_scratch_registry%request_field(ta3, temp_indices(3), .false.)
440
441 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
442
443#ifdef HAVE_HIP
444 call pnpn_vel_res_update_hip(u_res%x_d, v_res%x_d, w_res%x_d, &
445 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
446#elif HAVE_CUDA
447 call pnpn_vel_res_update_cuda(u_res%x_d, v_res%x_d, w_res%x_d, &
448 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
449#elif HAVE_OPENCL
450 call pnpn_vel_res_update_opencl(u_res%x_d, v_res%x_d, w_res%x_d, &
451 ta1%x_d, ta2%x_d, ta3%x_d, f_x%x_d, f_y%x_d, f_z%x_d, n)
452#elif HAVE_METAL
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)
455#endif
456
457 call neko_scratch_registry%relinquish_field(temp_indices)
458 end subroutine pnpn_vel_res_device_compute
459
460end module pnpn_res_device
Apply cyclic boundary condition to a vector field.
Defines a Matrix-vector product.
Definition ax.f90:34
Coefficients.
Definition coef.f90:34
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.
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:15
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
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.
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.
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_part3_opencl(void *p_res, void *ta1, void *ta2, void *ta3, real *dtbd, int *n)
Definition pnpn_res.c:115
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)
Definition pnpn_res.c:49
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_prs_res_part3_cuda(void *p_res, void *ta1, void *ta2, void *ta3, real *dtbd, int *n)
Definition pnpn_res.cu:77
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_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)
Definition pnpn_res.cu:43
Base type for a matrix-vector product providing .
Definition ax.f90:44
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:136
Dirichlet condition in facet normal direction.
Gather-scatter kernel.
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