diff --git a/Exec/DoubleRamp/prob.H b/Exec/DoubleRamp/prob.H index 48b5458..66ab0a0 100644 --- a/Exec/DoubleRamp/prob.H +++ b/Exec/DoubleRamp/prob.H @@ -6,7 +6,6 @@ #include "IndexDefines.H" #include "prob_parm.H" -#include "CAMR_params.H" #include "EOS.H" AMREX_GPU_DEVICE diff --git a/Exec/MovingEBCases/MovingPlane_Shock/prob.H b/Exec/MovingEBCases/MovingPlane_Shock/prob.H index 1f8850c..6b8f5b0 100644 --- a/Exec/MovingEBCases/MovingPlane_Shock/prob.H +++ b/Exec/MovingEBCases/MovingPlane_Shock/prob.H @@ -6,7 +6,6 @@ #include "IndexDefines.H" #include "prob_parm.H" -#include "CAMR_params.H" #include "EOS.H" AMREX_GPU_DEVICE @@ -22,7 +21,6 @@ CAMR_initdata( int i, int j, int k, const amrex::Real* dx = geomdata.CellSize(); amrex::Real x = prob_lo[0] + (i+amrex::Real(0.5))*dx[0]; - amrex::Real y = prob_lo[1] + (j+amrex::Real(0.5))*dx[1]; amrex::Real Pt, rhot, uxt; if (x < amrex::Real(0.5)) { diff --git a/Exec/ReReTest/prob.H b/Exec/ReReTest/prob.H index 5b43e9e..b072d41 100644 --- a/Exec/ReReTest/prob.H +++ b/Exec/ReReTest/prob.H @@ -6,7 +6,6 @@ #include "IndexDefines.H" #include "prob_parm.H" -#include "CAMR_params.H" #include "EOS.H" AMREX_GPU_DEVICE diff --git a/Exec/Sod/prob.H b/Exec/Sod/prob.H index 891e706..ad5aade 100644 --- a/Exec/Sod/prob.H +++ b/Exec/Sod/prob.H @@ -6,7 +6,6 @@ #include "IndexDefines.H" #include "prob_parm.H" -#include "CAMR_params.H" #include "EOS.H" AMREX_GPU_DEVICE diff --git a/Exec/SodPlusSphere/converging_nozzle.inp b/Exec/SodPlusSphere/converging_nozzle.inp index a03b91f..08d0b30 100644 --- a/Exec/SodPlusSphere/converging_nozzle.inp +++ b/Exec/SodPlusSphere/converging_nozzle.inp @@ -1,3 +1,7 @@ +# This is a 3D problem: the converging-nozzle geometry is axisymmetric (built +# with a lathe), so it must be run with an executable built with DIM = 3. +# Note that the GNUmakefile in this directory defaults to DIM = 2. + amrex.fpe_trap_invalid = 1 amrex.fpe_trap_zero = 1 amrex.fpe_trap_overflow = 1 diff --git a/Exec/SodPlusSphere/prob.H b/Exec/SodPlusSphere/prob.H index db10561..9e4dc55 100644 --- a/Exec/SodPlusSphere/prob.H +++ b/Exec/SodPlusSphere/prob.H @@ -6,7 +6,6 @@ #include "IndexDefines.H" #include "prob_parm.H" -#include "CAMR_params.H" #include "EOS.H" AMREX_GPU_DEVICE diff --git a/Source/CAMR.H b/Source/CAMR.H index 47b3005..405aebc 100644 --- a/Source/CAMR.H +++ b/Source/CAMR.H @@ -479,29 +479,26 @@ CAMR::numGrow() int ng = 4; #ifdef AMREX_USE_EB // IF MOL + FRD then 5 - // IF Godunov + FRD then 6 + // IF Godunov + FRD then 7 // IF MOL + SRD then 6 - // IF Godunov + SRD then 7 + // IF Godunov + SRD then 8 // IF MOL + none then 5 // IF Godunov + none then 6 // - // NoRedist takes the same ngrow_bx = 2 as FluxRedist in - // construct_hydro_source, so it needs the same number of ghost cells - if (redistribution_type == "FluxRedist" || redistribution_type == "NoRedist") + // Godunov + redistribution needs one more than the PLM stencil: the traced + // states on the outer ring of the EB Godunov box feed the redistributed + // update, and flatten_eb() needs q at +-3 around that ring. + if (redistribution_type == "FluxRedist") { - if (do_mol) { - ng = 5; - } else { - ng = 6; - } + ng = (do_mol) ? 5 : 7; + } + else if (redistribution_type == "NoRedist") + { + ng = (do_mol) ? 5 : 6; } else if (redistribution_type == "StateRedist") { - if (do_mol) { - ng = 6; - } else { - ng = 7; - } + ng = (do_mol) ? 6 : 8; } #endif return ng; diff --git a/Source/CAMR.cpp b/Source/CAMR.cpp index c414ec2..6142a63 100644 --- a/Source/CAMR.cpp +++ b/Source/CAMR.cpp @@ -204,12 +204,13 @@ CAMR::read_params() } #endif - // for the moment, ppm_type = 0 does not support ppm_trace_sources -- - // we need to add the momentum sources to the states (and not - // add it in trans_3d - if (ppm_type == 0 && ppm_trace_sources == 1) { + // Source tracing is not implemented for either reconstruction: the + // PPM source block in PPM.cpp is commented out and PLM never had one. + // Sources are added in hydro_transd/hydro_transdd instead. + if (ppm_trace_sources == 1) { amrex::Print() - << "WARNING: ppm_trace_sources = 1 not implemented for ppm_type = 0" + << "WARNING: ppm_trace_sources = 1 is not implemented (ppm_type = " + << ppm_type << "); sources are added in the transverse step instead" << std::endl; ppm_trace_sources = 0; pp.add("ppm_trace_sources", ppm_trace_sources); diff --git a/Source/EB/eb_converging_nozzle.cpp b/Source/EB/eb_converging_nozzle.cpp index 08e2ddf..445ab62 100644 --- a/Source/EB/eb_converging_nozzle.cpp +++ b/Source/EB/eb_converging_nozzle.cpp @@ -14,6 +14,13 @@ using namespace amrex; ********************************************************************************/ void make_eb_converging_nozzle (const Geometry& geom, int required_coarsening_level) { +#if (AMREX_SPACEDIM != 3) + // In 2D amrex's LatheIF revolves about the origin and RotationIF ignores the + // axis argument, so the same expression below builds an unrelated geometry + // rather than a nozzle. + amrex::ignore_unused(geom, required_coarsening_level); + amrex::Abort("CAMR.geometry = converging-nozzle is an axisymmetric (lathe) geometry and requires DIM = 3"); +#else amrex::Real d_inlet = 8; amrex::Real l_inlet = 24; amrex::Real l_nozzle = 5; @@ -52,4 +59,5 @@ void make_eb_converging_nozzle (const Geometry& geom, int required_coarsening_le auto polys = amrex::EB2::makeUnion(main, nozzle_exit); auto gshop = amrex::EB2::makeShop(polys); EB2::Build(gshop, geom, required_coarsening_level, required_coarsening_level); +#endif } diff --git a/Source/Hydro/Hydro_utils_eb_K.H b/Source/Hydro/Hydro_utils_eb_K.H index a1ccc77..ca15c16 100644 --- a/Source/Hydro/Hydro_utils_eb_K.H +++ b/Source/Hydro/Hydro_utils_eb_K.H @@ -545,11 +545,13 @@ void eb_compute_div (int i, int j, int k, int n, if (eb_weights_type == 0) { redistwgt(i,j,k) = 1.0; } else if (eb_weights_type == 1) { - redistwgt(i,j,k) = q(i,j,k,QRHO)*( q(i,j,k,QREINT) + + // Total energy density; note QREINT is rho*e in CAMR (CNS's QEINT + // is e, which is where the old rho*(...) form came from). + redistwgt(i,j,k) = q(i,j,k,QREINT) + 0.5*q(i,j,k,QRHO)*( #if (AMREX_SPACEDIM == 2) - 0.5*(q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV)) ); + q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV) ); #else - 0.5*(q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV) + q(i,j,k,QW)*q(i,j,k,QW)) ); + q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV) + q(i,j,k,QW)*q(i,j,k,QW) ); #endif } else if (eb_weights_type == 2) { diff --git a/Source/Hydro/MOL/MOL_umeth_eb.cpp b/Source/Hydro/MOL/MOL_umeth_eb.cpp index 08906ab..e7e7ccf 100644 --- a/Source/Hydro/MOL/MOL_umeth_eb.cpp +++ b/Source/Hydro/MOL/MOL_umeth_eb.cpp @@ -65,8 +65,9 @@ MOL_umeth_eb (const Box& bx_to_fill, // **************************************************************** // Slopes -- we will compute divc on bxg2 so need slopes on bxg3 // **************************************************************** - FArrayBox slopetmp; - slopetmp.resize(bxg_ii,QVAR); + // Async arena: the Riemann kernels that read the slopes are still in + // flight when this function returns and nothing here synchronizes. + FArrayBox slopetmp(bxg_ii, QVAR, amrex::The_Async_Arena()); auto const& slope = slopetmp.array(); AMREX_D_TERM(auto const& fx_arr = flux_tmp[0];, diff --git a/Source/Params/_cpp_parameters b/Source/Params/_cpp_parameters index f2e1ea3..60706f4 100644 --- a/Source/Params/_cpp_parameters +++ b/Source/Params/_cpp_parameters @@ -60,8 +60,10 @@ const_grav Real 0.0 # 2: extrema-preserving ppm (deprecated in C++) ppm_type int 0 -# to we reconstruct and trace under the parabolas of the source -# terms to the velocity +# do we reconstruct and trace under the parabolas of the source +# terms to the velocity. Not implemented for any ppm_type: the source +# tracing in PPM.cpp is commented out and the sources are added in the +# transverse step instead, so setting this to 1 warns and resets it to 0. ppm_trace_sources int 0 # for piecewise linear, reconstruction order to use @@ -104,6 +106,8 @@ transverse_reset_density int 1 #----------------------------------------------------------------------------- # category: EB #----------------------------------------------------------------------------- +# weights used to distribute the small-cell correction in flux redistribution: +# 0: uniform; 1: total energy density; 2: density; 3: volume fraction eb_weights_type int 2 redistribution_type string "FluxRedist" diff --git a/Source/Params/parse_CAMR_params.py b/Source/Params/parse_CAMR_params.py index 79abca9..41f61fb 100755 --- a/Source/Params/parse_CAMR_params.py +++ b/Source/Params/parse_CAMR_params.py @@ -157,9 +157,12 @@ def get_decl_string(self): # this is the line that goes into CAMR_params.H included # into CAMR.H - static = "" + # prob.H includes this header at file scope, so the declarations are + # also unused file-scope statics in several translation units; the + # attribute keeps -Wall -Werror builds quiet. + static = "[[maybe_unused]]" if self.static: - static = "static" + static = "[[maybe_unused]] static" if self.dtype == "int": tstr = "{} int {};\n".format(static, self.cpp_var_name)