Neko 1.99.6
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
compressible_res_device.F90
Go to the documentation of this file.
1! Copyright (c) 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!
35 use field, only : field_t
36 use ax_product, only : ax_t
37 use coefs, only : coef_t
38 use gather_scatter, only : gs_t, gs_op_add
39 use num_types, only : rp, c_rp
41 use utils, only : neko_error
42 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
43 use operators, only : div, grad, opgrad, rotate_cyc
45 use field_list, only : field_list_t
53 use bc_list, only : bc_list_t
54 use time_state, only : time_state_t
55
57 contains
58 procedure, nopass :: step => advance_primitive_variables_device
59 procedure, nopass :: evaluate_rhs => evaluate_rhs_device
61
67 real(kind=rp), public :: compressible_res_device_gamma = 1.4_rp
68
69#ifdef HAVE_HIP
70 interface
71 subroutine compressible_res_part_visc_hip(rhs_field_d, Binv_d, field_d, &
72 artificial_visc_d, n) &
73 bind(c, name = 'compressible_res_part_visc_hip')
74 use, intrinsic :: iso_c_binding
75 import c_rp
76 implicit none
77 type(c_ptr), value :: rhs_field_d, binv_d, field_d, artificial_visc_d
78 integer(c_int) :: n
80 end interface
81
82 interface
83 subroutine inviscid_res_part_mx_flux_hip(f_x, f_y, f_z, &
84 m_x, m_y, m_z, rho_field, p, n) &
85 bind(c, name = 'inviscid_res_part_mx_flux_hip')
86 use, intrinsic :: iso_c_binding
87 implicit none
88 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
89 integer(c_int) :: n
91 end interface
92
93 interface
94 subroutine inviscid_res_part_my_flux_hip(f_x, f_y, f_z, &
95 m_x, m_y, m_z, rho_field, p, n) &
96 bind(c, name = 'inviscid_res_part_my_flux_hip')
97 use, intrinsic :: iso_c_binding
98 implicit none
99 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
100 integer(c_int) :: n
101 end subroutine inviscid_res_part_my_flux_hip
102 end interface
103
104 interface
105 subroutine inviscid_res_part_mz_flux_hip(f_x, f_y, f_z, &
106 m_x, m_y, m_z, rho_field, p, n) &
107 bind(c, name = 'inviscid_res_part_mz_flux_hip')
108 use, intrinsic :: iso_c_binding
109 implicit none
110 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
111 integer(c_int) :: n
112 end subroutine inviscid_res_part_mz_flux_hip
113 end interface
114
115 interface
116 subroutine inviscid_res_part_e_flux_hip(f_x, f_y, f_z, &
117 m_x, m_y, m_z, rho_field, p, E, n) &
118 bind(c, name = 'inviscid_res_part_E_flux_hip')
119 use, intrinsic :: iso_c_binding
120 implicit none
121 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p, E
122 integer(c_int) :: n
123 end subroutine inviscid_res_part_e_flux_hip
124 end interface
125
126 interface
127 subroutine compressible_res_part_coef_mult_hip(rhs_rho_field_d, &
128 rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
129 rhs_E_d, mult_d, n) &
130 bind(c, name = 'compressible_res_part_coef_mult_hip')
131 use, intrinsic :: iso_c_binding
132 implicit none
133 type(c_ptr), value :: rhs_rho_field_d, rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
134 rhs_E_d, mult_d
135 integer(c_int) :: n
137 end interface
138
139 interface
140 subroutine compressible_res_part_rk_sum_hip(rho, m_x, m_y, m_z, E, &
141 k_rho_i, k_m_x_i, k_m_y_i, &
142 k_m_z_i, k_E_i, &
143 dt, b_i, n) &
144 bind(c, name = 'compressible_res_part_rk_sum_hip')
145 use, intrinsic :: iso_c_binding
146 import c_rp
147 implicit none
148 type(c_ptr), value :: rho, m_x, m_y, m_z, E, &
149 k_rho_i, k_m_x_i, k_m_y_i, &
150 k_m_z_i, k_E_i
151 real(c_rp) :: dt, b_i
152 integer(c_int) :: n
154 end interface
155#elif HAVE_CUDA
156 interface
157 subroutine compressible_res_part_visc_cuda(rhs_field_d, Binv_d, field_d, &
158 artificial_visc_d, n) &
159 bind(c, name = 'compressible_res_part_visc_cuda')
160 use, intrinsic :: iso_c_binding
161 import c_rp
162 implicit none
163 type(c_ptr), value :: rhs_field_d, Binv_d, field_d, artificial_visc_d
164 integer(c_int) :: n
166 end interface
167
168 interface
169 subroutine inviscid_res_part_mx_flux_cuda(f_x, f_y, f_z, &
170 m_x, m_y, m_z, rho_field, p, n) &
171 bind(c, name = 'inviscid_res_part_mx_flux_cuda')
172 use, intrinsic :: iso_c_binding
173 implicit none
174 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
175 integer(c_int) :: n
176 end subroutine inviscid_res_part_mx_flux_cuda
177 end interface
178
179 interface
180 subroutine inviscid_res_part_my_flux_cuda(f_x, f_y, f_z, &
181 m_x, m_y, m_z, rho_field, p, n) &
182 bind(c, name = 'inviscid_res_part_my_flux_cuda')
183 use, intrinsic :: iso_c_binding
184 implicit none
185 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
186 integer(c_int) :: n
187 end subroutine inviscid_res_part_my_flux_cuda
188 end interface
189
190 interface
191 subroutine inviscid_res_part_mz_flux_cuda(f_x, f_y, f_z, &
192 m_x, m_y, m_z, rho_field, p, n) &
193 bind(c, name = 'inviscid_res_part_mz_flux_cuda')
194 use, intrinsic :: iso_c_binding
195 implicit none
196 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
197 integer(c_int) :: n
198 end subroutine inviscid_res_part_mz_flux_cuda
199 end interface
200
201 interface
202 subroutine inviscid_res_part_e_flux_cuda(f_x, f_y, f_z, &
203 m_x, m_y, m_z, rho_field, p, E, n) &
204 bind(c, name = 'inviscid_res_part_E_flux_cuda')
205 use, intrinsic :: iso_c_binding
206 implicit none
207 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p, E
208 integer(c_int) :: n
209 end subroutine inviscid_res_part_e_flux_cuda
210 end interface
211
212 interface
213 subroutine compressible_res_part_coef_mult_cuda(rhs_rho_field_d, &
214 rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
215 rhs_E_d, mult_d, n) &
216 bind(c, name = 'compressible_res_part_coef_mult_cuda')
217 use, intrinsic :: iso_c_binding
218 implicit none
219 type(c_ptr), value :: rhs_rho_field_d, rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
220 rhs_E_d, mult_d
221 integer(c_int) :: n
223 end interface
224
225 interface
226 subroutine compressible_res_part_rk_sum_cuda(rho, m_x, m_y, m_z, E, &
227 k_rho_i, k_m_x_i, k_m_y_i, &
228 k_m_z_i, k_E_i, &
229 dt, c, n) &
230 bind(c, name = 'compressible_res_part_rk_sum_cuda')
231 use, intrinsic :: iso_c_binding
232 import c_rp
233 implicit none
234 type(c_ptr), value :: rho, m_x, m_y, m_z, E, &
235 k_rho_i, k_m_x_i, k_m_y_i, &
236 k_m_z_i, k_E_i
237 real(c_rp) :: dt, c
238 integer(c_int) :: n
240 end interface
241#elif HAVE_OPENCL
242 interface
243 subroutine compressible_res_part_visc_opencl(rhs_field_d, Binv_d, &
244 field_d, artificial_visc_d, n) &
245 bind(c, name = 'compressible_res_part_visc_opencl')
246 use, intrinsic :: iso_c_binding
247 import c_rp
248 implicit none
249 type(c_ptr), value :: rhs_field_d, Binv_d, field_d, artificial_visc_d
250 integer(c_int) :: n
252 end interface
253
254 interface
255 subroutine inviscid_res_part_mx_flux_opencl(f_x, f_y, f_z, &
256 m_x, m_y, m_z, rho_field, p, n) &
257 bind(c, name = 'inviscid_res_part_mx_flux_opencl')
258 use, intrinsic :: iso_c_binding
259 implicit none
260 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
261 integer(c_int) :: n
263 end interface
264
265 interface
266 subroutine inviscid_res_part_my_flux_opencl(f_x, f_y, f_z, &
267 m_x, m_y, m_z, rho_field, p, n) &
268 bind(c, name = 'inviscid_res_part_my_flux_opencl')
269 use, intrinsic :: iso_c_binding
270 implicit none
271 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
272 integer(c_int) :: n
274 end interface
275
276 interface
277 subroutine inviscid_res_part_mz_flux_opencl(f_x, f_y, f_z, &
278 m_x, m_y, m_z, rho_field, p, n) &
279 bind(c, name = 'inviscid_res_part_mz_flux_opencl')
280 use, intrinsic :: iso_c_binding
281 implicit none
282 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
283 integer(c_int) :: n
285 end interface
286
287 interface
288 subroutine inviscid_res_part_e_flux_opencl(f_x, f_y, f_z, &
289 m_x, m_y, m_z, rho_field, p, E, n) &
290 bind(c, name = 'inviscid_res_part_E_flux_opencl')
291 use, intrinsic :: iso_c_binding
292 implicit none
293 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p, E
294 integer(c_int) :: n
295 end subroutine inviscid_res_part_e_flux_opencl
296 end interface
297
298 interface
299 subroutine compressible_res_part_coef_mult_opencl(rhs_rho_field_d, &
300 rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
301 rhs_E_d, mult_d, n) &
302 bind(c, name = 'compressible_res_part_coef_mult_opencl')
303 use, intrinsic :: iso_c_binding
304 implicit none
305 type(c_ptr), value :: rhs_rho_field_d, rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
306 rhs_E_d, mult_d
307 integer(c_int) :: n
309 end interface
310
311 interface
312 subroutine compressible_res_part_rk_sum_opencl(rho, m_x, m_y, m_z, E, &
313 k_rho_i, k_m_x_i, k_m_y_i, &
314 k_m_z_i, k_E_i, &
315 dt, c, n) &
316 bind(c, name = 'compressible_res_part_rk_sum_opencl')
317 use, intrinsic :: iso_c_binding
318 import c_rp
319 implicit none
320 type(c_ptr), value :: rho, m_x, m_y, m_z, E, &
321 k_rho_i, k_m_x_i, k_m_y_i, &
322 k_m_z_i, k_E_i
323 real(c_rp) :: dt, c
324 integer(c_int) :: n
326 end interface
327#elif HAVE_METAL
328 interface
329 subroutine compressible_res_part_visc_metal(rhs_field_d, Binv_d, field_d, &
330 effective_visc_d, n) &
331 bind(c, name = 'compressible_res_part_visc_metal')
332 use, intrinsic :: iso_c_binding
333 import c_rp
334 implicit none
335 type(c_ptr), value :: rhs_field_d, Binv_d, field_d, effective_visc_d
336 integer(c_int) :: n
337 end subroutine compressible_res_part_visc_metal
338 end interface
339
340 interface
341 subroutine inviscid_res_part_mx_flux_metal(f_x, f_y, f_z, &
342 m_x, m_y, m_z, rho_field, p, n) &
343 bind(c, name = 'inviscid_res_part_mx_flux_metal')
344 use, intrinsic :: iso_c_binding
345 implicit none
346 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
347 integer(c_int) :: n
348 end subroutine inviscid_res_part_mx_flux_metal
349 end interface
350
351 interface
352 subroutine inviscid_res_part_my_flux_metal(f_x, f_y, f_z, &
353 m_x, m_y, m_z, rho_field, p, n) &
354 bind(c, name = 'inviscid_res_part_my_flux_metal')
355 use, intrinsic :: iso_c_binding
356 implicit none
357 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
358 integer(c_int) :: n
359 end subroutine inviscid_res_part_my_flux_metal
360 end interface
361
362 interface
363 subroutine inviscid_res_part_mz_flux_metal(f_x, f_y, f_z, &
364 m_x, m_y, m_z, rho_field, p, n) &
365 bind(c, name = 'inviscid_res_part_mz_flux_metal')
366 use, intrinsic :: iso_c_binding
367 implicit none
368 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p
369 integer(c_int) :: n
370 end subroutine inviscid_res_part_mz_flux_metal
371 end interface
372
373 interface
374 subroutine inviscid_res_part_e_flux_metal(f_x, f_y, f_z, &
375 m_x, m_y, m_z, rho_field, p, E, n) &
376 bind(c, name = 'inviscid_res_part_E_flux_metal')
377 use, intrinsic :: iso_c_binding
378 implicit none
379 type(c_ptr), value :: f_x, f_y, f_z, m_x, m_y, m_z, rho_field, p, E
380 integer(c_int) :: n
381 end subroutine inviscid_res_part_e_flux_metal
382 end interface
383
384 interface
385 subroutine compressible_res_part_coef_mult_metal(rhs_rho_field_d, &
386 rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
387 rhs_E_d, mult_d, n) &
388 bind(c, name = 'compressible_res_part_coef_mult_metal')
389 use, intrinsic :: iso_c_binding
390 implicit none
391 type(c_ptr), value :: rhs_rho_field_d, rhs_m_x_d, rhs_m_y_d, rhs_m_z_d, &
392 rhs_E_d, mult_d
393 integer(c_int) :: n
394 end subroutine compressible_res_part_coef_mult_metal
395 end interface
396
397 interface
398 subroutine compressible_res_part_rk_sum_metal(rho, m_x, m_y, m_z, E, &
399 k_rho_i, k_m_x_i, k_m_y_i, &
400 k_m_z_i, k_E_i, &
401 dt, c, n) &
402 bind(c, name = 'compressible_res_part_rk_sum_metal')
403 use, intrinsic :: iso_c_binding
404 import c_rp
405 implicit none
406 type(c_ptr), value :: rho, m_x, m_y, m_z, E, &
407 k_rho_i, k_m_x_i, k_m_y_i, &
408 k_m_z_i, k_E_i
409 real(c_rp) :: dt, c
410 integer(c_int) :: n
411 end subroutine compressible_res_part_rk_sum_metal
412 end interface
413#endif
414
415contains
417 m_x, m_y, m_z, E, p, u, v, w, Ax, &
418 Ax_stress, coef, gs, h, artificial_visc, mu, kappa, bcs_vel, time, &
419 rk_scheme, dt)
420 type(field_t), intent(inout) :: rho_field, m_x, m_y, m_z, E
421 type(field_t), intent(in) :: p, u, v, w, h, artificial_visc, mu, kappa
422 class(ax_t), intent(inout) :: Ax, Ax_stress
423 type(coef_t), intent(inout) :: coef
424 type(gs_t), intent(inout) :: gs
425 type(bc_list_t), intent(inout) :: bcs_vel
426 type(time_state_t), intent(in) :: time
427 class(runge_kutta_time_scheme_t), intent(in) :: rk_scheme
428 real(kind=rp), intent(in) :: dt
429 integer :: n, s, i, j, k
430 real(kind=rp) :: t, c
431 type(field_t), pointer :: k_rho_1, k_rho_2, k_rho_3, k_rho_4, &
432 k_m_x_1, k_m_x_2, k_m_x_3, k_m_x_4, &
433 k_m_y_1, k_m_y_2, k_m_y_3, k_m_y_4, &
434 k_m_z_1, k_m_z_2, k_m_z_3, k_m_z_4, &
435 k_e_1, k_e_2, k_e_3, k_e_4, &
436 temp_rho, temp_m_x, temp_m_y, temp_m_z, temp_e, &
437 temp_p, temp_u, temp_v, temp_w, temp_ruvw
438 integer :: temp_indices(30)
439 type(field_list_t) :: k_rho, k_m_x, k_m_y, k_m_z, k_E
440
441 n = p%dof%size()
442 s = rk_scheme%order
443 call neko_scratch_registry%request_field(k_rho_1, temp_indices(1), .true.)
444 call neko_scratch_registry%request_field(k_rho_2, temp_indices(2), .true.)
445 call neko_scratch_registry%request_field(k_rho_3, temp_indices(3), .true.)
446 call neko_scratch_registry%request_field(k_rho_4, temp_indices(4), .true.)
447 call neko_scratch_registry%request_field(k_m_x_1, temp_indices(5), .true.)
448 call neko_scratch_registry%request_field(k_m_x_2, temp_indices(6), .true.)
449 call neko_scratch_registry%request_field(k_m_x_3, temp_indices(7), .true.)
450 call neko_scratch_registry%request_field(k_m_x_4, temp_indices(8), .true.)
451 call neko_scratch_registry%request_field(k_m_y_1, temp_indices(9), .true.)
452 call neko_scratch_registry%request_field(k_m_y_2, temp_indices(10), .true.)
453 call neko_scratch_registry%request_field(k_m_y_3, temp_indices(11), .true.)
454 call neko_scratch_registry%request_field(k_m_y_4, temp_indices(12), .true.)
455 call neko_scratch_registry%request_field(k_m_z_1, temp_indices(13), .true.)
456 call neko_scratch_registry%request_field(k_m_z_2, temp_indices(14), .true.)
457 call neko_scratch_registry%request_field(k_m_z_3, temp_indices(15), .true.)
458 call neko_scratch_registry%request_field(k_m_z_4, temp_indices(16), .true.)
459 call neko_scratch_registry%request_field(k_e_1, temp_indices(17), .true.)
460 call neko_scratch_registry%request_field(k_e_2, temp_indices(18), .true.)
461 call neko_scratch_registry%request_field(k_e_3, temp_indices(19), .true.)
462 call neko_scratch_registry%request_field(k_e_4, temp_indices(20), .true.)
463 call neko_scratch_registry%request_field(temp_rho, temp_indices(21), &
464 .false.)
465 call neko_scratch_registry%request_field(temp_m_x, temp_indices(22), &
466 .false.)
467 call neko_scratch_registry%request_field(temp_m_y, temp_indices(23), &
468 .false.)
469 call neko_scratch_registry%request_field(temp_m_z, temp_indices(24), &
470 .false.)
471 call neko_scratch_registry%request_field(temp_e, temp_indices(25), .false.)
472 call neko_scratch_registry%request_field(temp_p, temp_indices(26), .false.)
473 call neko_scratch_registry%request_field(temp_u, temp_indices(27), .false.)
474 call neko_scratch_registry%request_field(temp_v, temp_indices(28), .false.)
475 call neko_scratch_registry%request_field(temp_w, temp_indices(29), .false.)
476 call neko_scratch_registry%request_field(temp_ruvw, temp_indices(30), &
477 .false.)
478
479 call k_rho%init(4)
480 call k_rho%assign(1, k_rho_1)
481 call k_rho%assign(2, k_rho_2)
482 call k_rho%assign(3, k_rho_3)
483 call k_rho%assign(4, k_rho_4)
484 call k_m_x%init(4)
485 call k_m_x%assign(1, k_m_x_1)
486 call k_m_x%assign(2, k_m_x_2)
487 call k_m_x%assign(3, k_m_x_3)
488 call k_m_x%assign(4, k_m_x_4)
489 call k_m_y%init(4)
490 call k_m_y%assign(1, k_m_y_1)
491 call k_m_y%assign(2, k_m_y_2)
492 call k_m_y%assign(3, k_m_y_3)
493 call k_m_y%assign(4, k_m_y_4)
494 call k_m_z%init(4)
495 call k_m_z%assign(1, k_m_z_1)
496 call k_m_z%assign(2, k_m_z_2)
497 call k_m_z%assign(3, k_m_z_3)
498 call k_m_z%assign(4, k_m_z_4)
499 call k_e%init(4)
500 call k_e%assign(1, k_e_1)
501 call k_e%assign(2, k_e_2)
502 call k_e%assign(3, k_e_3)
503 call k_e%assign(4, k_e_4)
504
506 any(mu%x .ne. 0.0_rp) .or. any(kappa%x .ne. 0.0_rp)
507 compressible_res_device_add_physical_stress = any(mu%x .ne. 0.0_rp)
508
509 ! Runge-Kutta stages
510 do i = 1, s
511 call device_copy(temp_rho%x_d, rho_field%x_d, n)
512 call device_copy(temp_m_x%x_d, m_x%x_d, n)
513 call device_copy(temp_m_y%x_d, m_y%x_d, n)
514 call device_copy(temp_m_z%x_d, m_z%x_d, n)
515 call device_copy(temp_e%x_d, e%x_d, n)
516
517 do j = 1, i-1
518#ifdef HAVE_HIP
519 call compressible_res_part_rk_sum_hip(temp_rho%x_d, temp_m_x%x_d, &
520 temp_m_y%x_d, temp_m_z%x_d, temp_e%x_d, &
521 k_rho%items(j)%ptr%x_d, k_m_x%items(j)%ptr%x_d, &
522 k_m_y%items(j)%ptr%x_d, &
523 k_m_z%items(j)%ptr%x_d, k_e%items(j)%ptr%x_d, &
524 dt, rk_scheme%coeffs_A(i, j), n)
525#elif HAVE_CUDA
526 call compressible_res_part_rk_sum_cuda(temp_rho%x_d, temp_m_x%x_d, &
527 temp_m_y%x_d, temp_m_z%x_d, temp_e%x_d, &
528 k_rho%items(j)%ptr%x_d, k_m_x%items(j)%ptr%x_d, &
529 k_m_y%items(j)%ptr%x_d, &
530 k_m_z%items(j)%ptr%x_d, k_e%items(j)%ptr%x_d, &
531 dt, rk_scheme%coeffs_A(i, j), n)
532#elif HAVE_OPENCL
533 call compressible_res_part_rk_sum_opencl(temp_rho%x_d, temp_m_x%x_d, &
534 temp_m_y%x_d, temp_m_z%x_d, temp_e%x_d, &
535 k_rho%items(j)%ptr%x_d, k_m_x%items(j)%ptr%x_d, &
536 k_m_y%items(j)%ptr%x_d, &
537 k_m_z%items(j)%ptr%x_d, k_e%items(j)%ptr%x_d, &
538 dt, rk_scheme%coeffs_A(i, j), n)
539#elif HAVE_METAL
540 call compressible_res_part_rk_sum_metal(temp_rho%x_d, &
541 temp_m_x%x_d, temp_m_y%x_d, temp_m_z%x_d, temp_e%x_d, &
542 k_rho%items(j)%ptr%x_d, k_m_x%items(j)%ptr%x_d, &
543 k_m_y%items(j)%ptr%x_d, &
544 k_m_z%items(j)%ptr%x_d, k_e%items(j)%ptr%x_d, &
545 dt, rk_scheme%coeffs_A(i, j), n)
546#endif
547 end do
548
549 ! Compute f(U) = rhs(U) with primitive variables from the RK stage state.
550 call compressible_ops_device_update_uvw(temp_u%x_d, temp_v%x_d, &
551 temp_w%x_d, temp_m_x%x_d, temp_m_y%x_d, temp_m_z%x_d, &
552 temp_rho%x_d, n)
554 call bcs_vel%apply_vector(temp_u%x, temp_v%x, temp_w%x, n, time, &
555 strong = .true.)
556 end if
558 temp_m_y%x_d, temp_m_z%x_d, temp_p%x_d, temp_ruvw%x_d, &
559 temp_u%x_d, temp_v%x_d, temp_w%x_d, temp_e%x_d, &
560 temp_rho%x_d, compressible_res_device_gamma, n)
561
562 call evaluate_rhs_device(k_rho%items(i)%ptr, k_m_x%items(i)%ptr, &
563 k_m_y%items(i)%ptr, k_m_z%items(i)%ptr, k_e%items(i)%ptr, &
564 temp_rho, temp_m_x, temp_m_y, temp_m_z, temp_e, &
565 temp_p, temp_u, temp_v, temp_w, ax, &
566 ax_stress, coef, gs, h, artificial_visc, mu, kappa)
567 end do
568
569 ! Update the solution
570 do i = 1, s
571#ifdef HAVE_HIP
572 call compressible_res_part_rk_sum_hip(rho_field%x_d, &
573 m_x%x_d, m_y%x_d, m_z%x_d, e%x_d, &
574 k_rho%items(i)%ptr%x_d, k_m_x%items(i)%ptr%x_d, &
575 k_m_y%items(i)%ptr%x_d, &
576 k_m_z%items(i)%ptr%x_d, k_e%items(i)%ptr%x_d, &
577 dt, rk_scheme%coeffs_b(i), n)
578#elif HAVE_CUDA
579 call compressible_res_part_rk_sum_cuda(rho_field%x_d, &
580 m_x%x_d, m_y%x_d, m_z%x_d, e%x_d, &
581 k_rho%items(i)%ptr%x_d, k_m_x%items(i)%ptr%x_d, &
582 k_m_y%items(i)%ptr%x_d, &
583 k_m_z%items(i)%ptr%x_d, k_e%items(i)%ptr%x_d, &
584 dt, rk_scheme%coeffs_b(i), n)
585#elif HAVE_OPENCL
586 call compressible_res_part_rk_sum_opencl(rho_field%x_d, &
587 m_x%x_d, m_y%x_d, m_z%x_d, e%x_d, &
588 k_rho%items(i)%ptr%x_d, k_m_x%items(i)%ptr%x_d, &
589 k_m_y%items(i)%ptr%x_d, &
590 k_m_z%items(i)%ptr%x_d, k_e%items(i)%ptr%x_d, &
591 dt, rk_scheme%coeffs_b(i), n)
592#elif HAVE_METAL
593 call compressible_res_part_rk_sum_metal(rho_field%x_d, &
594 m_x%x_d, m_y%x_d, m_z%x_d, e%x_d, &
595 k_rho%items(i)%ptr%x_d, k_m_x%items(i)%ptr%x_d, &
596 k_m_y%items(i)%ptr%x_d, &
597 k_m_z%items(i)%ptr%x_d, k_e%items(i)%ptr%x_d, &
598 dt, rk_scheme%coeffs_b(i), n)
599#endif
600 end do
601
602 call neko_scratch_registry%relinquish_field(temp_indices)
604
605 subroutine evaluate_rhs_device(rhs_rho_field, rhs_m_x, rhs_m_y, &
606 rhs_m_z, rhs_E, rho_field, &
607 m_x, m_y, m_z, E, p, u, v, w, Ax, &
608 Ax_stress, coef, gs, h, artificial_visc, mu, kappa)
609 type(field_t), intent(inout) :: rhs_rho_field, rhs_m_x, rhs_m_y, &
610 rhs_m_z, rhs_E
611 type(field_t), intent(inout) :: rho_field, m_x, m_y, m_z, E
612 type(field_t), intent(in) :: p, u, v, w, h, artificial_visc, mu, kappa
613 class(ax_t), intent(inout) :: Ax, Ax_stress
614 type(coef_t), intent(inout) :: coef
615 type(gs_t), intent(inout) :: gs
616 integer :: n, i
617 type(field_t), pointer :: temp, f_x, f_y, f_z, &
618 visc_rho, visc_m_x, visc_m_y, visc_m_z, visc_E
619 integer :: temp_indices(8)
620
621 n = coef%dof%size()
622 call neko_scratch_registry%request_field(f_x, temp_indices(1), .false.)
623 call neko_scratch_registry%request_field(f_y, temp_indices(2), .false.)
624 call neko_scratch_registry%request_field(f_z, temp_indices(3), .false.)
625
627 call div(rhs_rho_field%x, m_x%x, m_y%x, m_z%x, coef)
628
630 ! m_x
631#ifdef HAVE_HIP
632 call inviscid_res_part_mx_flux_hip(f_x%x_d, f_y%x_d, f_z%x_d, &
633 m_x%x_d, m_y%x_d, m_z%x_d, rho_field%x_d, p%x_d, n)
634#elif HAVE_CUDA
635 call inviscid_res_part_mx_flux_cuda(f_x%x_d, f_y%x_d, f_z%x_d, &
636 m_x%x_d, m_y%x_d, m_z%x_d, rho_field%x_d, p%x_d, n)
637#elif HAVE_OPENCL
638 call inviscid_res_part_mx_flux_opencl(f_x%x_d, f_y%x_d, f_z%x_d, &
639 m_x%x_d, m_y%x_d, m_z%x_d, rho_field%x_d, p%x_d, n)
640#elif HAVE_METAL
641 call inviscid_res_part_mx_flux_metal(f_x%x_d, f_y%x_d, f_z%x_d, &
642 m_x%x_d, m_y%x_d, m_z%x_d, rho_field%x_d, p%x_d, n)
643#endif
644 call div(rhs_m_x%x, f_x%x, f_y%x, f_z%x, coef)
645 ! m_y
646#ifdef HAVE_HIP
647 call inviscid_res_part_my_flux_hip(f_x%x_d, f_y%x_d, f_z%x_d, &
648 m_x%x_d, m_y%x_d, m_z%x_d, &
649 rho_field%x_d, p%x_d, n)
650#elif HAVE_CUDA
651 call inviscid_res_part_my_flux_cuda(f_x%x_d, f_y%x_d, f_z%x_d, &
652 m_x%x_d, m_y%x_d, m_z%x_d, &
653 rho_field%x_d, p%x_d, n)
654#elif HAVE_OPENCL
655 call inviscid_res_part_my_flux_opencl(f_x%x_d, f_y%x_d, f_z%x_d, &
656 m_x%x_d, m_y%x_d, m_z%x_d, &
657 rho_field%x_d, p%x_d, n)
658#elif HAVE_METAL
659 call inviscid_res_part_my_flux_metal(f_x%x_d, f_y%x_d, f_z%x_d, &
660 m_x%x_d, m_y%x_d, m_z%x_d, &
661 rho_field%x_d, p%x_d, n)
662#endif
663 call div(rhs_m_y%x, f_x%x, f_y%x, f_z%x, coef)
664 ! m_z
665#ifdef HAVE_HIP
666 call inviscid_res_part_mz_flux_hip(f_x%x_d, f_y%x_d, f_z%x_d, &
667 m_x%x_d, m_y%x_d, m_z%x_d, &
668 rho_field%x_d, p%x_d, n)
669#elif HAVE_CUDA
670 call inviscid_res_part_mz_flux_cuda(f_x%x_d, f_y%x_d, f_z%x_d, &
671 m_x%x_d, m_y%x_d, m_z%x_d, &
672 rho_field%x_d, p%x_d, n)
673#elif HAVE_OPENCL
674 call inviscid_res_part_mz_flux_opencl(f_x%x_d, f_y%x_d, f_z%x_d, &
675 m_x%x_d, m_y%x_d, m_z%x_d, &
676 rho_field%x_d, p%x_d, n)
677#elif HAVE_METAL
678 call inviscid_res_part_mz_flux_metal(f_x%x_d, f_y%x_d, f_z%x_d, &
679 m_x%x_d, m_y%x_d, m_z%x_d, &
680 rho_field%x_d, p%x_d, n)
681#endif
682 call div(rhs_m_z%x, f_x%x, f_y%x, f_z%x, coef)
683
685 ! Inviscid energy flux for both NS and monolithic paths.
686 ! Viscous energy diffusion is handled entirely by Ax(E) below.
687#ifdef HAVE_HIP
688 call inviscid_res_part_e_flux_hip(f_x%x_d, f_y%x_d, f_z%x_d, &
689 m_x%x_d, m_y%x_d, m_z%x_d, &
690 rho_field%x_d, p%x_d, e%x_d, n)
691#elif HAVE_CUDA
692 call inviscid_res_part_e_flux_cuda(f_x%x_d, f_y%x_d, f_z%x_d, &
693 m_x%x_d, m_y%x_d, m_z%x_d, &
694 rho_field%x_d, p%x_d, e%x_d, n)
695#elif HAVE_OPENCL
696 call inviscid_res_part_e_flux_opencl(f_x%x_d, f_y%x_d, f_z%x_d, &
697 m_x%x_d, m_y%x_d, m_z%x_d, &
698 rho_field%x_d, p%x_d, e%x_d, n)
699#elif HAVE_METAL
700 call inviscid_res_part_e_flux_metal(f_x%x_d, f_y%x_d, f_z%x_d, &
701 m_x%x_d, m_y%x_d, m_z%x_d, &
702 rho_field%x_d, p%x_d, e%x_d, n)
703#endif
704 call div(rhs_e%x_d, f_x%x_d, f_y%x_d, f_z%x_d, coef)
705
706 call gs%op(rhs_rho_field, gs_op_add)
707 call rotate_cyc(rhs_m_x%x_d, rhs_m_y%x_d, rhs_m_z%x_d, 1, coef)
708 call gs%op(rhs_m_x%x, rhs_m_y%x, rhs_m_z%x, n, gs_op_add)
709 call rotate_cyc(rhs_m_x%x_d, rhs_m_y%x_d, rhs_m_z%x_d, 0, coef)
710 call gs%op(rhs_e, gs_op_add)
711
712#ifdef HAVE_HIP
713 call compressible_res_part_coef_mult_hip(rhs_rho_field%x_d, rhs_m_x%x_d, &
714 rhs_m_y%x_d, rhs_m_z%x_d, &
715 rhs_e%x_d, coef%mult_d, n)
716#elif HAVE_CUDA
717 call compressible_res_part_coef_mult_cuda(rhs_rho_field%x_d, rhs_m_x%x_d, &
718 rhs_m_y%x_d, rhs_m_z%x_d, &
719 rhs_e%x_d, coef%mult_d, n)
720#elif HAVE_OPENCL
721 call compressible_res_part_coef_mult_opencl(rhs_rho_field%x_d, &
722 rhs_m_x%x_d, rhs_m_y%x_d, rhs_m_z%x_d, &
723 rhs_e%x_d, coef%mult_d, n)
724#elif HAVE_METAL
725 call compressible_res_part_coef_mult_metal(rhs_rho_field%x_d, rhs_m_x%x_d, &
726 rhs_m_y%x_d, rhs_m_z%x_d, &
727 rhs_e%x_d, coef%mult_d, n)
728#endif
729
730 call neko_scratch_registry%request_field(visc_rho, temp_indices(4), .false.)
731 call neko_scratch_registry%request_field(visc_m_x, temp_indices(5), .false.)
732 call neko_scratch_registry%request_field(visc_m_y, temp_indices(6), .false.)
733 call neko_scratch_registry%request_field(visc_m_z, temp_indices(7), .false.)
734 call neko_scratch_registry%request_field(visc_e, temp_indices(8), .false.)
735
736 coef%ifh2 = .false.
737
738 ! Density, momentum and energy are all stabilized by the same
739 ! artificial viscosity. The momentum components share the operator,
740 ! so they use the fused vector apply (one kernel launch, geometric
741 ! factors and h1 are loaded once for all three components).
742 call device_copy(coef%h1_d, artificial_visc%x_d, n)
743 call ax%compute(visc_rho%x, rho_field%x, coef, p%msh, p%Xh)
744 call ax%compute_vector(visc_m_x%x, visc_m_y%x, visc_m_z%x, &
745 m_x%x, m_y%x, m_z%x, coef, p%msh, p%Xh)
746 call ax%compute(visc_e%x, e%x, coef, p%msh, p%Xh)
747
749 call add_navier_stokes_flux_device(visc_m_x, visc_m_y, visc_m_z, &
750 visc_e, rho_field, p, u, v, w, mu, kappa, ax, ax_stress, coef)
751 end if
752
753 ! Reset h1 coefficient back to 1.0 for other operations
754 call device_rone(coef%h1_d, n)
755
756 call gs%op(visc_rho, gs_op_add)
757 call rotate_cyc(visc_m_x%x_d, visc_m_y%x_d, visc_m_z%x_d, 1, coef)
758 call gs%op(visc_m_x%x, visc_m_y%x, visc_m_z%x, n, gs_op_add)
759 call rotate_cyc(visc_m_x%x_d, visc_m_y%x_d, visc_m_z%x_d, 0, coef)
760 call gs%op(visc_e, gs_op_add)
761
762 ! Apply artificial viscosity - the coefficient is already in the Laplacian
763 ! rhs = -rhs - Binv * visc_lap
764 call device_col2(visc_rho%x_d, coef%Binv_d, n)
765 call device_col2(visc_m_x%x_d, coef%Binv_d, n)
766 call device_col2(visc_m_y%x_d, coef%Binv_d, n)
767 call device_col2(visc_m_z%x_d, coef%Binv_d, n)
768 call device_col2(visc_e%x_d, coef%Binv_d, n)
769
770 call device_cmult(rhs_rho_field%x_d, -1.0_rp, n)
771 call device_sub2(rhs_rho_field%x_d, visc_rho%x_d, n)
772
773 call device_cmult(rhs_m_x%x_d, -1.0_rp, n)
774 call device_sub2(rhs_m_x%x_d, visc_m_x%x_d, n)
775
776 call device_cmult(rhs_m_y%x_d, -1.0_rp, n)
777 call device_sub2(rhs_m_y%x_d, visc_m_y%x_d, n)
778
779 call device_cmult(rhs_m_z%x_d, -1.0_rp, n)
780 call device_sub2(rhs_m_z%x_d, visc_m_z%x_d, n)
781
782 call device_cmult(rhs_e%x_d, -1.0_rp, n)
783 call device_sub2(rhs_e%x_d, visc_e%x_d, n)
784
785 call neko_scratch_registry%relinquish_field(temp_indices)
786
787 end subroutine evaluate_rhs_device
788
804 subroutine add_navier_stokes_flux_device(visc_m_x, visc_m_y, visc_m_z, &
805 visc_E, rho_field, p, u, v, w, mu, kappa, Ax, Ax_stress, coef)
806 type(field_t), intent(inout) :: visc_m_x, visc_m_y, visc_m_z, visc_E
807 type(field_t), intent(in) :: rho_field
808 type(field_t), intent(in) :: p, u, v, w, mu, kappa
809 class(ax_t), intent(inout) :: Ax, Ax_stress
810 type(coef_t), intent(inout) :: coef
811 type(field_t), pointer :: dudx, dudy, dudz, dvdx, dvdy, dvdz, &
812 dwdx, dwdy, dwdz, f_x, f_y, f_z, div_flux, dissipation
813 integer :: temp_indices(14)
814 integer :: n
815
816 n = coef%dof%size()
817
818 call neko_scratch_registry%request_field(dudx, temp_indices(1), .false.)
819 call neko_scratch_registry%request_field(dudy, temp_indices(2), .false.)
820 call neko_scratch_registry%request_field(dudz, temp_indices(3), .false.)
821 call neko_scratch_registry%request_field(dvdx, temp_indices(4), .false.)
822 call neko_scratch_registry%request_field(dvdy, temp_indices(5), .false.)
823 call neko_scratch_registry%request_field(dvdz, temp_indices(6), .false.)
824 call neko_scratch_registry%request_field(dwdx, temp_indices(7), .false.)
825 call neko_scratch_registry%request_field(dwdy, temp_indices(8), .false.)
826 call neko_scratch_registry%request_field(dwdz, temp_indices(9), .false.)
827 call neko_scratch_registry%request_field(f_x, temp_indices(10), .false.)
828 call neko_scratch_registry%request_field(f_y, temp_indices(11), .false.)
829 call neko_scratch_registry%request_field(f_z, temp_indices(12), .false.)
830 call neko_scratch_registry%request_field(div_flux, temp_indices(13), &
831 .false.)
832 call neko_scratch_registry%request_field(dissipation, temp_indices(14), &
833 .false.)
834
835 call grad(dudx%x, dudy%x, dudz%x, u%x, coef)
836 call grad(dvdx%x, dvdy%x, dvdz%x, v%x, coef)
837 call grad(dwdx%x, dwdy%x, dwdz%x, w%x, coef)
838
839 call compressible_ops_device_ns_flux_prepare(div_flux%x_d, &
840 dissipation%x_d, coef%h1_d, dudx%x_d, dudy%x_d, dudz%x_d, &
841 dvdx%x_d, dvdy%x_d, dvdz%x_d, dwdx%x_d, dwdy%x_d, dwdz%x_d, &
842 mu%x_d, n)
843
844 call ax_stress%compute_vector(f_x%x, f_y%x, f_z%x, u%x, v%x, w%x, &
845 coef, p%msh, p%Xh)
846 call opgrad(dudx%x, dudy%x, dudz%x, div_flux%x, coef)
848 visc_m_y%x_d, visc_m_z%x_d, visc_e%x_d, f_x%x_d, f_y%x_d, &
849 f_z%x_d, dudx%x_d, dudy%x_d, dudz%x_d, u%x_d, v%x_d, w%x_d, &
850 coef%B_d, dissipation%x_d, n)
851
852 call compressible_ops_device_ns_flux_temperature(div_flux%x_d, coef%h1_d, &
853 p%x_d, rho_field%x_d, kappa%x_d, compressible_res_device_gamma, n)
854 call ax%compute(dudx%x, div_flux%x, coef, p%msh, p%Xh)
855 call device_add2(visc_e%x_d, dudx%x_d, n)
856
857 call neko_scratch_registry%relinquish_field(temp_indices)
858
859 end subroutine add_navier_stokes_flux_device
860
void compressible_res_part_visc_opencl(void *rhs_u, void *Binv, void *lap_sol, void *effective_visc, int *n)
void inviscid_res_part_mz_flux_opencl(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void inviscid_res_part_my_flux_opencl(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void compressible_res_part_rk_sum_opencl(void *rho, void *m_x, void *m_y, void *m_z, void *E, void *k_rho_i, void *k_m_x_i, void *k_m_y_i, void *k_m_z_i, void *k_E_i, real *dt, real *c, int *n)
void compressible_res_part_coef_mult_opencl(void *rhs_rho, void *rhs_m_x, void *rhs_m_y, void *rhs_m_z, void *rhs_E, void *mult, int *n)
void inviscid_res_part_mx_flux_opencl(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void inviscid_res_part_my_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void compressible_res_part_coef_mult_cuda(void *rhs_rho, void *rhs_m_x, void *rhs_m_y, void *rhs_m_z, void *rhs_E, void *mult, int *n)
void compressible_res_part_rk_sum_cuda(void *rho, void *m_x, void *m_y, void *m_z, void *E, void *k_rho_i, void *k_m_x_i, void *k_m_y_i, void *k_m_z_i, void *k_E_i, real *dt, real *c, int *n)
void compressible_res_part_visc_cuda(void *rhs_u, void *Binv, void *lap_sol, void *effective_visc, int *n)
void inviscid_res_part_mz_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
void inviscid_res_part_mx_flux_cuda(void *f_x, void *f_y, void *f_z, void *m_x, void *m_y, void *m_z, void *rho_field, void *p, int *n)
Compute the divergence of a vector field.
Definition operators.f90:85
Compute the gradient of a scalar field, multiplied by the mass matrix.
Definition operators.f90:91
Apply cyclic boundary condition to a vector field.
Defines a Matrix-vector product.
Definition ax.f90:34
Defines a list of bc_t.
Definition bc_list.f90:34
Coefficients.
Definition coef.f90:34
Device implementation of compressible flow operations.
subroutine, public compressible_ops_device_update_uvw(u_d, v_d, w_d, m_x_d, m_y_d, m_z_d, rho_d, n)
Update u,v,w fields.
subroutine, public compressible_ops_device_ns_flux_prepare(div_flux_d, dissipation_d, h1_d, dudx_d, dudy_d, dudz_d, dvdx_d, dvdy_d, dvdz_d, dwdx_d, dwdy_d, dwdz_d, mu_d, n)
Prepare physical Navier-Stokes flux work arrays.
subroutine, public compressible_ops_device_ns_flux_finalize(visc_m_x_d, visc_m_y_d, visc_m_z_d, visc_e_d, f_x_d, f_y_d, f_z_d, opgrad_x_d, opgrad_y_d, opgrad_z_d, u_d, v_d, w_d, b_d, dissipation_d, n)
Finish physical Navier-Stokes flux assembly.
subroutine, public compressible_ops_device_update_mxyz_p_ruvw(m_x_d, m_y_d, m_z_d, p_d, ruvw_d, u_d, v_d, w_d, e_d, rho_d, gamma, n)
Update m_x, m_y, m_z, p, ruvw, fields.
subroutine, public compressible_ops_device_ns_flux_temperature(div_flux_d, h1_d, p_d, rho_d, kappa_d, gamma, n)
Prepare temperature and conductivity coefficient for energy flux.
subroutine evaluate_rhs_device(rhs_rho_field, rhs_m_x, rhs_m_y, rhs_m_z, rhs_e, rho_field, m_x, m_y, m_z, e, p, u, v, w, ax, ax_stress, coef, gs, h, artificial_visc, mu, kappa)
real(kind=rp), public compressible_res_device_gamma
Module variable to store thermodynamic parameter set by factory.
subroutine advance_primitive_variables_device(rho_field, m_x, m_y, m_z, e, p, u, v, w, ax, ax_stress, coef, gs, h, artificial_visc, mu, kappa, bcs_vel, time, rk_scheme, dt)
subroutine add_navier_stokes_flux_device(visc_m_x, visc_m_y, visc_m_z, visc_e, rho_field, p, u, v, w, mu, kappa, ax, ax_stress, coef)
Add the physical Navier-Stokes flux contribution to the viscous residual.
logical compressible_res_device_add_physical_stress
Whether physical viscous stress is active for the current step.
logical compressible_res_device_add_physical_flux
Whether physical Navier-Stokes fluxes are active for the current step.
subroutine, public device_add2(a_d, b_d, n, strm)
Vector addition .
subroutine, public device_rone(a_d, n, strm)
Set all elements to one.
subroutine, public device_cmult(a_d, c, n, strm)
Multiplication by constant c .
subroutine, public device_sub2(a_d, b_d, n, strm)
Vector substraction .
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 .
Defines a field.
Definition field.f90:34
Gather-scatter.
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.
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.
Module with things related to the simulation time.
Utilities.
Definition utils.f90:35
Base type for a matrix-vector product providing .
Definition ax.f90:43
A list of allocatable `bc_t`. Follows the standard interface of lists.
Definition bc_list.f90:49
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:63
field_list_t, To be able to group fields together
Gather-scatter kernel.
A struct that contains all info about the time, expand as needed.