WarpX
Loading...
Searching...
No Matches
MusclHancockUtils.H
Go to the documentation of this file.
1/* Copyright 2023 Grant Johnson, Remi Lehe
2 *
3 * This file is part of WarpX.
4 *
5 * License: BSD-3-Clause-LBNL
6 */
7#ifndef WARPX_MusclHancock_H_
8#define WARPX_MusclHancock_H_
9
10#include <AMReX.H>
11#include <AMReX_Array4.H>
12#include <AMReX_Gpu.H>
13#include <AMReX_REAL.H>
14
15#include <tuple>
16
17
18// Euler push for momentum source (r-direction)
19// Note: assumes U normalized by c
21amrex::Real F_r (amrex::Real r, amrex::Real u_r, amrex::Real u_theta, amrex::Real u_z, amrex::Real dt)
22{
23 using namespace amrex::literals;
24 return dt*(-u_theta*u_theta/r)/std::sqrt(1.0_rt + u_r*u_r + u_theta*u_theta + u_z*u_z) + u_r;
25}
26
27// Euler push for momentum source (theta-direction)
28// Note: assumes U normalized by c
30amrex::Real F_theta (amrex::Real r, amrex::Real u_r, amrex::Real u_theta, amrex::Real u_z, amrex::Real dt)
31{
32 using namespace amrex::literals;
33 return dt*(u_theta*u_r/r)/std::sqrt(1.0_rt + u_r*u_r + u_theta*u_theta + u_z*u_z) + u_theta;
34}
35// Velocity at the half step
37amrex::Real V_calc (const amrex::Array4<amrex::Real>& U, int i, int j, int k, int comp, amrex::Real c)
38{
39 using namespace amrex::literals;
40 // comp -> x, y, z -> 0, 1, 2, return Vx, Vy, or Vz:
41 const amrex::Real gamma = std::sqrt(1.0_rt + (U(i,j,k,1)*U(i,j,k,1) + U(i,j,k,2)*U(i,j,k,2) + U(i,j,k,3)*U(i,j,k,3))/(c*c));
42 return U(i,j,k,comp+1)/gamma;
43}
44// mindmod
46amrex::Real minmod (amrex::Real a, amrex::Real b)
47{
48 using namespace amrex::literals;
49 if (a > 0.0_rt && b > 0.0_rt) {
50 return std::min(a, b);
51 } else if (a < 0.0_rt && b < 0.0_rt) {
52 return std::max(a, b);
53 } else {
54 return 0.0_rt;
55 }
56}
57// mindmod
59amrex::Real minmod3 (amrex::Real a, amrex::Real b , amrex::Real c)
60{
61 using namespace amrex::literals;
62 if (a > 0.0_rt && b > 0.0_rt && c > 0.0_rt) {
63 return std::min({a,b,c});
64 } else if (a < 0.0_rt && b < 0.0_rt && c < 0.0_rt) {
65 return std::max({a,b,c});
66 } else {
67 return 0.0;
68 }
69}
70//maxmod
72amrex::Real maxmod (amrex::Real a, amrex::Real b)
73{
74 using namespace amrex::literals;
75 if (a > 0.0_rt && b > 0.0_rt) {
76 return std::max(a, b);
77 } else if (a < 0.0_rt && b < 0.0_rt) {
78 return std::min(a, b);
79 } else {
80 return 0.0_rt;
81 }
82}
83// Rusanov Flux (density)
86int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
87{
88 using namespace amrex::literals;
89 const amrex::Real c = std::max( std::abs(Vm) , std::abs(Vp) );
90 return 0.5_rt*(Vm*Um(i,j,k,0) + Vp*Up(i,j,k,0)) - (0.5_rt*c)*(Up(i,j,k,0) - Um(i,j,k,0));
91}
92// Rusanov Flux (Momentum density x)
95int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
96{
97 using namespace amrex::literals;
98 const amrex::Real c = std::max( std::abs(Vm) , std::abs(Vp) );
99 return 0.5_rt*(Vm*Um(i,j,k,0)*Um(i,j,k,1) + Vp*Up(i,j,k,0)*Up(i,j,k,1))
100 - (0.5_rt*c)*(Up(i,j,k,0)*Up(i,j,k,1) - Um(i,j,k,0)*Um(i,j,k,1));
101}
102// Rusanov Flux (Momentum density y)
105int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
106{
107 using namespace amrex::literals;
108 const amrex::Real c = std::max( std::abs(Vm) , std::abs(Vp) );
109 return 0.5_rt*(Vm*Um(i,j,k,0)*Um(i,j,k,2) + Vp*Up(i,j,k,0)*Up(i,j,k,2))
110 - (0.5_rt*c)*(Up(i,j,k,0)*Up(i,j,k,2) - Um(i,j,k,0)*Um(i,j,k,2));
111}
112// Rusanov Flux (Momentum density z)
115int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
116{
117 using namespace amrex::literals;
118 const amrex::Real c = std::max( std::abs(Vm) , std::abs(Vp) );
119 return 0.5_rt*(Vm*Um(i,j,k,0)*Um(i,j,k,3) + Vp*Up(i,j,k,0)*Up(i,j,k,3))
120 - (0.5_rt*c)*(Up(i,j,k,0)*Up(i,j,k,3) - Um(i,j,k,0)*Um(i,j,k,3));
121}
122// ave_minmod high diffusivity, sigma can be between [1,2]
124amrex::Real ave_adjustable_diff (amrex::Real a, amrex::Real b)
125{
126 using namespace amrex::literals;
127 constexpr auto sigma = static_cast<amrex::Real>(2.0*0.732050807568877);
128 if (a*b > 0.0_rt) {
129 return minmod3( (a+b)/2.0_rt, sigma*a, sigma*b );
130 } else {
131 return 0.0_rt;
132 }
133}
134// ave_minmod Low diffusivity
136amrex::Real ave (amrex::Real a, amrex::Real b)
137{
138 using namespace amrex::literals;
139 if (a*b > 0.0_rt) {
140 return minmod3( (a+b)/2.0_rt, 2.0_rt*a, 2.0_rt*b );
141 } else {
142 return 0.0_rt;
143 }
144}
145// ave_superbee
147amrex::Real ave_superbee (amrex::Real a, amrex::Real b)
148{
149 using namespace amrex::literals;
150 if (a*b > 0.0_rt) {
151 return minmod( maxmod(a,b), minmod(2.0_rt*a,2.0_rt*b));
152 } else {
153 return 0.0_rt;
154 }
155}
156// stage2 slope limiting
158amrex::Real ave_stage2 (amrex::Real dQ, amrex::Real a, amrex::Real b, amrex::Real c)
159{
160 using namespace amrex::literals;
161 // sigma = sqrt(3) -1
162 constexpr auto sigma = 0.732050807568877_rt;
163 const amrex::Real dq_min = 2.0_rt*std::min( b - std::min({a,b,c}), std::max({a,b,c}) - b);
164 return ( std::abs(dQ)/dQ ) * std::min( std::abs(dQ) , sigma*std::abs(dq_min) );
165}
166// Returns the offset indices for the "plus" grid
168std::tuple<int,int,int> plus_index_offsets (int i, int j, int k, int comp)
169{
170 int ip = 0;
171 int jp = 0;
172 int kp = 0;
173
174 // Find the correct offsets
175#if defined(WARPX_DIM_3D)
176 if (comp == 0) { //x
177 ip = i - 1; jp = j; kp = k;
178 } else if (comp == 1){ //y
179 ip = i; jp = j - 1; kp = k;
180 } else if (comp == 2){ //z
181 ip = i; jp = j; kp = k - 1;
182 }
183#elif defined(WARPX_DIM_RZ) || defined(WARPX_DIM_XZ)
184 if (comp == 0) { //x
185 ip = i - 1; jp = j; kp = k;
186 } else if (comp == 2){ //z
187 ip = i; jp = j - 1; kp = k;
188 }
189#elif defined(WARPX_DIM_RCYLINDER) || defined(WARPX_DIM_RSPHERE)
190 if (comp == 0) { //z
191 ip = i - 1; jp = j; kp = k;
192 }
193#elif defined(WARPX_DIM_1D_Z)
194 if (comp == 2) { //z
195 ip = i - 1; jp = j; kp = k;
196 }
197#endif
198
199 return {ip, jp, kp};
200}
201
202// Compute the zero edges
204void compute_U_edges (const amrex::Array4<amrex::Real>& Um, const amrex::Array4<amrex::Real>& Up, int i, int j, int k, amrex::Box box,
205amrex::Real U_tilde0, amrex::Real U_tilde1, amrex::Real U_tilde2, amrex::Real U_tilde3,
206amrex::Real dU0x, amrex::Real dU1x, amrex::Real dU2x, amrex::Real dU3x, int comp)
207{
208 using namespace amrex::literals;
209 // comp -> x, y, z -> 0, 1, 2
210 const auto [ip, jp, kp] = plus_index_offsets(i, j, k, comp);
211
212 if ( box.contains(i,j,k) ) {
213 Um(i,j,k,0) = U_tilde0 + dU0x/2.0_rt;
214 Um(i,j,k,1) = U_tilde1 + dU1x/2.0_rt;
215 Um(i,j,k,2) = U_tilde2 + dU2x/2.0_rt;
216 Um(i,j,k,3) = U_tilde3 + dU3x/2.0_rt;
217 }
218
219 if ( box.contains(ip,jp,kp) ) {
220 Up(ip,jp,kp,0) = U_tilde0 - dU0x/2.0_rt;
221 Up(ip,jp,kp,1) = U_tilde1 - dU1x/2.0_rt;
222 Up(ip,jp,kp,2) = U_tilde2 - dU2x/2.0_rt;
223 Up(ip,jp,kp,3) = U_tilde3 - dU3x/2.0_rt;
224 }
225}
226// Compute the zero edges
229const amrex::Array4<amrex::Real>& Up, int i, int j, int k, amrex::Box box, int comp)
230{
231 using namespace amrex::literals;
232 // comp -> x, y, z -> 0, 1, 2
233 const auto [ip, jp, kp] = plus_index_offsets(i, j, k, comp);
234
235 if ( box.contains(i,j,k) ) {
236 Um(i,j,k,0) = 0.0_rt;
237 Um(i,j,k,1) = 0.0_rt;
238 Um(i,j,k,2) = 0.0_rt;
239 Um(i,j,k,3) = 0.0_rt;
240 }
241
242 if ( box.contains(ip,jp,kp) ) {
243 Up(ip,jp,kp,0) = 0.0_rt;
244 Up(ip,jp,kp,1) = 0.0_rt;
245 Up(ip,jp,kp,2) = 0.0_rt;
246 Up(ip,jp,kp,3) = 0.0_rt;
247 }
248}
249// Positivity Limiter
250// if Q_minus or Q_plus is zero for the density (i.e. component 0 of Q_minus/Q_plus), set dQ to 0 and recompute Q_minus / Q_plus
253const amrex::Array4<amrex::Real>& U_edge_minus, const amrex::Array4<amrex::Real>& N_arr,
254int i, int j, int k, amrex::Box box, amrex::Real Ux, amrex::Real Uy, amrex::Real Uz,
255int comp)
256{
257
258 using namespace amrex::literals;
259 // comp -> x, y, z -> 0, 1, 2
260 const auto [ip, jp, kp] = plus_index_offsets(i, j, k, comp);
261
262 // Set the edges to zero. If one edge in a cell is zero, we must self-consistently
263 // set the slope to zero (hence why we have the three cases, the first is when
264 // both points exist, and the second two are are edge cases)
265 if (( box.contains(i,j,k) ) && ( box.contains(ip,jp,kp) )) {
266 if ((U_edge_minus(i,j,k,0) < 0.0_rt) || (U_edge_plus(ip,jp,kp,0) < 0.0_rt)) {
267 U_edge_minus(i,j,k,0) = N_arr(i,j,k);
268 U_edge_minus(i,j,k,1) = Ux;
269 U_edge_minus(i,j,k,2) = Uy;
270 U_edge_minus(i,j,k,3) = Uz;
271 U_edge_plus(ip,jp,kp,0) = N_arr(i,j,k);
272 U_edge_plus(ip,jp,kp,1) = Ux;
273 U_edge_plus(ip,jp,kp,2) = Uy;
274 U_edge_plus(ip,jp,kp,3) = Uz;
275 }
276 } else if (( box.contains(i,j,k) ) && ( box.contains(ip,jp,kp) != 1)) {
277 if (U_edge_minus(i,j,k,0) < 0.0_rt) {
278 U_edge_minus(i,j,k,0) = N_arr(i,j,k);
279 U_edge_minus(i,j,k,1) = Ux;
280 U_edge_minus(i,j,k,2) = Uy;
281 U_edge_minus(i,j,k,3) = Uz;
282 }
283 } else if (( box.contains(i,j,k) != 1 ) && ( box.contains(ip,jp,kp) )) {
284 if (U_edge_plus(ip,jp,kp,0) < 0.0_rt){
285 U_edge_plus(ip,jp,kp,0) = N_arr(i,j,k);
286 U_edge_plus(ip,jp,kp,1) = Ux;
287 U_edge_plus(ip,jp,kp,2) = Uy;
288 U_edge_plus(ip,jp,kp,3) = Uz;
289 }
290 }
291}
292
293// Compute the difference in N (down-x)
295amrex::Real DownDx_N (const amrex::Array4<amrex::Real>& N, int i, int j, int k)
296{
297 using namespace amrex::literals;
298 // Write the correct differences
299#if defined(WARPX_DIM_1D_Z)
300 amrex::ignore_unused(N, i, j, k);
301 return 0.0_rt;
302#else
303 return N(i,j,k) - N(i-1,j,k);
304#endif
305}
306// Compute the difference in N (up-x)
308amrex::Real UpDx_N (const amrex::Array4<amrex::Real>& N, int i, int j, int k)
309{
310 using namespace amrex::literals;
311 // Write the correct differences
312#if defined(WARPX_DIM_1D_Z)
313 amrex::ignore_unused(N, i, j, k);
314 return 0.0_rt;
315#else
316 return N(i+1,j,k) - N(i,j,k);
317#endif
318}
319// Compute the difference in N (down-y)
321amrex::Real DownDy_N (const amrex::Array4<amrex::Real>& N, int i, int j, int k)
322{
323 using namespace amrex::literals;
324 // Write the correct differences
325#if defined(WARPX_DIM_3D)
326 return N(i,j,k) - N(i,j-1,k);
327#else
328 amrex::ignore_unused(N, i, j, k);
329 return 0.0_rt;
330#endif
331}
332// Compute the difference in N (up-y)
334amrex::Real UpDy_N (const amrex::Array4<amrex::Real>& N, int i, int j, int k)
335{
336 using namespace amrex::literals;
337 // Write the correct differences
338#if defined(WARPX_DIM_3D)
339 return N(i,j+1,k) - N(i,j,k);
340#else
341 amrex::ignore_unused(N, i, j, k);
342 return 0.0_rt;
343#endif
344}
345// Compute the difference in N (down-z)
347amrex::Real DownDz_N (const amrex::Array4<amrex::Real>& N, int i, int j, int k)
348{
349 using namespace amrex::literals;
350 // Write the correct differences
351#if defined(WARPX_DIM_3D)
352 return N(i,j,k) - N(i,j,k-1);
353#elif defined(WARPX_DIM_RZ) || defined(WARPX_DIM_XZ)
354 return N(i,j,k) - N(i,j-1,k);
355#elif defined(WARPX_DIM_1D_Z)
356 return N(i,j,k) - N(i-1,j,k);
357#else
358 amrex::ignore_unused(N, i, j, k);
359 return 0.0_rt;
360#endif
361}
362// Compute the difference in N (up-z)
364amrex::Real UpDz_N (const amrex::Array4<amrex::Real>& N, int i, int j, int k)
365{
366 using namespace amrex::literals;
367 // Write the correct differences
368#if defined(WARPX_DIM_3D)
369 return N(i,j,k+1) - N(i,j,k);
370#elif defined(WARPX_DIM_RZ) || defined(WARPX_DIM_XZ)
371 return N(i,j+1,k) - N(i,j,k);
372#elif defined(WARPX_DIM_1D_Z)
373 return N(i+1,j,k) - N(i,j,k);
374#else
375 amrex::ignore_unused(N, i, j, k);
376 return 0.0_rt;
377#endif
378}
379
380
381// Compute the difference in U (down-x)
384const amrex::Array4<amrex::Real>& NU, amrex::Real& U, int i, int j, int k)
385{
386 using namespace amrex::literals;
387 // Write the correct differences
388#if defined(WARPX_DIM_1D_Z)
389 amrex::ignore_unused(N, NU, U, i, j, k);
390 return 0.0_rt;
391#else
392 // U is zero if N is zero, Check positivity before dividing
393 amrex::Real U_m = 0;
394 if (N(i-1,j,k) > 0) { U_m = NU(i-1,j,k)/N(i-1,j,k); }
395 return U - U_m;
396#endif
397}
398// Compute the difference in U (up-x)
400amrex::Real UpDx_U (const amrex::Array4<amrex::Real>& N,
401const amrex::Array4<amrex::Real>& NU, amrex::Real& U, int i, int j, int k)
402{
403 using namespace amrex::literals;
404 // Write the correct differences
405#if defined(WARPX_DIM_1D_Z)
406 amrex::ignore_unused(N, NU, U, i, j, k);
407 return 0.0_rt;
408#else
409 // U is zero if N is zero, Check positivity before dividing
410 amrex::Real U_p = 0;
411 if (N(i+1,j,k) > 0) { U_p = NU(i+1,j,k)/N(i+1,j,k); }
412 return U_p - U;
413#endif
414}
415
416// Compute the difference in U (down-y)
419const amrex::Array4<amrex::Real>& NU, amrex::Real& U, int i, int j, int k)
420{
421 using namespace amrex::literals;
422 // Write the correct differences
423#if defined(WARPX_DIM_3D)
424 // U is zero if N is zero, Check positivity before dividing
425 amrex::Real U_m = 0;
426 if (N(i,j-1,k) > 0) { U_m = NU(i,j-1,k)/N(i,j-1,k); }
427 return U - U_m;
428#else
429 amrex::ignore_unused(N, NU, U, i, j, k);
430 return 0.0_rt;
431#endif
432}
433// Compute the difference in U (up-y)
435amrex::Real UpDy_U (const amrex::Array4<amrex::Real>& N,
436const amrex::Array4<amrex::Real>& NU, amrex::Real& U, int i, int j, int k)
437{
438 using namespace amrex::literals;
439 // Write the correct differences
440#if defined(WARPX_DIM_3D)
441 // U is zero if N is zero, Check positivity before dividing
442 amrex::Real U_p = 0;
443 if (N(i,j+1,k) > 0) { U_p = NU(i,j+1,k)/N(i,j+1,k); }
444 return U_p - U;
445#else
446 amrex::ignore_unused(N, NU, U, i, j, k);
447 return 0.0_rt;
448#endif
449}
450
451// Compute the difference in U (down-z)
454const amrex::Array4<amrex::Real>& NU, amrex::Real& U, int i, int j, int k)
455{
456 using namespace amrex::literals;
457 // Write the correct differences
458 amrex::Real U_m = 0_rt;
459
460 // U is zero if N is zero, Check positivity before dividing
461#if defined(WARPX_DIM_3D)
462 if (N(i,j,k-1) > 0) { U_m = NU(i,j,k-1)/N(i,j,k-1); }
463#elif defined(WARPX_DIM_RZ) || defined(WARPX_DIM_XZ)
464 if (N(i,j-1,k) > 0) { U_m = NU(i,j-1,k)/N(i,j-1,k); }
465#elif defined(WARPX_DIM_1D_Z)
466 if (N(i-1,j,k) > 0) { U_m = NU(i-1,j,k)/N(i-1,j,k); }
467#else
468 amrex::ignore_unused(N, NU, U, i, j, k);
469 return 0.0_rt;
470#endif
471
472 // Return the difference
473 return U - U_m;
474}
475// Compute the difference in U (up-z)
477amrex::Real UpDz_U (const amrex::Array4<amrex::Real>& N,
478const amrex::Array4<amrex::Real>& NU, amrex::Real& U, int i, int j, int k)
479{
480 using namespace amrex::literals;
481 // Write the correct differences
482 amrex::Real U_p = 0;
483
484 // U is zero if N is zero, Check positivity before dividing
485#if defined(WARPX_DIM_3D)
486 if (N(i,j,k+1) > 0) { U_p = NU(i,j,k+1)/N(i,j,k+1); }
487#elif defined(WARPX_DIM_RZ) || defined(WARPX_DIM_XZ)
488 if (N(i,j+1,k) > 0) { U_p = NU(i,j+1,k)/N(i,j+1,k); }
489#elif defined(WARPX_DIM_1D_Z)
490 if (N(i+1,j,k) > 0) { U_p = NU(i+1,j,k)/N(i+1,j,k); }
491#else
492 amrex::ignore_unused(N, NU, U, i, j, k);
493 return 0.0_rt;
494#endif
495
496 // Return the difference
497 return U_p - U;
498}
499
500
501// Flux difference calculation
503amrex::Real dF (const amrex::Array4<amrex::Real>& U_minus,
504const amrex::Array4<amrex::Real>& U_plus,int i,int j,int k,amrex::Real clight, int comp, int dir)
505{
506 using namespace amrex::literals;
507 // dir -> x, y, z -> 0, 1, 2
508 const auto [ip, jp, kp] = plus_index_offsets(i, j, k, dir);
509
510 const amrex::Real V_L_minus = V_calc(U_minus,ip,jp,kp,dir,clight);
511 const amrex::Real V_I_minus = V_calc(U_minus,i,j,k,dir,clight);
512 const amrex::Real V_L_plus = V_calc(U_plus,ip,jp,kp,dir,clight);
513 const amrex::Real V_I_plus = V_calc(U_plus,i,j,k,dir,clight);
514
515 // Flux differences depending on the component to compute
516 if (comp == 0){
517 return flux_N( U_minus, U_plus, i, j, k, V_I_minus, V_I_plus) - flux_N( U_minus, U_plus, ip, jp, kp, V_L_minus, V_L_plus);
518 } else if (comp == 1){
519 return flux_NUx( U_minus, U_plus, i, j, k, V_I_minus, V_I_plus) - flux_NUx( U_minus, U_plus, ip, jp, kp, V_L_minus, V_L_plus);
520 } else if (comp == 2){
521 return flux_NUy( U_minus, U_plus, i, j, k, V_I_minus, V_I_plus) - flux_NUy( U_minus, U_plus, ip, jp, kp, V_L_minus, V_L_plus);
522 } else { //if (comp == 3)
523 return flux_NUz( U_minus, U_plus, i, j, k, V_I_minus, V_I_plus) - flux_NUz( U_minus, U_plus, ip, jp, kp, V_L_minus, V_L_plus);
524 }
525}
526
527#endif /*WARPX_MusclHancock_H_*/
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real DownDx_U(const amrex::Array4< amrex::Real > &N, const amrex::Array4< amrex::Real > &NU, amrex::Real &U, int i, int j, int k)
Definition MusclHancockUtils.H:383
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void positivity_limiter(const amrex::Array4< amrex::Real > &U_edge_plus, const amrex::Array4< amrex::Real > &U_edge_minus, const amrex::Array4< amrex::Real > &N_arr, int i, int j, int k, amrex::Box box, amrex::Real Ux, amrex::Real Uy, amrex::Real Uz, int comp)
Definition MusclHancockUtils.H:252
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real dF(const amrex::Array4< amrex::Real > &U_minus, const amrex::Array4< amrex::Real > &U_plus, int i, int j, int k, amrex::Real clight, int comp, int dir)
Definition MusclHancockUtils.H:503
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void compute_U_edges(const amrex::Array4< amrex::Real > &Um, const amrex::Array4< amrex::Real > &Up, int i, int j, int k, amrex::Box box, amrex::Real U_tilde0, amrex::Real U_tilde1, amrex::Real U_tilde2, amrex::Real U_tilde3, amrex::Real dU0x, amrex::Real dU1x, amrex::Real dU2x, amrex::Real dU3x, int comp)
Definition MusclHancockUtils.H:204
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real DownDz_N(const amrex::Array4< amrex::Real > &N, int i, int j, int k)
Definition MusclHancockUtils.H:347
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real UpDx_U(const amrex::Array4< amrex::Real > &N, const amrex::Array4< amrex::Real > &NU, amrex::Real &U, int i, int j, int k)
Definition MusclHancockUtils.H:400
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real UpDy_N(const amrex::Array4< amrex::Real > &N, int i, int j, int k)
Definition MusclHancockUtils.H:334
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real V_calc(const amrex::Array4< amrex::Real > &U, int i, int j, int k, int comp, amrex::Real c)
Definition MusclHancockUtils.H:37
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::tuple< int, int, int > plus_index_offsets(int i, int j, int k, int comp)
Definition MusclHancockUtils.H:168
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real minmod3(amrex::Real a, amrex::Real b, amrex::Real c)
Definition MusclHancockUtils.H:59
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ave_superbee(amrex::Real a, amrex::Real b)
Definition MusclHancockUtils.H:147
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real UpDy_U(const amrex::Array4< amrex::Real > &N, const amrex::Array4< amrex::Real > &NU, amrex::Real &U, int i, int j, int k)
Definition MusclHancockUtils.H:435
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ave(amrex::Real a, amrex::Real b)
Definition MusclHancockUtils.H:136
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real UpDx_N(const amrex::Array4< amrex::Real > &N, int i, int j, int k)
Definition MusclHancockUtils.H:308
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real minmod(amrex::Real a, amrex::Real b)
Definition MusclHancockUtils.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real DownDy_U(const amrex::Array4< amrex::Real > &N, const amrex::Array4< amrex::Real > &NU, amrex::Real &U, int i, int j, int k)
Definition MusclHancockUtils.H:418
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real flux_NUz(const amrex::Array4< amrex::Real > &Um, const amrex::Array4< amrex::Real > &Up, int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
Definition MusclHancockUtils.H:114
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ave_adjustable_diff(amrex::Real a, amrex::Real b)
Definition MusclHancockUtils.H:124
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real DownDx_N(const amrex::Array4< amrex::Real > &N, int i, int j, int k)
Definition MusclHancockUtils.H:295
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real F_theta(amrex::Real r, amrex::Real u_r, amrex::Real u_theta, amrex::Real u_z, amrex::Real dt)
Definition MusclHancockUtils.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ave_stage2(amrex::Real dQ, amrex::Real a, amrex::Real b, amrex::Real c)
Definition MusclHancockUtils.H:158
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real UpDz_N(const amrex::Array4< amrex::Real > &N, int i, int j, int k)
Definition MusclHancockUtils.H:364
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real maxmod(amrex::Real a, amrex::Real b)
Definition MusclHancockUtils.H:72
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real flux_NUy(const amrex::Array4< amrex::Real > &Um, const amrex::Array4< amrex::Real > &Up, int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
Definition MusclHancockUtils.H:104
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real flux_N(const amrex::Array4< amrex::Real > &Um, const amrex::Array4< amrex::Real > &Up, int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
Definition MusclHancockUtils.H:85
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real DownDy_N(const amrex::Array4< amrex::Real > &N, int i, int j, int k)
Definition MusclHancockUtils.H:321
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set_U_edges_to_zero(const amrex::Array4< amrex::Real > &Um, const amrex::Array4< amrex::Real > &Up, int i, int j, int k, amrex::Box box, int comp)
Definition MusclHancockUtils.H:228
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real flux_NUx(const amrex::Array4< amrex::Real > &Um, const amrex::Array4< amrex::Real > &Up, int i, int j, int k, amrex::Real Vm, amrex::Real Vp)
Definition MusclHancockUtils.H:94
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real UpDz_U(const amrex::Array4< amrex::Real > &N, const amrex::Array4< amrex::Real > &NU, amrex::Real &U, int i, int j, int k)
Definition MusclHancockUtils.H:477
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real F_r(amrex::Real r, amrex::Real u_r, amrex::Real u_theta, amrex::Real u_z, amrex::Real dt)
Definition MusclHancockUtils.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real DownDz_U(const amrex::Array4< amrex::Real > &N, const amrex::Array4< amrex::Real > &NU, amrex::Real &U, int i, int j, int k)
Definition MusclHancockUtils.H:453
__host__ __device__ bool contains(const IntVectND< dim > &p) const noexcept
__host__ __device__ void ignore_unused(const Ts &...)
BoxND< 3 > Box