diff --git a/Exec/RegTests/EnclosedInjection/pelelmex_prob.cpp b/Exec/RegTests/EnclosedInjection/pelelmex_prob.cpp index 9a606225..eec84112 100644 --- a/Exec/RegTests/EnclosedInjection/pelelmex_prob.cpp +++ b/Exec/RegTests/EnclosedInjection/pelelmex_prob.cpp @@ -2,7 +2,7 @@ #include void -PeleLM::readProbParm() +PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) { amrex::ParmParse pp("prob"); diff --git a/Exec/RegTests/HITDecay/pelelmex_prob.cpp b/Exec/RegTests/HITDecay/pelelmex_prob.cpp index 3c8ab660..c59539ec 100644 --- a/Exec/RegTests/HITDecay/pelelmex_prob.cpp +++ b/Exec/RegTests/HITDecay/pelelmex_prob.cpp @@ -97,7 +97,7 @@ read_csv( } void -PeleLM::readProbParm() +PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) { amrex::ParmParse pp("prob"); diff --git a/Exec/RegTests/HotBubble/pelelmex_prob.cpp b/Exec/RegTests/HotBubble/pelelmex_prob.cpp index 672ec98a..954c0210 100644 --- a/Exec/RegTests/HotBubble/pelelmex_prob.cpp +++ b/Exec/RegTests/HotBubble/pelelmex_prob.cpp @@ -2,7 +2,7 @@ #include void -PeleLM::readProbParm() +PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) { amrex::ParmParse pp("prob"); diff --git a/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp b/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp index 50c9d7fe..a5360276 100644 --- a/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp +++ b/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp @@ -2,7 +2,7 @@ #include void -PeleLM::readProbParm() +PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) { amrex::ParmParse pp("prob"); diff --git a/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp b/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp index 8e93818f..df98e8eb 100644 --- a/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp +++ b/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp @@ -2,7 +2,7 @@ #include void -PeleLM::readProbParm() +PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) { amrex::ParmParse pp("prob"); diff --git a/Exec/RegTests/TurbInflow/pelelmex_prob.cpp b/Exec/RegTests/TurbInflow/pelelmex_prob.cpp index c77bdfbe..7c7184e0 100644 --- a/Exec/RegTests/TurbInflow/pelelmex_prob.cpp +++ b/Exec/RegTests/TurbInflow/pelelmex_prob.cpp @@ -2,7 +2,7 @@ #include void -PeleLM::readProbParm() +PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) { amrex::ParmParse pp("prob"); diff --git a/Source/PeleLMeX.H b/Source/PeleLMeX.H index b3528b8d..c91d194d 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_datPltFile); + void initLevelDataFromPlt(int a_lev, const std::string& a_dataPltFile); /** * \brief Project the initial solution velocity field, @@ -570,9 +570,9 @@ public: */ void addWbarTerm( const amrex::Vector>& - a_fluxes, + a_spfluxes, const amrex::Vector>& - a_wbarfluxes, + a_spwbarfluxes, amrex::Vector const& a_spec, amrex::Vector const& a_rho, amrex::Vector const& a_beta); @@ -602,7 +602,7 @@ public: */ void adjustSpeciesFluxes( const amrex::Vector>& - a_fluxes, + a_spfluxes, amrex::Vector const& a_spec); /** @@ -987,7 +987,7 @@ public: //----------------------------------------------------------------------------- // BOUNDARY CONDITIONS / FILLPATCH - amrex::InterpBase* getInterpolator(int a_method = 1); + amrex::InterpBase* getInterpolator(int a_method = 1) const; // Interpolation method for regrid (default to cell cons interp) int m_regrid_interp_method = 1; @@ -1203,7 +1203,7 @@ public: int const* l_conserv_d, const amrex::Geometry& a_geom, amrex::Real scale, - bool fluxes_are_area_weighted); + bool fluxes_are_area_weighted) const; void extFluxDivergenceLevel( int lev, @@ -1312,7 +1312,7 @@ public: void makeEBGeometry(); - int getRestartEBMaxLevel(); + int getRestartEBMaxLevel() const; void initialRedistribution(); @@ -1331,7 +1331,7 @@ public: int state_comp, int ncomp, const amrex::BCRec* d_bc, - const amrex::Geometry& a_geom); + const amrex::Geometry& a_geom) const; void redistributeDiff( int a_lev, @@ -1344,9 +1344,9 @@ public: int state_comp, int ncomp, const amrex::BCRec* d_bc, - const amrex::Geometry& a_geom); + const amrex::Geometry& a_geom) const; - void getCoveredIMask(int a_lev, amrex::iMultiFab& a_imask); + void getCoveredIMask(int a_lev, amrex::iMultiFab& a_imask) const; void getEBDistance(int a_lev, amrex::MultiFab& a_signDistLev); diff --git a/Source/PeleLMeX_BC.cpp b/Source/PeleLMeX_BC.cpp index 14d5c462..0a389cde 100644 --- a/Source/PeleLMeX_BC.cpp +++ b/Source/PeleLMeX_BC.cpp @@ -49,9 +49,10 @@ int soot_bc[] = {INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, #endif InterpBase* -PeleLM::getInterpolator(int a_method) +PeleLM:: + getInterpolator( // NOLINT(readability-convert-member-functions-to-static) + int a_method) const { - InterpBase* mapper = nullptr; if (a_method == 0) { diff --git a/Source/PeleLMeX_DeriveFunc.cpp b/Source/PeleLMeX_DeriveFunc.cpp index 388040cd..d5c4411b 100644 --- a/Source/PeleLMeX_DeriveFunc.cpp +++ b/Source/PeleLMeX_DeriveFunc.cpp @@ -605,6 +605,8 @@ pelelmex_dercoord( const FArrayBox& #ifdef AMREX_USE_EB statefab +#else +/*unused*/ #endif , const FArrayBox& /*reactfab*/, @@ -613,7 +615,6 @@ pelelmex_dercoord( Real /*time*/, const Vector& /*bcrec*/, int /*level*/) - { amrex::ignore_unused(ncomp); AMREX_ASSERT(derfab.box().contains(bx)); diff --git a/Source/PeleLMeX_Diffusion.cpp b/Source/PeleLMeX_Diffusion.cpp index bfe94af4..aa9f8a19 100644 --- a/Source/PeleLMeX_Diffusion.cpp +++ b/Source/PeleLMeX_Diffusion.cpp @@ -53,7 +53,8 @@ PeleLM::computeDifferentialDiffusionTerms( if (a_time == AmrOldTime) { AMREX_ASSERT(diffData->Dn.size() == finest_level + 1); AMREX_ASSERT(diffData->Dn[0].nComp() >= NUM_SPECIES + 2); - } else { + } + if (a_time != AmrOldTime) { AMREX_ASSERT(diffData->Dnp1.size() == finest_level + 1); AMREX_ASSERT(diffData->Dnp1[0].nComp() >= NUM_SPECIES + 2); } diff --git a/Source/PeleLMeX_EB.cpp b/Source/PeleLMeX_EB.cpp index 9638f4cb..0b4ea178 100644 --- a/Source/PeleLMeX_EB.cpp +++ b/Source/PeleLMeX_EB.cpp @@ -67,7 +67,7 @@ PeleLM::redistributeAofS( int state_comp, int ncomp, const BCRec* d_bc, - const Geometry& a_geom) + const Geometry& a_geom) const { BL_PROFILE("PeleLMeX::redistributeAofS()"); AMREX_ASSERT(a_tmpDiv.nComp() >= div_comp + ncomp); @@ -137,7 +137,7 @@ PeleLM::redistributeAofS( } void -PeleLM::getCoveredIMask(int a_lev, iMultiFab& a_imask) +PeleLM::getCoveredIMask(int a_lev, iMultiFab& a_imask) const { const auto& ebfact = EBFactory(a_lev); const auto& flags = ebfact.getMultiEBCellFlagFab(); @@ -196,7 +196,7 @@ PeleLM::redistributeDiff( int state_comp, int ncomp, const BCRec* d_bc, - const Geometry& a_geom) + const Geometry& a_geom) const { BL_PROFILE("PeleLMeX::redistributeDiff()"); AMREX_ASSERT(a_tmpDiv.nComp() >= div_comp + ncomp); @@ -425,7 +425,7 @@ PeleLM::getEBDistance(int a_lev, MultiFab& a_signDistLev) // Get signDist on coarsen fineBA BoxArray coarsenBA(grids[lev].size()); - for (int j = 0, N = coarsenBA.size(); j < N; ++j) { + for (int j = 0, N = static_cast(coarsenBA.size()); j < N; ++j) { coarsenBA.set( j, interpolater.CoarseBox(grids[lev][j], refRatio(lev - 1))); } @@ -609,17 +609,12 @@ PeleLM::correct_vel_small_cells( , const auto& wmac_fab = (a_umac[lev][2])->const_array(mfi);); - if (flags.getType(amrex::grow(bx, 0)) == FabType::covered) { - // do nothing - } - // No cut cells in this FAB - else if (flags.getType(amrex::grow(bx, 1)) == FabType::regular) { + if ( + (flags.getType(amrex::grow(bx, 0)) == FabType::covered) || + (flags.getType(amrex::grow(bx, 1)) == FabType::regular)) { // do nothing - } - - // Cut cells in this FAB - else { + } else { // Cut cells in this FAB // Face-centered areas AMREX_D_TERM(const auto& apx_fab = EBFactory(lev).getAreaFrac()[0]->const_array(mfi); @@ -662,7 +657,7 @@ PeleLM::correct_vel_small_cells( } int -PeleLM::getRestartEBMaxLevel() +PeleLM::getRestartEBMaxLevel() const { if (m_restart_chkfile.empty()) { return -1; diff --git a/Source/PeleLMeX_Evolve.cpp b/Source/PeleLMeX_Evolve.cpp index 79b264d3..575577ad 100644 --- a/Source/PeleLMeX_Evolve.cpp +++ b/Source/PeleLMeX_Evolve.cpp @@ -240,8 +240,8 @@ PeleLM::checkMessage(const std::string& a_action) const if (m_nstep % m_message_int == 0) { int action_flag = 0; if (ParallelDescriptor::IOProcessor()) { - FILE* fp; - if ((fp = fopen(action_file.c_str(), "r")) != nullptr) { + FILE* fp = fopen(action_file.c_str(), "r"); + if (fp != nullptr) { remove(action_file.c_str()); action_flag = 1; fclose(fp); diff --git a/Source/PeleLMeX_Projection.cpp b/Source/PeleLMeX_Projection.cpp index 80f91810..2dce4ac8 100644 --- a/Source/PeleLMeX_Projection.cpp +++ b/Source/PeleLMeX_Projection.cpp @@ -500,7 +500,9 @@ PeleLM::doNodalProject( } void -PeleLM::scaleProj_RZ(int a_lev, MultiFab& a_mf) +PeleLM::scaleProj_RZ( // NOLINT(readability-convert-member-functions-to-static) + int a_lev, + MultiFab& a_mf) { #if AMREX_SPACEDIM == 2 // Scale nodal projection cell-centered mfs by radius @@ -540,7 +542,10 @@ PeleLM::scaleProj_RZ(int a_lev, MultiFab& a_mf) } void -PeleLM::unscaleProj_RZ(int a_lev, MultiFab& a_mf) +PeleLM:: + unscaleProj_RZ( // NOLINT(readability-convert-member-functions-to-static) + int a_lev, + MultiFab& a_mf) { #if AMREX_SPACEDIM == 2 // Unscale nodal projection cell-centered mfs by radius diff --git a/Source/PeleLMeX_Utils.cpp b/Source/PeleLMeX_Utils.cpp index c5203906..bbda2552 100644 --- a/Source/PeleLMeX_Utils.cpp +++ b/Source/PeleLMeX_Utils.cpp @@ -500,20 +500,21 @@ PeleLM::intFluxDivergenceLevelEB( } void -PeleLM::advFluxDivergence( - int a_lev, - MultiFab& a_divergence, - int div_comp, - MultiFab& a_divu, - const Array& a_fluxes, - int flux_comp, - const Array& a_faceState, - int face_comp, - int ncomp, - int const* l_conserv_d, - const Geometry& a_geom, - amrex::Real scale, - bool fluxes_are_area_weighted) +PeleLM:: + advFluxDivergence( // NOLINT(readability-convert-member-functions-to-static) + int a_lev, + MultiFab& a_divergence, + int div_comp, + MultiFab& a_divu, + const Array& a_fluxes, + int flux_comp, + const Array& a_faceState, + int face_comp, + int ncomp, + int const* l_conserv_d, + const Geometry& a_geom, + amrex::Real scale, + bool fluxes_are_area_weighted) const { BL_PROFILE("PeleLMeX::advFluxDivergence()");