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