diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08445187..00048308 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > warnings.txt cat warnings.txt export return=$(tail -n 1 warnings.txt | awk '{print $2}') - #exit ${return} + exit ${return} #- name: EB debug build # working-directory: ./Exec/RegTests/EB-C10 # run: | @@ -298,7 +298,7 @@ jobs: | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings.txt cat ${{runner.workspace}}/build-output-warnings.txt export return=$(tail -n 1 ${{runner.workspace}}/build-output-warnings.txt | awk '{print $2}') - #exit ${return} + exit ${return} - name: Test run: | (for DIM in 2 3; do \ @@ -542,7 +542,7 @@ jobs: awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' < cppcheck-report.txt > cppcheck-warnings.txt cat cppcheck-warnings.txt export return=$(tail -n 1 cppcheck-warnings.txt | awk '{print $2}') - #exit ${return} + exit ${return} Lint-clang-tidy: needs: Formatting runs-on: ubuntu-latest diff --git a/Exec/RegTests/EnclosedFlame/pelelmex_prob.H b/Exec/RegTests/EnclosedFlame/pelelmex_prob.H index a5c07e9e..2712be56 100644 --- a/Exec/RegTests/EnclosedFlame/pelelmex_prob.H +++ b/Exec/RegTests/EnclosedFlame/pelelmex_prob.H @@ -128,7 +128,7 @@ void bcnormal( const amrex::Real* /*x[AMREX_SPACEDIM]*/, const int /*m_nAux*/, - amrex::Real[NVAR] /*s_ext[NVAR]*/, + amrex::Real* /*s_ext[NVAR]*/, const int /*idir*/, const int /*sgn*/, const amrex::Real /*time*/, diff --git a/Exec/RegTests/EnclosedInjection/pelelmex_prob.H b/Exec/RegTests/EnclosedInjection/pelelmex_prob.H index 82d3ad5c..3cd42136 100644 --- a/Exec/RegTests/EnclosedInjection/pelelmex_prob.H +++ b/Exec/RegTests/EnclosedInjection/pelelmex_prob.H @@ -72,28 +72,26 @@ AMREX_FORCE_INLINE void bcnormal( const amrex::Real x[AMREX_SPACEDIM], - const int m_nAux, + const int /*m_nAux*/, amrex::Real s_ext[NVAR], const int idir, const int sgn, const amrex::Real time, - amrex::GeometryData const& geomdata, + amrex::GeometryData const& /*geomdata*/, ProbParm const& prob_parm, pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/) { auto eos = pele::physics::PhysicsType::eos(); amrex::Real massfrac[NUM_SPECIES] = {0.0}; - amrex::Real molefrac[NUM_SPECIES] = {0.0}; amrex::Real X_air[NUM_SPECIES] = {0.0}; amrex::Real Y_air[NUM_SPECIES] = {0.0}; amrex::Real X_jet[NUM_SPECIES] = {0.0}; amrex::Real Y_jet[NUM_SPECIES] = {0.0}; amrex::Real eta = 0.0; - amrex::Real p_int; - const amrex::Real* prob_lo = geomdata.ProbLo(); - const amrex::Real* prob_hi = geomdata.ProbHi(); - const amrex::Real* dx = geomdata.CellSize(); + // const amrex::Real* prob_lo = geomdata.ProbLo(); + // const amrex::Real* prob_hi = geomdata.ProbHi(); + // const amrex::Real* dx = geomdata.CellSize(); // Simple, air into air injection X_air[O2_ID] = 0.21; @@ -150,7 +148,7 @@ zero_visc( int j, int k, amrex::Array4 const& beta, - amrex::GeometryData const& geomdata, + amrex::GeometryData const& /*geomdata*/, amrex::Box const& domainBox, const int dir, const int beta_comp, @@ -162,9 +160,9 @@ zero_visc( // velocity, ...) if (beta_comp == 0 && nComp == NUM_SPECIES) { if (dir == 2 && k <= domainBox.smallEnd(dir)) { - const amrex::Real* prob_lo = geomdata.ProbLo(); - const amrex::Real* prob_hi = geomdata.ProbHi(); - const amrex::Real* dx = geomdata.CellSize(); + // const amrex::Real* prob_lo = geomdata.ProbLo(); + // const amrex::Real* prob_hi = geomdata.ProbHi(); + // const amrex::Real* dx = geomdata.CellSize(); // Just over whole inlet for (int n = 0; n < nComp; n++) { diff --git a/Exec/RegTests/HITDecay/pelelmex_prob.H b/Exec/RegTests/HITDecay/pelelmex_prob.H index cdfb65fe..56e65eb1 100644 --- a/Exec/RegTests/HITDecay/pelelmex_prob.H +++ b/Exec/RegTests/HITDecay/pelelmex_prob.H @@ -171,7 +171,7 @@ void bcnormal( const amrex::Real* /*x[AMREX_SPACEDIM]*/, const int /*m_nAux*/, - amrex::Real[NVAR] /*s_ext[NVAR]*/, + amrex::Real* /*s_ext[NVAR]*/, const int /*idir*/, const int /*sgn*/, const amrex::Real /*time*/, diff --git a/Exec/RegTests/HotBubble/pelelmex_prob.H b/Exec/RegTests/HotBubble/pelelmex_prob.H index 55891f98..988e2751 100644 --- a/Exec/RegTests/HotBubble/pelelmex_prob.H +++ b/Exec/RegTests/HotBubble/pelelmex_prob.H @@ -17,12 +17,12 @@ pelelmex_initdata( int i, int j, int k, - int is_incompressible, + int /*is_incompressible*/, amrex::Array4 const& state, - amrex::Array4 const& aux, + amrex::Array4 const& /*aux*/, amrex::GeometryData const& geomdata, ProbParm const& prob_parm, - pele::physics::PMF::PmfData::DataContainer const* pmf_data) + pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/) { const amrex::Real* prob_lo = geomdata.ProbLo(); const amrex::Real* prob_hi = geomdata.ProbHi(); @@ -33,11 +33,9 @@ pelelmex_initdata( , const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];); AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0]; - , const amrex::Real Ly = prob_hi[1] - prob_lo[1]; + , /*const amrex::Real Ly = prob_hi[1] - prob_lo[1];*/ , const amrex::Real Lz = prob_hi[2] - prob_lo[2]); - constexpr amrex::Real Pi = 3.14159265358979323846264338327950288; - auto eos = pele::physics::PhysicsType::eos(); amrex::Real massfrac[NUM_SPECIES] = {0.0}; @@ -47,7 +45,7 @@ pelelmex_initdata( state(i, j, k, TEMP) = prob_parm.T_mean; amrex::Real x_c = prob_parm.is_sym != 0 ? prob_lo[0] : prob_lo[0] + 0.5 * Lx; #if AMREX_SPACEDIM == 3 - amrex::Real z_c = prob_parm.is_sym ? prob_lo[2] : prob_lo[2] + 0.5 * Lz; + amrex::Real z_c = prob_parm.is_sym != 0 ? prob_lo[2] : prob_lo[2] + 0.5 * Lz; #endif amrex::Real rad = std::sqrt(AMREX_D_TERM( (y - prob_parm.bubble_y0) * (y - prob_parm.bubble_y0), diff --git a/Exec/RegTests/PeriodicCases/pelelmex_prob.H b/Exec/RegTests/PeriodicCases/pelelmex_prob.H index 6bab32dd..060887dc 100644 --- a/Exec/RegTests/PeriodicCases/pelelmex_prob.H +++ b/Exec/RegTests/PeriodicCases/pelelmex_prob.H @@ -28,8 +28,8 @@ pelelmex_initdata( // const amrex::Real* prob_hi = geomdata.ProbHi(); const amrex::Real* dx = geomdata.CellSize(); AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0]; - , const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1]; - , const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];); + , const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];, + /*const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];*/); /* AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0]; , const amrex::Real Ly = prob_hi[1] - prob_lo[1]; @@ -64,7 +64,6 @@ pelelmex_initdata( -prob_parm.forcevort * deltay / r_sq * exp(-d_sq / r_sq / 2.); const amrex::Real v_vort = prob_parm.forcevort * deltax / r_sq * exp(-d_sq / r_sq / 2.); - const amrex::Real w_vort = 0.; switch (prob_parm.meanFlowDir) { case 1: @@ -99,8 +98,9 @@ pelelmex_initdata( break; } - if (is_incompressible != 0) + if (is_incompressible != 0) { return; + } state(i, j, k, TEMP) = prob_parm.T_mean; } else if (prob_parm.probType == 1) { // CoGau @@ -136,8 +136,9 @@ pelelmex_initdata( break; } - if (is_incompressible != 0) + if (is_incompressible != 0) { return; + } state(i, j, k, TEMP) = prob_parm.T_mean; const amrex::Real deltax = x - prob_parm.xgauss; @@ -187,8 +188,9 @@ pelelmex_initdata( break; } - if (is_incompressible != 0) + if (is_incompressible != 0) { return; + } state(i, j, k, TEMP) = prob_parm.T_mean; const amrex::Real deltax = x - prob_parm.xgauss; @@ -212,8 +214,9 @@ pelelmex_initdata( AMREX_D_TERM(state(i, j, k, VELX) = 0.0;, state(i, j, k, VELY) = 0.0; , state(i, j, k, VELZ) = 0.0); - if (is_incompressible != 0) + if (is_incompressible != 0) { return; + } state(i, j, k, TEMP) = prob_parm.T_mean; // Set up the Gaussian as the solution of the diffusion of a delta dirac @@ -221,7 +224,7 @@ pelelmex_initdata( // constant diffusion coeff. gaussDiff. Use ampgauss to avoid // undershoot/overshoot of the 2-species mixture. const amrex::Real deltax = x - prob_parm.xgauss; - const amrex::Real deltay = y - prob_parm.ygauss; + // const amrex::Real deltay = y - prob_parm.ygauss; amrex::Real denom_inv = prob_parm.ampgauss / std::sqrt(4 * Pi * prob_parm.gaussTime * prob_parm.gaussDiff); diff --git a/Exec/RegTests/TaylorGreen/pelelmex_prob.H b/Exec/RegTests/TaylorGreen/pelelmex_prob.H index a1d68ee7..0979870a 100644 --- a/Exec/RegTests/TaylorGreen/pelelmex_prob.H +++ b/Exec/RegTests/TaylorGreen/pelelmex_prob.H @@ -25,7 +25,7 @@ pelelmex_initdata( pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/) { const amrex::Real* prob_lo = geomdata.ProbLo(); - const amrex::Real* prob_hi = geomdata.ProbHi(); + // const amrex::Real* prob_hi = geomdata.ProbHi(); const amrex::Real* dx = geomdata.CellSize(); AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0]; diff --git a/Exec/RegTests/TurbInflow/pelelmex_prob.H b/Exec/RegTests/TurbInflow/pelelmex_prob.H index fcd4f8a1..77592d64 100644 --- a/Exec/RegTests/TurbInflow/pelelmex_prob.H +++ b/Exec/RegTests/TurbInflow/pelelmex_prob.H @@ -19,8 +19,8 @@ pelelmex_initdata( int k, int is_incompressible, amrex::Array4 const& state, - amrex::Array4 const& aux, - amrex::GeometryData const& geomdata, + amrex::Array4 const& /*aux*/, + amrex::GeometryData const& /*geomdata*/, ProbParm const& prob_parm, pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/) { @@ -50,8 +50,9 @@ pelelmex_initdata( , state(i, j, k, VELZ) = 0.0); state(i, j, k, VELX + prob_parm.meanFlowDir) = prob_parm.meanFlowMag; - if (is_incompressible) + if (is_incompressible != 0) { return; + } state(i, j, k, TEMP) = prob_parm.T_mean; @@ -78,11 +79,11 @@ AMREX_FORCE_INLINE void bcnormal( const amrex::Real x[AMREX_SPACEDIM], - const int m_nAux, + const int /*m_nAux*/, amrex::Real s_ext[NVAR], - const int idir, + const int /*idir*/, const int sgn, - const amrex::Real time, + const amrex::Real /*time*/, amrex::GeometryData const& geomdata, ProbParm const& prob_parm, pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/) @@ -104,7 +105,7 @@ bcnormal( // When using PELE_USE_TURBINFLOW, s_ext comes in with // turbulence data. Only add the mean flow here. - if (prob_parm.bothSides) { + if (prob_parm.bothSides != 0) { if (sgn == 1) { s_ext[prob_parm.meanFlowDir] += std::abs(prob_parm.meanFlowMag); } else { diff --git a/Source/PeleLMeX.H b/Source/PeleLMeX.H index 6fdcf094..c1b90bac 100644 --- a/Source/PeleLMeX.H +++ b/Source/PeleLMeX.H @@ -281,7 +281,7 @@ public: * using the data from a pltfile * \param a_pltFile path to PeleLMeX plot file */ - void initLevelDataFromPlt(int a_lev, const std::string& a_pltFile); + void initLevelDataFromPlt(int a_lev, const std::string& a_datPltFile); /** * \brief Project the initial solution velocity field, @@ -588,9 +588,9 @@ public: */ void addSoretTerm( const amrex::Vector>& - a_fluxes, + a_spfluxes, const amrex::Vector>& - a_soretfluxes, + a_spsoretfluxes, amrex::Vector const& a_spec, amrex::Vector const& a_temp, amrex::Vector const& a_beta); @@ -1019,7 +1019,7 @@ public: void fillpatch_density( int lev, amrex::Real a_time, - amrex::MultiFab& a_rhoY, + amrex::MultiFab& a_density, int rho_comp, int nGhost); void fillpatch_species( @@ -1300,7 +1300,7 @@ public: std::string compositionType, amrex::Real* massFrac); static void parseVars( - const amrex::Vector& a_varNames, + const amrex::Vector& a_varsNames, const amrex::Vector& a_stringIn, amrex::Vector& a_rVars); void initProgressVariable(); @@ -1338,8 +1338,8 @@ public: const amrex::Real& a_dt, amrex::MultiFab& a_tmpDiv, int div_comp, - amrex::MultiFab& a_AofS, - int aofs_comp, + amrex::MultiFab& a_diff, + int diff_comp, const amrex::MultiFab& a_state, int state_comp, int ncomp, diff --git a/Source/PeleLMeX.cpp b/Source/PeleLMeX.cpp index 958a7faa..a205b3e2 100644 --- a/Source/PeleLMeX.cpp +++ b/Source/PeleLMeX.cpp @@ -46,21 +46,20 @@ PeleLM::getLevelDataPtr( } if (a_time == AmrNewTime) { return m_leveldata_new[lev].get(); - } else { - m_leveldata_floating = std::make_unique( - grids[lev], dmap[lev], *m_factory[lev], m_incompressible, m_has_divu, - m_nAux, m_nGrowState, m_use_soret, static_cast(m_do_les)); - Real time = getTime(lev, a_time); - fillpatch_state(lev, time, m_leveldata_floating->state, m_nGrowState); - // if (useUMac) { - // // TODO: find a way to get U^{n+1/2} from Umac - // // For now get old time - // Real oldtime = getTime(lev,AmrOldTime); - // fillpatch_velocity(lev, oldtime, m_leveldata_floating->state, VELX, - // m_nGrowState); - // } - return m_leveldata_floating.get(); } + m_leveldata_floating = std::make_unique( + grids[lev], dmap[lev], *m_factory[lev], m_incompressible, m_has_divu, + m_nAux, m_nGrowState, m_use_soret, static_cast(m_do_les)); + Real time = getTime(lev, a_time); + fillpatch_state(lev, time, m_leveldata_floating->state, m_nGrowState); + // if (useUMac) { + // // TODO: find a way to get U^{n+1/2} from Umac + // // For now get old time + // Real oldtime = getTime(lev,AmrOldTime); + // fillpatch_velocity(lev, oldtime, m_leveldata_floating->state, VELX, + // m_nGrowState); + // } + return m_leveldata_floating.get(); } PeleLM::LevelDataReact* diff --git a/Source/PeleLMeX_DeriveFunc.cpp b/Source/PeleLMeX_DeriveFunc.cpp index e3ba07cc..ed30481b 100644 --- a/Source/PeleLMeX_DeriveFunc.cpp +++ b/Source/PeleLMeX_DeriveFunc.cpp @@ -602,7 +602,11 @@ pelelmex_dercoord( FArrayBox& derfab, int dcomp, int ncomp, - const FArrayBox& statefab, + const FArrayBox& +#ifdef AMREX_USE_EB + statefab +#endif + , const FArrayBox& /*reactfab*/, const FArrayBox& /*pressfab*/, const Geometry& geom, @@ -613,7 +617,6 @@ pelelmex_dercoord( { amrex::ignore_unused(ncomp); AMREX_ASSERT(derfab.box().contains(bx)); - AMREX_ASSERT(statefab.box().contains(bx)); AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp); AMREX_D_TERM(const amrex::Real dx = geom.CellSize(0); , const amrex::Real dy = geom.CellSize(1); @@ -623,6 +626,7 @@ pelelmex_dercoord( const auto geomdata = geom.data(); #ifdef AMREX_USE_EB + AMREX_ASSERT(statefab.box().contains(bx)); const EBFArrayBox& ebfab = static_cast(statefab); const EBCellFlagFab& flags = ebfab.getEBCellFlagFab(); @@ -666,9 +670,21 @@ pelelmex_dercoord( void pelelmex_derQcrit( PeleLM* /*a_pelelm*/, - const Box& bx, - FArrayBox& derfab, - int dcomp, + const Box& +#if AMREX_SPACEDIM == 3 + bx +#endif + , + FArrayBox& +#if AMREX_SPACEDIM == 3 + derfab +#endif + , + int +#if AMREX_SPACEDIM == 3 + dcomp +#endif + , int /*ncomp*/, const FArrayBox& #if AMREX_SPACEDIM == 3 @@ -677,7 +693,11 @@ pelelmex_derQcrit( , const FArrayBox& /*reactfab*/, const FArrayBox& /*pressfab*/, - const Geometry& geom, + const Geometry& +#if AMREX_SPACEDIM == 3 + geom +#endif + , Real /*time*/, const Vector& /*bcrec*/, int /*level*/) @@ -1235,6 +1255,7 @@ pelelmex_derprogvar( int /*level*/) { + amrex::ignore_unused(ncomp); AMREX_ASSERT(derfab.box().contains(bx)); AMREX_ASSERT(statefab.box().contains(bx)); AMREX_ASSERT(ncomp == 1); @@ -1291,6 +1312,7 @@ pelelmex_dervisc( const Vector& /*bcrec*/, int /*level*/) { + amrex::ignore_unused(ncomp); AMREX_ASSERT(derfab.box().contains(bx)); AMREX_ASSERT(statefab.box().contains(bx)); AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp); @@ -1328,6 +1350,7 @@ pelelmex_derdiffc( const Vector& /*bcrec*/, int /*level*/) { + amrex::ignore_unused(ncomp); AMREX_ASSERT(derfab.box().contains(bx)); AMREX_ASSERT(statefab.box().contains(bx)); AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp); @@ -1389,6 +1412,7 @@ pelelmex_derlambda( const Vector& /*bcrec*/, int /*level*/) { + amrex::ignore_unused(ncomp); AMREX_ASSERT(derfab.box().contains(bx)); AMREX_ASSERT(statefab.box().contains(bx)); AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp); diff --git a/Source/PeleLMeX_Diffusion.cpp b/Source/PeleLMeX_Diffusion.cpp index 47fe7a3c..bfe94af4 100644 --- a/Source/PeleLMeX_Diffusion.cpp +++ b/Source/PeleLMeX_Diffusion.cpp @@ -207,18 +207,18 @@ void PeleLM::computeDifferentialDiffusionFluxes( const TimeStamp& a_time, const Vector>& a_fluxes, - const Vector& a_EBfluxes, + const Vector& +#ifdef AMREX_USE_EB + a_EBfluxes +#else +/*unused*/ +#endif + , const Vector>& a_wbarfluxes, const Vector>& a_soretfluxes) { BL_PROFILE("PeleLMeX::computeDifferentialDiffusionFluxes()"); -#ifdef AMREX_USE_EB - int have_EBfluxes = (a_EBfluxes.empty()) ? 0 : 1; -#else - amrex::ignore_unused(a_EBfluxes); -#endif - //---------------------------------------------------------------- // Species fluxes // Get the species BCRec @@ -301,7 +301,7 @@ PeleLM::computeDifferentialDiffusionFluxes( do_avgDown = 0; #ifdef AMREX_USE_EB if (m_isothermalEB != 0) { - AMREX_ASSERT(have_EBfluxes); + AMREX_ASSERT(!a_EBfluxes.empty()); // Set up EB dirichlet value and diffusivity Vector EBvalue(finest_level + 1); Vector EBdiff(finest_level + 1); @@ -603,7 +603,7 @@ PeleLM::addSoretTerm( Ted_arr); }); - auto const& rhoY = rhoY_ed.const_array(0); + // auto const& rhoY = rhoY_ed.const_array(0); auto const& T = T_ed.const_array(0); auto const& gradT_ar = gradT[lev][idim].const_array(mfi); auto const& beta_ar = beta_ec[idim].const_array(mfi); @@ -617,17 +617,8 @@ PeleLM::addSoretTerm( // with beta_m = \rho (* Y?) * theta_m below amrex::ParallelFor( ebx, - [need_soret_fluxes, gradT_ar, beta_ar, rhoY, T, spFlux_ar, + [need_soret_fluxes, gradT_ar, beta_ar, T, spFlux_ar, spsoretFlux_ar] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { - amrex::Real rho = 0.0; - for (int n = 0; n < NUM_SPECIES; n++) { - rho += rhoY(i, j, k, n); - } - amrex::Real rho_inv = 1.0 / rho; - amrex::Real y[NUM_SPECIES] = {0.0}; - for (int n = 0; n < NUM_SPECIES; n++) { - y[n] = rhoY(i, j, k, n) * rho_inv; - } for (int n = 0; n < NUM_SPECIES; n++) { spFlux_ar(i, j, k, n) -= beta_ar(i, j, k, n) * gradT_ar(i, j, k) / T(i, j, k); diff --git a/Source/PeleLMeX_DiffusionOp.cpp b/Source/PeleLMeX_DiffusionOp.cpp index 62e29568..09cc1610 100644 --- a/Source/PeleLMeX_DiffusionOp.cpp +++ b/Source/PeleLMeX_DiffusionOp.cpp @@ -302,7 +302,7 @@ DiffusionOp::diffuse_scalar( Vector const& a_phi, int phi_comp, Vector const& a_phiEB, - int phiEB_comp, + int /*phiEB_comp*/, Vector const& a_rhs, int rhs_comp, Vector> const& a_flux, @@ -312,7 +312,7 @@ DiffusionOp::diffuse_scalar( Vector const& a_bcoeff, int bcoeff_comp, Vector const& a_bcoeffEB, - int bcoeffEB_comp, + int /*bcoeffEB_comp*/, Vector a_bcrec, int ncomp, int isPoissonSolve, @@ -825,8 +825,9 @@ DiffusionOp::computeDiffFluxes( } // Average down if requested - if (do_avgDown != 0) + if (do_avgDown != 0) { avgDownFluxes(a_flux, flux_comp, ncomp); + } } #endif diff --git a/Source/PeleLMeX_EB.cpp b/Source/PeleLMeX_EB.cpp index 2dae6236..4dbaca45 100644 --- a/Source/PeleLMeX_EB.cpp +++ b/Source/PeleLMeX_EB.cpp @@ -16,7 +16,7 @@ PeleLM::makeEBGeometry() { BL_PROFILE("PeleLMeX::makeEBGeometry()"); int max_coarsening_level = 100; - int req_coarsening_level = geom.size() - 1; + int req_coarsening_level = static_cast(geom.size()) - 1; // Read the geometry type and act accordingly ParmParse ppeb2("eb2"); @@ -466,8 +466,9 @@ PeleLM::getEBState( Array faceCentroid = ebfact.getFaceCent(); MFItInfo mfi_info; - if (Gpu::notInLaunchRegion()) + if (Gpu::notInLaunchRegion()) { mfi_info.EnableTiling().SetDynamic(true); + } #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) @@ -538,8 +539,9 @@ PeleLM::getEBDiff( auto ldata_p = getLevelDataPtr(a_lev, a_time); MFItInfo mfi_info; - if (Gpu::notInLaunchRegion()) + if (Gpu::notInLaunchRegion()) { mfi_info.EnableTiling().SetDynamic(true); + } #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) @@ -664,38 +666,36 @@ PeleLM::getRestartEBMaxLevel() { if (m_restart_chkfile.empty()) { return -1; - } else { - // Go and parse the line we need - std::string File(m_restart_chkfile + "/Header"); + } + // Go and parse the line we need + std::string File(m_restart_chkfile + "/Header"); - VisMF::IO_Buffer io_buffer(VisMF::GetIOBufferSize()); + VisMF::IO_Buffer io_buffer(VisMF::GetIOBufferSize()); - Vector fileCharPtr; - ParallelDescriptor::ReadAndBcastFile(File, fileCharPtr); - std::string fileCharPtrString(fileCharPtr.dataPtr()); - std::istringstream is(fileCharPtrString, std::istringstream::in); + Vector fileCharPtr; + ParallelDescriptor::ReadAndBcastFile(File, fileCharPtr); + std::string fileCharPtrString(fileCharPtr.dataPtr()); + std::istringstream is(fileCharPtrString, std::istringstream::in); - std::string line, word; + std::string line, word; - // Title line - std::getline(is, line); + // Title line + std::getline(is, line); - // Finest level - std::getline(is, line); + // Finest level + std::getline(is, line); - // Step count - std::getline(is, line); + // Step count + std::getline(is, line); - // Either what we're looking for or m_cur_time - std::getline(is, line); + // Either what we're looking for or m_cur_time + std::getline(is, line); - if (line.find('.') != std::string::npos) { - return -1; - } else { - int max_eb_rst = -1; - max_eb_rst = std::stoi(line); - return max_eb_rst; - } + if (line.find('.') != std::string::npos) { + return -1; } + int max_eb_rst = -1; + max_eb_rst = std::stoi(line); + return max_eb_rst; } #endif diff --git a/Source/PeleLMeX_Evolve.cpp b/Source/PeleLMeX_Evolve.cpp index 612f89a2..79b264d3 100644 --- a/Source/PeleLMeX_Evolve.cpp +++ b/Source/PeleLMeX_Evolve.cpp @@ -127,14 +127,11 @@ PeleLM::writePlotNow() const { bool write_now = false; - if (m_plot_int > 0 && (m_nstep % m_plot_int == 0)) { - write_now = true; - - } else if ( - m_plot_per_exact > 0.0 && - (std::abs(std::remainder(m_cur_time, m_plot_per_exact)) < 1.e-12)) { + if ( + (m_plot_int > 0 && (m_nstep % m_plot_int == 0)) || + (m_plot_per_exact > 0.0 && + (std::abs(std::remainder(m_cur_time, m_plot_per_exact)) < 1.e-12))) { write_now = true; - } else if (m_plot_per_approx > 0.0) { // Check to see if we've crossed a plot_per interval by comparing // the number of intervals that have elapsed for both the current diff --git a/Source/PeleLMeX_Init.cpp b/Source/PeleLMeX_Init.cpp index 6a3a3b27..b7454f08 100644 --- a/Source/PeleLMeX_Init.cpp +++ b/Source/PeleLMeX_Init.cpp @@ -39,7 +39,9 @@ PeleLM::MakeNewLevelFromScratch( Real vol = AMREX_D_TERM(dx[0], *dx[1], *dx[2]); amrex::Print() << " with " << ba.numPts() << " cells," << ba.size() << " boxes," - << " over " << ba.numPts() * vol / geom[0].ProbSize() * 100 + << " over " + << static_cast(ba.numPts()) * vol / + geom[0].ProbSize() * 100 << "% of the domain \n"; } if (m_verbose > 3 && lev > 0) { @@ -505,7 +507,7 @@ PeleLM::InitFromGridFile(amrex::Real time) DistributionMapping dm(ba); MakeNewLevelFromScratch(0, time, ba, dm); } - finest_level = m_initial_ba.size(); + finest_level = static_cast(m_initial_ba.size()); for (int lev = 1; lev <= finest_level; lev++) { const amrex::BoxArray ba = m_initial_ba[lev - 1]; DistributionMapping dm(ba); diff --git a/Source/PeleLMeX_Projection.cpp b/Source/PeleLMeX_Projection.cpp index 92be0c47..80f91810 100644 --- a/Source/PeleLMeX_Projection.cpp +++ b/Source/PeleLMeX_Projection.cpp @@ -380,19 +380,10 @@ PeleLM::doNodalProject( int incremental, Real scaling_factor) { - int has_rhs = 0; - int has_rhs_nd = 0; - if (!rhs_cc.empty()) { - has_rhs = 1; - } - if (!rhs_nd.empty()) { - has_rhs_nd = 1; - } - // Asserts AMREX_ASSERT(a_vel.size() == a_sigma.size()); - AMREX_ASSERT(!has_rhs || (a_vel.size() == rhs_cc.size())); - AMREX_ASSERT(!has_rhs_nd || (a_vel.size() == rhs_nd.size())); + AMREX_ASSERT(rhs_cc.empty() || (a_vel.size() == rhs_cc.size())); + AMREX_ASSERT(rhs_nd.empty() || (a_vel.size() == rhs_nd.size())); AMREX_ASSERT(a_vel[0]->nComp() == AMREX_SPACEDIM); LPInfo info; @@ -430,7 +421,7 @@ PeleLM::doNodalProject( nodal_projector = std::make_unique( a_vel, constant_sigma, Geom(0, finest_level), info); } else { - if (has_rhs != 0) { + if (!rhs_cc.empty()) { nodal_projector = std::make_unique( a_vel, GetVecOfConstPtrs(a_sigma), Geom(0, finest_level), info, rhs_cc, rhs_nd); diff --git a/Source/PeleLMeX_Regrid.cpp b/Source/PeleLMeX_Regrid.cpp index fe40c3d9..494bda87 100644 --- a/Source/PeleLMeX_Regrid.cpp +++ b/Source/PeleLMeX_Regrid.cpp @@ -307,7 +307,9 @@ PeleLM::MakeNewLevelFromCoarse( Real vol = AMREX_D_TERM(dx[0], *dx[1], *dx[2]); amrex::Print() << " with " << ba.numPts() << " cells, " << ba.size() << " boxes," - << " over " << ba.numPts() * vol / geom[0].ProbSize() * 100 + << " over " + << static_cast(ba.numPts()) * vol / + geom[0].ProbSize() * 100 << "% of the domain \n"; } if (m_verbose > 3) { @@ -416,7 +418,9 @@ PeleLM::RemakeLevel( Real vol = AMREX_D_TERM(dx[0], *dx[1], *dx[2]); amrex::Print() << " with " << ba.numPts() << " cells," << ba.size() << " boxes," - << " over " << ba.numPts() * vol / geom[0].ProbSize() * 100 + << " over " + << static_cast(ba.numPts()) * vol / + geom[0].ProbSize() * 100 << "% of the domain \n"; } if (m_verbose > 3) { @@ -546,14 +550,14 @@ PeleLM::computeCosts(int a_lev, LayoutData& a_costs, int a_costMethod) { if (a_costMethod == LoadBalanceCost::Ncell) { for (MFIter mfi(a_costs, false); mfi.isValid(); ++mfi) { - a_costs[mfi] = mfi.validbox().numPts(); + a_costs[mfi] = static_cast(mfi.validbox().numPts()); } } else if (a_costMethod == LoadBalanceCost::ChemFunctCallAvg) { MultiFab costMF(a_costs.boxArray(), a_costs.DistributionMap(), 1, 0); fillpatch_chemFunctCall(a_lev, m_cur_time, costMF, 0); for (MFIter mfi(costMF, false); mfi.isValid(); ++mfi) { a_costs[mfi] = costMF[mfi].sum(mfi.validbox(), 0) / - mfi.validbox().numPts(); + static_cast(mfi.validbox().numPts()); } } else if (a_costMethod == LoadBalanceCost::ChemFunctCallMax) { MultiFab costMF(a_costs.boxArray(), a_costs.DistributionMap(), 1, 0); @@ -575,7 +579,7 @@ PeleLM::computeCosts(int a_lev, LayoutData& a_costs, int a_costMethod) costMF.ParallelCopy(*mf, 0, 0, 1); for (MFIter mfi(costMF, false); mfi.isValid(); ++mfi) { a_costs[mfi] = costMF[mfi].sum(mfi.validbox(), 0) / - mfi.validbox().numPts(); + static_cast(mfi.validbox().numPts()); } } else if (a_costMethod == LoadBalanceCost::UserDefinedDerivedSum) { MultiFab costMF(a_costs.boxArray(), a_costs.DistributionMap(), 1, 0); @@ -624,7 +628,7 @@ PeleLM::resetMacProjector() void PeleLM::regridFromGridFile(int lbase, amrex::Real time, bool /*initial*/) { - int new_finest = m_regrid_ba.size(); + const int new_finest = static_cast(m_regrid_ba.size()); Vector new_grids(finest_level + 2); BL_ASSERT(new_finest <= finest_level + 1); diff --git a/Source/PeleLMeX_Setup.cpp b/Source/PeleLMeX_Setup.cpp index 7a2f393c..e237dc4a 100644 --- a/Source/PeleLMeX_Setup.cpp +++ b/Source/PeleLMeX_Setup.cpp @@ -949,8 +949,9 @@ PeleLM::derivedSetup() { Vector var_names = pelelmex_setuserderives(); derive_lst.add( - "derUserDefined", IndexType::TheCellType(), var_names.size(), var_names, - pelelmex_deruserdef, the_same_box); + "derUserDefined", IndexType::TheCellType(), + static_cast(var_names.size()), var_names, pelelmex_deruserdef, + the_same_box); } #if (AMREX_SPACEDIM == 3) @@ -1014,7 +1015,7 @@ PeleLM::derivedSetup() it++; } } - m_derivePlotVarCount = m_derivePlotVars.size(); + m_derivePlotVarCount = static_cast(m_derivePlotVars.size()); } void @@ -1147,8 +1148,8 @@ PeleLM::taggingSetup() if (ppr.countval("in_box_lo") != 0) { Vector box_lo(AMREX_SPACEDIM); Vector box_hi(AMREX_SPACEDIM); - ppr.getarr("in_box_lo", box_lo, 0, box_lo.size()); - ppr.getarr("in_box_hi", box_hi, 0, box_hi.size()); + ppr.getarr("in_box_lo", box_lo, 0, static_cast(box_lo.size())); + ppr.getarr("in_box_hi", box_hi, 0, static_cast(box_hi.size())); realbox = RealBox(box_lo.data(), box_hi.data()); } diff --git a/Source/PeleLMeX_Utils.cpp b/Source/PeleLMeX_Utils.cpp index 20d189a6..d2f58a7e 100644 --- a/Source/PeleLMeX_Utils.cpp +++ b/Source/PeleLMeX_Utils.cpp @@ -739,13 +739,14 @@ PeleLM::resetCoveredMask() bl.reserve(baUnCovered.size() + baf.size()); m_baChemFlag[lev].resize(baUnCovered.size() + baf.size()); int bxIdx = 0; - for (int i = 0, n = baUnCovered.size(); i < n; + for (int i = 0, n = static_cast(baUnCovered.size()); i < n; ++i) { // Append uncovered boxes bl.push_back(baUnCovered[i]); m_baChemFlag[lev][bxIdx] = 1; bxIdx += 1; } - for (int i = 0, n = baf.size(); i < n; ++i) { // Append covered boxes + for (int i = 0, n = static_cast(baf.size()); i < n; + ++i) { // Append covered boxes bl.push_back(baf[i]); m_baChemFlag[lev][bxIdx] = 0; bxIdx += 1; @@ -1089,7 +1090,7 @@ PeleLM::parseVars( const Vector& a_stringIn, Vector& a_rVars) { - int varCountIn = a_stringIn.size(); + const int varCountIn = static_cast(a_stringIn.size()); // For each entry in the user-provided composition, parse name and value std::string delimiter = ":"; @@ -1817,7 +1818,7 @@ PeleLM::parseComposition( // For each entry in the user-provided composition, parse name and value std::string delimiter = ":"; - int specCountIn = compositionIn.size(); + const int specCountIn = static_cast(compositionIn.size()); for (int i = 0; i < specCountIn; i++) { long unsigned sep = compositionIn[i].find(delimiter); if (sep == std::string::npos) { diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index 0086460e..375f084c 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit 0086460e20cfb12b62ded008634fbd8af80bef2e +Subproject commit 375f084cc8bffcf8f395eae2e91aa8e6f57a5b0c