diff --git a/Exec/science/wdconvect/MaestroInitData.cpp b/Exec/science/wdconvect/MaestroInitData.cpp index dfe5c3661..e5e644c3d 100644 --- a/Exec/science/wdconvect/MaestroInitData.cpp +++ b/Exec/science/wdconvect/MaestroInitData.cpp @@ -4,16 +4,24 @@ using namespace amrex; using namespace problem_rp; // initializes data on a specific level -void Maestro::InitLevelData(const int lev, const Real time, const MFIter& mfi, +void Maestro::InitLevelData(const int lev, const Real time, const MFIter& mfi, // NOLINT(readability-convert-member-functions-to-static) const Array4 scal, const Array4 vel) { - Abort("Planar InitLevelData not implemented."); + amrex::ignore_unused(lev); + amrex::ignore_unused(time); + amrex::ignore_unused(mfi); + amrex::ignore_unused(scal); + amrex::ignore_unused(vel); + + amrex::Abort("Planar InitLevelData not implemented."); } void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, MultiFab& vel) { + + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::InitLevelDataSphr()", InitLevelDataSphr); - const int max_lev = base_geom.max_radial_level + 1; #ifdef _OPENMP #pragma omp parallel @@ -57,11 +65,11 @@ void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, } } - Put1dArrayOnCart(lev, temp_vec, temp_mf, 0, 0, bcs_f, 0); + Put1dArrayOnCart(lev, temp_vec, temp_mf, false, false, bcs_f, 0); MultiFab::Copy(scal, temp_mf, 0, Temp, 1, 0); // initialize p0_cart - Put1dArrayOnCart(lev, p0_init, p0_cart, 0, 0); + Put1dArrayOnCart(lev, p0_init, p0_cart, false, false); // initialize species for (auto comp = 0; comp < NumSpec; ++comp) { @@ -70,7 +78,7 @@ void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, temp_arr(l, r) = s0_init_arr(l, r, FirstSpec + comp); } } - Put1dArrayOnCart(lev, temp_vec, temp_mf, 0, 0, bcs_s, FirstSpec + comp); + Put1dArrayOnCart(lev, temp_vec, temp_mf, false, false, bcs_s, FirstSpec + comp); MultiFab::Copy(scal, temp_mf, 0, FirstSpec + comp, 1, 0); } @@ -162,7 +170,6 @@ void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, const auto prob_lo = geom[lev].ProbLoArray(); - const auto prob_hi = geom[lev].ProbHiArray(); const auto dx = geom[lev].CellSizeArray(); const auto center_p = center; @@ -179,11 +186,7 @@ void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, const Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; // set perturbational velocity to zero - Real vpert[3]; - - for (auto n = 0; n < 3; ++n) { - vpert[n] = 0.0; - } + Real vpert[3]{}; // compute distance to the center of the star Real rloc = std::sqrt(x * x + y * y + z * z); diff --git a/Exec/science/wdconvect/MaestroTagging.cpp b/Exec/science/wdconvect/MaestroTagging.cpp index 612abd0e1..158f64f9e 100644 --- a/Exec/science/wdconvect/MaestroTagging.cpp +++ b/Exec/science/wdconvect/MaestroTagging.cpp @@ -4,23 +4,36 @@ using namespace amrex; using namespace problem_rp; -void Maestro::RetagArray(const Box& bx, const int lev) { +void Maestro::RetagArray(const Box& bx, const int lev) { // NOLINT(readability-convert-member-functions-to-static) + + amrex::ignore_unused(bx); + amrex::ignore_unused(lev); + // timer for profiling BL_PROFILE_VAR("Maestro::RetagArray()", RetagArray); Abort("Error: RetagArray should not be called for spherical"); } -void Maestro::TagBoxes(TagBoxArray& tags, const MFIter& mfi, const int lev, +void Maestro::TagBoxes(TagBoxArray& tags, const MFIter& mfi, const int lev, // NOLINT(readability-convert-member-functions-to-static) const Real time) { + + amrex::ignore_unused(tags); + amrex::ignore_unused(mfi); + amrex::ignore_unused(lev); + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::TagBoxes()", TagBoxes); Abort("Error: TagBoxes should not be called for spherical"); } -void Maestro::StateError(TagBoxArray& tags, const MultiFab& state_mf, +void Maestro::StateError(TagBoxArray& tags, const MultiFab& state_mf, // NOLINT(readability-convert-member-functions-to-static) const MFIter& mfi, const int lev, const Real time) { + + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::StateError()", StateError); diff --git a/Source/Maestro.H b/Source/Maestro.H index f7fe00f0b..8c14503d3 100644 --- a/Source/Maestro.H +++ b/Source/Maestro.H @@ -957,11 +957,12 @@ class Maestro : public amrex::AmrCore { int comp, int bccomp, const bool is_vel, const bool is_conservative) const; #else + static void MakeDivU(const amrex::Box& bx, amrex::Array4 const divu, amrex::Array4 const umac, amrex::Array4 const vmac, amrex::Array4 const wmac, - const amrex::GpuArray dx) const; + const amrex::GpuArray dx); void MakeEdgeScalPredictor(const amrex::MFIter& mfi, amrex::Array4 const slx, diff --git a/Source/MaestroDt.cpp b/Source/MaestroDt.cpp index c7fcd8e11..94e3a6756 100644 --- a/Source/MaestroDt.cpp +++ b/Source/MaestroDt.cpp @@ -664,13 +664,14 @@ void Maestro::FirstDt() { Real spdy = spd.max(tileBox, 0) / dx[1]; Real pforcey = vel_force[lev][mfi].maxabs(tileBox, 1); +#if AMREX_SPACEDIM == 2 Real spdz = spdy * 0.1; // for 2d make sure this is < spdy - uz /= AMREX_SPACEDIM == 2 ? dx[1] : dx[2]; -#if (AMREX_SPACEDIM == 3) - spdz = spd.max(tileBox, 0) / dx[2]; +#else + Real spdz = spd.max(tileBox, 0) / dx[2]; Real pforcez = vel_force[lev][mfi].maxabs(tileBox, 2); #endif + uz /= AMREX_SPACEDIM == 2 ? dx[1] : dx[2]; // use advective constraint unless velocities are zero everywhere // in which case we use the sound speed diff --git a/Source/MaestroMakeEdgeScalars.cpp b/Source/MaestroMakeEdgeScalars.cpp index 478b0a3df..8fa3a2979 100644 --- a/Source/MaestroMakeEdgeScalars.cpp +++ b/Source/MaestroMakeEdgeScalars.cpp @@ -648,7 +648,7 @@ void Maestro::MakeEdgeScalEdges( void Maestro::MakeDivU(const Box& bx, Array4 const divu, Array4 const umac, Array4 const vmac, Array4 const wmac, - const GpuArray dx) const { + const GpuArray dx) { // timer for profiling BL_PROFILE_VAR("Maestro::MakeDivU()", MakeDivU); diff --git a/Source/MaestroMakeFlux.cpp b/Source/MaestroMakeFlux.cpp index 55db3598b..ed5595662 100644 --- a/Source/MaestroMakeFlux.cpp +++ b/Source/MaestroMakeFlux.cpp @@ -794,12 +794,11 @@ void Maestro::MakeRhoHFlux( rhoh0mac_edgez.array(mfi); ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) { - if (have_h) { - // enthalpy edge state is h - // this is not supported on irregular-spaced base state - } else if (have_hprime) { - // enthalpy edge state is h' - // this is not supported on irregular-spaced base state + if (have_h || have_rhoh) { + // have_h: enthalpy edge state is h + // this is not supported on irregular-spaced base state + // have_hprime: enthalpy edge state is h' + // this is not supported on irregular-spaced base state } else if (have_rhoh) { sfluxx(i, j, k, RhoH) = umacx(i, j, k) * sedgex(i, j, k, RhoH); @@ -817,12 +816,11 @@ void Maestro::MakeRhoHFlux( }); ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) { - if (have_h) { - // enthalpy edge state is h - // this is not supported on irregular-spaced base state - } else if (have_hprime) { - // enthalpy edge state is h' - // this is not supported on irregular-spaced base state + if (have_h || have_hprime) { + // have_h: enthalpy edge state is h + // this is not supported on irregular-spaced base state + // have_hprime: enthalpy edge state is h' + // this is not supported on irregular-spaced base state } else if (have_rhoh) { sfluxy(i, j, k, RhoH) = vmac(i, j, k) * sedgey(i, j, k, RhoH); @@ -839,12 +837,11 @@ void Maestro::MakeRhoHFlux( }); ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) { - if (have_h) { - // enthalpy edge state is h - // this is not supported on irregular-spaced base state - } else if (have_hprime) { - // enthalpy edge state is h' - // this is not supported on irregular-spaced base state + if (have_h || have_hprime) { + // have_h: enthalpy edge state is h + // this is not supported on irregular-spaced base state + // have_hprime: enthalpy edge state is h' + // this is not supported on irregular-spaced base state } else if (have_rhoh) { sfluxz(i, j, k, RhoH) = wmac(i, j, k) * sedgez(i, j, k, RhoH); diff --git a/Source/MaestroMakeUtrans.cpp b/Source/MaestroMakeUtrans.cpp index d5fd4e65b..255f85f74 100644 --- a/Source/MaestroMakeUtrans.cpp +++ b/Source/MaestroMakeUtrans.cpp @@ -461,7 +461,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 + 1, k, 1); vry = utilde_arr(i, j + 1, k, 1);