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