diff --git a/.clang-tidy b/.clang-tidy index 490121ee0..51aa7a3d0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -28,6 +28,7 @@ Checks: > -modernize-use-using, performance-*, -performance-avoid-endl, + -performance-enum-size, portability-*, readability-*, -readability-avoid-const-params-in-decls, diff --git a/Exec/science/xrb_layered/MaestroInitData.cpp b/Exec/science/xrb_layered/MaestroInitData.cpp index 8f55a2af2..80cf8205d 100644 --- a/Exec/science/xrb_layered/MaestroInitData.cpp +++ b/Exec/science/xrb_layered/MaestroInitData.cpp @@ -39,17 +39,17 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con if (perturb_model) { const auto xcen = center[0]; - const auto ycen = AMREX_SPACEDIM == 2 ? xrb_pert_height : center[1]; + const auto ycen = AMREX_SPACEDIM == 2 ? problem_rp::xrb_pert_height : center[1]; #if AMREX_SPACEDIM == 3 - const auto zcen = xrb_pert_height; + const auto zcen = problem_rp::xrb_pert_height; #endif const auto rad_pert = - -xrb_pert_size * xrb_pert_size / (4.0 * std::log(0.5)); + -problem_rp::xrb_pert_size * problem_rp::xrb_pert_size / (4.0 * std::log(0.5)); - const bool perturb_temp_true = xrb_pert_type == 1; + const bool perturb_temp_true = problem_rp::xrb_pert_type == 1; - const auto xrb_pert_factor_loc = xrb_pert_factor; + const auto xrb_pert_factor_loc = problem_rp::xrb_pert_factor; const auto rad_pert_loc = rad_pert; ParallelFor(tileBox, [=] (int i, int j, int k) { @@ -105,17 +105,17 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con }); } - if (apply_vel_field) { - const auto velpert_amplitude_loc = velpert_amplitude; - const auto velpert_scale_loc = velpert_scale; - const auto num_vortices_loc = num_vortices; - const auto velpert_height = velpert_height_loc; + if (problem_rp::apply_vel_field) { + const auto velpert_amplitude_loc = problem_rp::velpert_amplitude; + const auto velpert_scale_loc = problem_rp::velpert_scale; + const auto num_vortices_loc = problem_rp::num_vortices; + const auto velpert_height = problem_rp::velpert_height_loc; - const Real offset = (prob_hi[0] - prob_lo[0]) / (num_vortices); + const Real offset = (prob_hi[0] - prob_lo[0]) / (problem_rp::num_vortices); // vortex x-coords - RealVector vortices_xloc(num_vortices); - for (auto i = 0; i < num_vortices; ++i) { + RealVector vortices_xloc(problem_rp::num_vortices); + for (auto i = 0; i < problem_rp::num_vortices; ++i) { vortices_xloc[i] = (static_cast(i) + 0.5_rt) * offset; } @@ -156,8 +156,8 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con } } -void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, - MultiFab& vel) { +void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, // NOLINT(readability-convert-member-functions-to-static) + MultiFab& vel) { amrex::ignore_unused(lev); amrex::ignore_unused(time); diff --git a/Exec/science/xrb_layered/MaestroSponge.cpp b/Exec/science/xrb_layered/MaestroSponge.cpp index 8e239cd19..8e372b09a 100644 --- a/Exec/science/xrb_layered/MaestroSponge.cpp +++ b/Exec/science/xrb_layered/MaestroSponge.cpp @@ -60,7 +60,7 @@ void Maestro::SpongeInit(const BaseState& rho0_s) { } if (maestro_verbose >= 1) { - if (xrb_use_bottom_sponge) { + if (problem_rp::xrb_use_bottom_sponge) { Print() << "inner sponge: r_sp , r_tp : " << r_sp << ", " << r_tp << std::endl; } @@ -78,7 +78,7 @@ void Maestro::MakeSponge(Vector& sponge) { const Real botsponge_hi_r = r_tp; const Real topsponge_lo_r = r_sp_outer; const Real topsponge_hi_r = r_tp_outer; - const Real sponge_min_loc = sponge_min; + const Real sponge_min_loc = problem_rp::sponge_min; if (AMREX_SPACEDIM != 2) { Abort("ERROR: sponge only supported for 2d in xrb_mixed"); @@ -105,7 +105,7 @@ void Maestro::MakeSponge(Vector& sponge) { ParallelFor(tileBox, [=] (int i, int j, int k) { sponge_arr(i, j, k) = 1.0; }); - if (xrb_use_bottom_sponge) { + if (problem_rp::xrb_use_bottom_sponge) { // do both the top and bottom sponges diff --git a/Source/Maestro.H b/Source/Maestro.H index 30e36392a..f7fe00f0b 100644 --- a/Source/Maestro.H +++ b/Source/Maestro.H @@ -410,7 +410,7 @@ class Maestro : public amrex::AmrCore { /// Write a checkpoint at timestep `step` void WriteCheckPoint(int step); int ReadCheckPoint(); - void GotoNextLine(std::istream& is); + static void GotoNextLine(std::istream& is); // end MaestroCheckpoint.cpp functions //////////// @@ -460,10 +460,10 @@ class Maestro : public amrex::AmrCore { // MaestroDebug.cpp functions /// Print out the contents of the base state - void PrintBase(const RealVector& base, const bool is_cell_centered = true); + void PrintBase(const RealVector& base, const bool is_cell_centered = true) const; void PrintBase(const BaseState& base, - const bool is_cell_centered = true); + const bool is_cell_centered = true) const; /// Print out the contents of a Vector of MultiFabs void PrintMF(const amrex::Vector& MF); @@ -544,7 +544,7 @@ class Maestro : public amrex::AmrCore { void EnforceHSE(const BaseState& rho0_s, BaseState& p0_s, - const BaseState& grav_cell_s); + const BaseState& grav_cell_s) const; // end MaestroEnforceHSE.cpp functions //////////////////////// @@ -617,7 +617,7 @@ class Maestro : public amrex::AmrCore { void GetData(int lev, amrex::Real time, amrex::Vector& mf, amrex::Vector& mftime, amrex::Vector& mf_old, - amrex::Vector& mf_new); + amrex::Vector& mf_new) const; /// Set covered coarse cells to be the average of overlying fine cells /// @@ -803,12 +803,12 @@ class Maestro : public amrex::AmrCore { //////////// // MaestroInitData.cpp functions - void InitLevelData(const int lev, const amrex::Real time, + void InitLevelData(const int lev, const amrex::Real time, // NOLINT(readability-convert-member-functions-to-static) const amrex::MFIter& mfi, const amrex::Array4 scal, const amrex::Array4 vel); - void InitLevelDataSphr(const int lev, const amrex::Real time, + void InitLevelDataSphr(const int lev, const amrex::Real time, // NOLINT(readability-convert-member-functions-to-static) amrex::MultiFab& scal, amrex::MultiFab& vel); // end MaestroInitData.cpp functions @@ -1048,7 +1048,7 @@ class Maestro : public amrex::AmrCore { // MaestroMakeEdgeState.cpp functions void MakeEdgeState1d(BaseState& s, BaseState& sedge, - BaseState& force); + BaseState& force) const; void MakeEdgeState1dSphr(BaseState& s_state, BaseState& sedge_state, @@ -1091,10 +1091,10 @@ class Maestro : public amrex::AmrCore { // MaestroMakeGrav.cpp functions void MakeGravCell(BaseState& grav_cell, - const BaseState& rho0_s); + const BaseState& rho0_s) const; void MakeGravEdge(BaseState& grav_edge_state, - const BaseState& rho0_state); + const BaseState& rho0_state) const; // end MaestroMakeGrav.cpp functions //////////// @@ -1241,9 +1241,9 @@ class Maestro : public amrex::AmrCore { const BaseState& p0_minus_peosbar, const amrex::Real dt_in, const amrex::Real dtold_in); - void Tridiag(const BaseStateArray& a, const BaseStateArray& b, - const BaseStateArray& c, const BaseStateArray& r, - const BaseStateArray& u, const int n); + static void Tridiag(const BaseStateArray& a, const BaseStateArray& b, + const BaseStateArray& c, const BaseStateArray& r, + const BaseStateArray& u, const int n); void ProlongBasetoUniform(const BaseState& base_ml_s, BaseState& base_fine_s) const; @@ -1284,7 +1284,7 @@ class Maestro : public amrex::AmrCore { // MaestroPlot.cpp functions /// Get plotfile name - void PlotFileName(const int lev, std::string* plotfilename); + static void PlotFileName(const int lev, std::string* plotfilename); /// Put together an array of multifabs for writing amrex::Vector PlotFileMF( @@ -1306,11 +1306,11 @@ class Maestro : public amrex::AmrCore { const amrex::Vector& small_plot_varnames); /// Set plotfile variables names - amrex::Vector PlotFileVarNames(int* nPlot) const; + static amrex::Vector PlotFileVarNames(int* nPlot); /// Set small plotfile variables names - amrex::Vector SmallPlotFileVarNames( - int* nPlot, amrex::Vector varnames) const; + static amrex::Vector SmallPlotFileVarNames( + int* nPlot, amrex::Vector varnames); /// Write a small plotfile to disk void WriteSmallPlotFile(const int step, const amrex::Real t_in, @@ -1556,13 +1556,13 @@ class Maestro : public amrex::AmrCore { //////////// // MaestroSetup.cpp functions - void ExternInit(); + static void ExternInit(); /// Read in C++ parameters from inputs file void ReadParameters(); /// Define variable mappings (`Rho`, `RhoH`, ..., `Nscal`, etc.) - void VariableSetup(); + static void VariableSetup(); /// Set up `BCRec` definitions for BC types void BCSetup(); @@ -1572,23 +1572,23 @@ class Maestro : public amrex::AmrCore { //////////// // MaestroSlopes.cpp function - void Slopex(const amrex::Box& bx, amrex::Array4 const s, - amrex::Array4 const slx, - const amrex::Box& domainBox, - const amrex::Vector& bcs, int ncomp, - int bc_start_comp); - - void Slopey(const amrex::Box& bx, amrex::Array4 const s, - amrex::Array4 const sly, - const amrex::Box& domainBox, - const amrex::Vector& bcs, int ncomp, - int bc_start_comp); + static void Slopex(const amrex::Box& bx, amrex::Array4 const s, + amrex::Array4 const slx, + const amrex::Box& domainBox, + const amrex::Vector& bcs, int ncomp, + int bc_start_comp); + + static void Slopey(const amrex::Box& bx, amrex::Array4 const s, + amrex::Array4 const sly, + const amrex::Box& domainBox, + const amrex::Vector& bcs, int ncomp, + int bc_start_comp); #if (AMREX_SPACEDIM == 3) - void Slopez(const amrex::Box& bx, amrex::Array4 const s, - amrex::Array4 const slz, - const amrex::Box& domainBox, - const amrex::Vector& bcs, int ncomp, - int bc_start_comp); + static void Slopez(const amrex::Box& bx, amrex::Array4 const s, + amrex::Array4 const slz, + const amrex::Box& domainBox, + const amrex::Vector& bcs, int ncomp, + int bc_start_comp); #endif //////////// diff --git a/Source/MaestroConvert.cpp b/Source/MaestroConvert.cpp index c9ec61005..9cfa0ed41 100644 --- a/Source/MaestroConvert.cpp +++ b/Source/MaestroConvert.cpp @@ -30,7 +30,7 @@ void Maestro::PutInPertForm(Vector& scal, const BaseState& s0, } AverageDown(scal, comp, 1); - FillPatch(t_old, scal, scal, scal, comp, comp, 1, bccomp, bcs); + FillPatch(t_old, scal, scal, scal, comp, comp, 1, bccomp, bcs); // NOLINT(readability-suspicious-call-argument) } void Maestro::PutInPertForm(int level, Vector& scal, @@ -58,8 +58,7 @@ void Maestro::PutInPertForm(int level, Vector& scal, comp, 1, refRatio(level - 1)); } - FillPatch(level, t_old, scal[level], scal, scal, comp, comp, 1, bccomp, - bcs); + FillPatch(level, t_old, scal[level], scal, scal, comp, comp, 1, bccomp, bcs); // NOLINT(readability-suspicious-call-argument) } void Maestro::ConvertRhoXToX(Vector& scal, bool flag) { diff --git a/Source/MaestroDebug.cpp b/Source/MaestroDebug.cpp index 1df025f9b..28aa262a9 100644 --- a/Source/MaestroDebug.cpp +++ b/Source/MaestroDebug.cpp @@ -3,7 +3,7 @@ using namespace amrex; -void Maestro::PrintBase(const RealVector& base, const bool is_cell_centered) { +void Maestro::PrintBase(const RealVector& base, const bool is_cell_centered) const { // timer for profiling BL_PROFILE_VAR("Maestro::PrintBase()", PrintBase); @@ -23,7 +23,7 @@ void Maestro::PrintBase(const RealVector& base, const bool is_cell_centered) { } void Maestro::PrintBase(const BaseState& base_s, - const bool is_cell_centered) { + const bool is_cell_centered) const { // timer for profiling BL_PROFILE_VAR("Maestro::PrintBase()", PrintBase); diff --git a/Source/MaestroDiag.cpp b/Source/MaestroDiag.cpp index 7e925bf93..28d648b0a 100644 --- a/Source/MaestroDiag.cpp +++ b/Source/MaestroDiag.cpp @@ -63,11 +63,9 @@ void Maestro::DiagFile(const int step, const Real t_in, } if (dt < small_dt) { - React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, small_dt, - t_in); + React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, small_dt, t_in); // NOLINT(readability-suspicious-call-argument) } else { - React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, dt * 0.5, - t_in); + React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, dt * 0.5, t_in); } // initialize diagnosis variables diff --git a/Source/MaestroEnforceHSE.cpp b/Source/MaestroEnforceHSE.cpp index c6e0b20d8..0da765d16 100644 --- a/Source/MaestroEnforceHSE.cpp +++ b/Source/MaestroEnforceHSE.cpp @@ -3,7 +3,7 @@ using namespace amrex; void Maestro::EnforceHSE(const BaseState& rho0_s, BaseState& p0_s, - const BaseState& grav_cell_s) { + const BaseState& grav_cell_s) const { // timer for profiling BL_PROFILE_VAR("Maestro::EnforceHSE()", EnforceHSE); diff --git a/Source/MaestroEnthalpyAdvance.cpp b/Source/MaestroEnthalpyAdvance.cpp index 5dd33e15f..46142a8ac 100644 --- a/Source/MaestroEnthalpyAdvance.cpp +++ b/Source/MaestroEnthalpyAdvance.cpp @@ -226,7 +226,7 @@ void Maestro::EnthalpyAdvance( #endif // compute enthalpy fluxes - MakeRhoHFlux(scalold, sflux, sedge, umac, w0mac, rho0_old, + MakeRhoHFlux(scalold, sflux, sedge, umac, w0mac, rho0_old, // NOLINT(readability-suspicious-call-argument) rho0_edge_old, rho0mac_old, rho0_old, rho0_edge_old, rho0mac_old, rhoh0_old, rhoh0_edge_old, rhoh0mac_old, rhoh0_old, rhoh0_edge_old, rhoh0mac_old, h0mac_old, diff --git a/Source/MaestroFillData.cpp b/Source/MaestroFillData.cpp index 6fee20e2d..01e461a04 100644 --- a/Source/MaestroFillData.cpp +++ b/Source/MaestroFillData.cpp @@ -118,7 +118,7 @@ void Maestro::FillCoarsePatch(int lev, Real time, MultiFab& mf, // subcycle I'm not sure if we need this capability? void Maestro::GetData(int lev, Real time, Vector& mf, Vector& mftime, Vector& mf_old, - Vector& mf_new) { + Vector& mf_new) const { // timer for profiling BL_PROFILE_VAR("Maestro::GetData()", GetData); @@ -220,7 +220,7 @@ void Maestro::FillUmacGhost( ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) { // lo x-faces if (i == domlo[0] - 1) { - switch (physbc_p[0]) { + switch (physbc_p[0]) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: umac(i, j, k) = umac(i + 1, j, k); vmac(i, j, k) = 0.0; @@ -258,7 +258,7 @@ void Maestro::FillUmacGhost( // hi x-faces if (i == domhi[0] + 2) { - switch (physbc_p[AMREX_SPACEDIM]) { + switch (physbc_p[AMREX_SPACEDIM]) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: umac(i, j, k) = umac(i - 1, j, k); vmac(i - 1, j, k) = 0.0; @@ -300,7 +300,7 @@ void Maestro::FillUmacGhost( ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) { // lo y-faces if (j == domlo[1] - 1) { - switch (physbc_p[1]) { + switch (physbc_p[1]) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: umac(i, j, k) = 0.0; vmac(i, j, k) = vmac(i, j + 1, k); @@ -338,7 +338,7 @@ void Maestro::FillUmacGhost( // hi y-faces if (j == domhi[1] + 2) { - switch (physbc_p[AMREX_SPACEDIM + 1]) { + switch (physbc_p[AMREX_SPACEDIM + 1]) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: umac(i, j - 1, k) = 0.0; vmac(i, j, k) = vmac(i, j - 1, k); @@ -382,7 +382,7 @@ void Maestro::FillUmacGhost( ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) { // lo z-faces if (k == domlo[2] - 1) { - switch (physbc_p[2]) { + switch (physbc_p[2]) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: umac(i, j, k) = 0.0; vmac(i, j, k) = 0.0; @@ -412,7 +412,7 @@ void Maestro::FillUmacGhost( // hi z-faces if (k == domhi[2] + 2) { - switch (physbc_p[2 + AMREX_SPACEDIM]) { + switch (physbc_p[2 + AMREX_SPACEDIM]) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: umac(i, j, k - 1) = 0.0; vmac(i, j, k - 1) = 0.0; @@ -488,7 +488,7 @@ void Maestro::FillPatchUedge( fine_src_ba.surroundingNodes(dir); // number of boxes and weights used for KnapSack distribution - const int N = fine_src_ba.size(); + const int N = static_cast(fine_src_ba.size()); std::vector wgts(N); #ifdef _OPENMP diff --git a/Source/MaestroForce.cpp b/Source/MaestroForce.cpp index 74b410050..f66d190e1 100644 --- a/Source/MaestroForce.cpp +++ b/Source/MaestroForce.cpp @@ -128,9 +128,7 @@ void Maestro::MakeVelForce( if (do_add_utilde_force) { #if (AMREX_SPACEDIM == 2) - if (j <= -1) { - // do not modify force since dw0/dr=0 - } else if (j >= domhi) { + if (j <= -1 || j >= domhi) { // do not modify force since dw0/dr=0 } else { vel_force(i, j, k, 1) -= @@ -139,12 +137,13 @@ void Maestro::MakeVelForce( (2.0 * dx[1]); } #else - if (k <= -1) { - // do not modify force since dw0/dr=0 - } else if (k >= domhi) { + if (k <= -1 || k >= domhi) { // do not modify force since dw0/dr=0 } else { - vel_force(i,j,k,2) -= (wedge(i,j,k+1)+wedge(i,j,k))*(w0_arr(i,j,k+1,2)-w0_arr(i,j,k,2)) / (2.0*dx[2]); + vel_force(i,j,k,2) -= + (wedge(i,j,k+1) + wedge(i,j,k)) * + (w0_arr(i,j,k+1,2) - w0_arr(i,j,k,2)) / + (2.0*dx[2]); } #endif } diff --git a/Source/MaestroInletBCs.cpp b/Source/MaestroInletBCs.cpp index 9142ca541..f36a5eb23 100644 --- a/Source/MaestroInletBCs.cpp +++ b/Source/MaestroInletBCs.cpp @@ -14,7 +14,7 @@ outline. // Inlet BCs defined in header file should go here -void Maestro::SetInletBCs() { +void Maestro::SetInletBCs() { // NOLINT(readability-convert-member-functions-to-static) // timer for profiling BL_PROFILE_VAR("Maestro::SetInletBCs()", SetInletBCs); diff --git a/Source/MaestroMakeEdgeState.cpp b/Source/MaestroMakeEdgeState.cpp index 6be98e2f3..4caa4c17a 100644 --- a/Source/MaestroMakeEdgeState.cpp +++ b/Source/MaestroMakeEdgeState.cpp @@ -3,7 +3,7 @@ using namespace amrex; void Maestro::MakeEdgeState1d(BaseState& s, BaseState& sedge, - BaseState& force) { + BaseState& force) const { // timer for profiling BL_PROFILE_VAR("Maestro::MakeEdgeState1d()", MakeEdgeState1d); diff --git a/Source/MaestroMakeGrav.cpp b/Source/MaestroMakeGrav.cpp index 32e1ed55a..3ee0d2cca 100644 --- a/Source/MaestroMakeGrav.cpp +++ b/Source/MaestroMakeGrav.cpp @@ -3,7 +3,7 @@ using namespace amrex; void Maestro::MakeGravCell(BaseState& grav_cell, - const BaseState& rho0_s) { + const BaseState& rho0_s) const { // timer for profiling BL_PROFILE_VAR("Maestro::MakeGravCell()", MakeGravCell); @@ -205,7 +205,7 @@ void Maestro::MakeGravCell(BaseState& grav_cell, } void Maestro::MakeGravEdge(BaseState& grav_edge_state, - const BaseState& rho0_state) { + const BaseState& rho0_state) const { // timer for profiling BL_PROFILE_VAR("Maestro::MakeGravEdge()", MakeGravEdge); diff --git a/Source/MaestroMakeUtrans.cpp b/Source/MaestroMakeUtrans.cpp index 61465adc6..d5fd4e65b 100644 --- a/Source/MaestroMakeUtrans.cpp +++ b/Source/MaestroMakeUtrans.cpp @@ -108,7 +108,7 @@ void Maestro::MakeUtrans( // impose lo i side bc's if (i == domlo[0]) { - switch (bclo) { + switch (bclo) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: ulx = utilde_arr(i - 1, j, k, 0); urx = utilde_arr(i - 1, j, k, 0); @@ -129,7 +129,7 @@ void Maestro::MakeUtrans( // impose hi i side bc's } else if (i == domhi[0] + 1) { - switch (bchi) { + switch (bchi) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: ulx = utilde_arr(i, j, k, 0); urx = utilde_arr(i, j, k, 0); @@ -209,7 +209,7 @@ void Maestro::MakeUtrans( // impose lo side bc's if (j == domlo[1]) { - switch (bclo) { + switch (bclo) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: vly = utilde_arr(i, j - 1, k, 1); vry = utilde_arr(i, j - 1, k, 1); @@ -230,7 +230,7 @@ void Maestro::MakeUtrans( // impose hi side bc's } else if (j == domhi[1] + 1) { - switch (bchi) { + switch (bchi) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: vly = utilde_arr(i, j, k, 1); vry = utilde_arr(i, j, k, 1); @@ -324,7 +324,7 @@ void Maestro::MakeUtrans( // impose lo side bc's if (i == domlo[0]) { - switch (bclo) { + switch (bclo) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: ulx = utilde_arr(i - 1, j, k, 0); urx = utilde_arr(i - 1, j, k, 0); @@ -345,7 +345,7 @@ void Maestro::MakeUtrans( // impose hi side bc's } else if (i == domhi[0] + 1) { - switch (bchi) { + switch (bchi) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: ulx = utilde_arr(i + 1, j, k, 0); urx = utilde_arr(i + 1, j, k, 0); @@ -440,7 +440,7 @@ void Maestro::MakeUtrans( // impose lo side bc's if (j == domlo[1]) { - switch (bclo) { + switch (bclo) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: vly = utilde_arr(i, j - 1, k, 1); vry = utilde_arr(i, j - 1, k, 1); @@ -555,7 +555,7 @@ void Maestro::MakeUtrans( // impose lo side bc's if (k == domlo[2]) { - switch (bclo) { + switch (bclo) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: wlz = utilde_arr(i, j, k - 1, 2); wrz = utilde_arr(i, j, k - 1, 2); @@ -576,7 +576,7 @@ void Maestro::MakeUtrans( // impose hi side bc's } else if (k == domhi[2] + 1) { - switch (bchi) { + switch (bchi) { // NOLINT(bugprone-switch-missing-default-case) case amrex::PhysBCType::inflow: wlz = utilde_arr(i, j, k + 1, 2); wrz = utilde_arr(i, j, k + 1, 2); diff --git a/Source/MaestroPlot.cpp b/Source/MaestroPlot.cpp index 6c7f1ba65..2e6416564 100644 --- a/Source/MaestroPlot.cpp +++ b/Source/MaestroPlot.cpp @@ -358,11 +358,9 @@ Vector Maestro::PlotFileMF( } if (dt_in < small_dt) { - React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, small_dt, - t_in); + React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, small_dt, t_in); // NOLINT(readability-suspicious-call-argument) } else { - React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, dt_in * 0.5, - t_in); + React(s_in, stemp, rho_Hext, rho_omegadot, rho_Hnuc, p0_in, dt_in * 0.5, t_in); } if (plot_spec || plot_omegadot) { @@ -760,7 +758,7 @@ Vector Maestro::SmallPlotFileMF( } // set plotfile variable names -Vector Maestro::PlotFileVarNames(int* nPlot) const { +Vector Maestro::PlotFileVarNames(int* nPlot) { // timer for profiling BL_PROFILE_VAR("Maestro::PlotFileVarNames()", PlotFileVarNames); @@ -829,7 +827,7 @@ Vector Maestro::PlotFileVarNames(int* nPlot) const { // add velocities for (int i = 0; i < AMREX_SPACEDIM; ++i) { std::string x = "vel"; - x += (120 + i); + x += (static_cast(120 + i)); names[cnt++] = x; } @@ -891,7 +889,7 @@ Vector Maestro::PlotFileVarNames(int* nPlot) const { // add gpi for (int i = 0; i < AMREX_SPACEDIM; ++i) { std::string x = "gpi"; - x += (120 + i); + x += (static_cast(120 + i)); names[cnt++] = x; } } @@ -932,7 +930,7 @@ Vector Maestro::PlotFileVarNames(int* nPlot) const { // w0 and divw0 for (int i = 0; i < AMREX_SPACEDIM; ++i) { std::string x = "w0"; - x += (120 + i); + x += (static_cast(120 + i)); names[cnt++] = x; } names[cnt++] = "divw0"; @@ -959,7 +957,7 @@ Vector Maestro::PlotFileVarNames(int* nPlot) const { // set plotfile variable names Vector Maestro::SmallPlotFileVarNames( - int* nPlot, Vector varnames) const { + int* nPlot, Vector varnames) { // timer for profiling BL_PROFILE_VAR("Maestro::SmallPlotFileVarNames()", SmallPlotFileVarNames); @@ -1023,7 +1021,7 @@ Vector Maestro::SmallPlotFileVarNames( } names.shrink_to_fit(); - *nPlot = names.size(); + *nPlot = static_cast(names.size()); return names; } @@ -1238,8 +1236,6 @@ void Maestro::WriteJobInfo(const std::string& dir) const { void Maestro::WriteBuildInfo() { std::string PrettyLine = std::string(78, '=') + "\n"; - std::string OtherLine = std::string(78, '-') + "\n"; - std::string SkipSpace = std::string(8, ' '); // build information std::cout << PrettyLine; diff --git a/Source/MaestroThermal.cpp b/Source/MaestroThermal.cpp index 26d91f648..ab39b4e7d 100644 --- a/Source/MaestroThermal.cpp +++ b/Source/MaestroThermal.cpp @@ -202,7 +202,7 @@ void Maestro::ApplyThermal(MLABecLaplacian& mlabec, mlmg_lobc[idim] = mlmg_hibc[idim] = LinOpBCType::Periodic; } else { // lo-side BCs - if (bcs[bccomp].lo(idim) == BCType::foextrap) { + if (bcs[bccomp].lo(idim) == BCType::foextrap) { // NOLINT(bugprone-branch-clone) // outflow mlmg_lobc[idim] = LinOpBCType::Neumann; } else if (bcs[bccomp].lo(idim) == BCType::ext_dir) { @@ -213,7 +213,7 @@ void Maestro::ApplyThermal(MLABecLaplacian& mlabec, } // hi-side BCs - if (bcs[bccomp].hi(idim) == BCType::foextrap) { + if (bcs[bccomp].hi(idim) == BCType::foextrap) { // NOLINT(bugprone-branch-clone) // outflow mlmg_hibc[idim] = LinOpBCType::Neumann; } else if (bcs[bccomp].hi(idim) == BCType::ext_dir) { @@ -456,7 +456,7 @@ void Maestro::ThermalConduct(const Vector& s1, Vector& s2, mlmg_lobc[idim] = mlmg_hibc[idim] = LinOpBCType::Periodic; } else { // lo-side BCs - if (bcs_s[RhoH].lo(idim) == BCType::foextrap) { + if (bcs_s[RhoH].lo(idim) == BCType::foextrap) { // NOLINT(bugprone-branch-clone) mlmg_lobc[idim] = LinOpBCType::Neumann; } else if (bcs_s[RhoH].lo(idim) == BCType::ext_dir) { mlmg_lobc[idim] = LinOpBCType::Dirichlet; @@ -465,7 +465,7 @@ void Maestro::ThermalConduct(const Vector& s1, Vector& s2, } // hi-side BCs - if (bcs_s[RhoH].hi(idim) == BCType::foextrap) { + if (bcs_s[RhoH].hi(idim) == BCType::foextrap) { // NOLINT(bugprone-branch-clone) mlmg_hibc[idim] = LinOpBCType::Neumann; } else if (bcs_s[RhoH].hi(idim) == BCType::ext_dir) { mlmg_hibc[idim] = LinOpBCType::Dirichlet;