diff --git a/Source/driver/timestep.cpp b/Source/driver/timestep.cpp index a70a624381..31144a7e9e 100644 --- a/Source/driver/timestep.cpp +++ b/Source/driver/timestep.cpp @@ -35,6 +35,8 @@ Castro::estdt_cfl (int is_new) // Courant-condition limited timestep const auto dx = geom.CellSizeArray(); + const auto problo = geom.ProbLoArray(); + amrex::ignore_unused(problo); const MultiFab& stateMF = is_new ? get_new_data(State_Type) : get_old_data(State_Type); @@ -85,7 +87,7 @@ Castro::estdt_cfl (int is_new) if (geom.IsSPHERICAL()) { // dx[1] in Spherical2D is just dtheta, need rdtheta for physical length // so just multiply by the smallest r - dt2 *= geom.ProbLoArray()[0] + 0.5_rt * dx[0]; + dt2 *= problo[0] + 0.5_rt * dx[0]; } #else dt2 = dt1; @@ -132,6 +134,8 @@ Castro::estdt_mhd (int is_new) // MHD timestep limiter const auto dx = geom.CellSizeArray(); + const auto problo = geom.ProbLoArray(); + amrex::ignore_unused(problo); const MultiFab& U_state = is_new ? get_new_data(State_Type) : get_old_data(State_Type); @@ -212,7 +216,7 @@ Castro::estdt_mhd (int is_new) #if AMREX_SPACEDIM >= 2 dt2 = dx[1]/(cy + std::abs(uy)); if (geom.IsSPHERICAL()) { - dt2 *= geom.ProbLoArray()[0] + 0.5_rt * dx[0]; + dt2 *= problo[0] + 0.5_rt * dx[0]; } #else dt2 = dt1; @@ -246,6 +250,8 @@ Castro::estdt_temp_diffusion (int is_new) // where D = k/(rho c_v), and k is the conductivity const auto dx = geom.CellSizeArray(); + const auto problo = geom.ProbLoArray(); + amrex::ignore_unused(problo); const MultiFab& stateMF = is_new ? get_new_data(State_Type) : get_old_data(State_Type); @@ -296,7 +302,7 @@ Castro::estdt_temp_diffusion (int is_new) #if AMREX_SPACEDIM >= 2 dt2 = 0.5_rt * dx[1]*dx[1] / D; if (geom.IsSPHERICAL()) { - Real r = geom.ProbLoArray()[0] + 0.5_rt * dx[0]; + Real r = problo[0] + 0.5_rt * dx[0]; dt2 *= r * r; } #else @@ -332,6 +338,8 @@ Castro::estdt_burning (int is_new) } const auto dx = geom.CellSizeArray(); + const auto problo = geom.ProbLoArray(); + amrex::ignore_unused(problo); MultiFab& stateMF = is_new ? get_new_data(State_Type) : get_old_data(State_Type); @@ -383,7 +391,7 @@ Castro::estdt_burning (int is_new) Real r = 1.0_rt; #if AMREX_SPACEDIM >= 2 if (geom.IsSPHERICAL()) { - r = geom.ProbLoArray()[0] + 0.5_rt * dx[0]; + r = problo[0] + 0.5_rt * dx[0]; } #endif burn_state.dx = amrex::min(AMREX_D_DECL(dx[0], r * dx[1], dx[2])); @@ -482,6 +490,8 @@ Real Castro::estdt_rad (int is_new) { auto dx = geom.CellSizeArray(); + const auto problo = geom.ProbLoArray(); + amrex::ignore_unused(problo); const MultiFab& stateMF = is_new ? get_new_data(State_Type) : get_old_data(State_Type); const MultiFab& radMF = is_new ? get_new_data(Rad_Type) : get_old_data(Rad_Type); @@ -542,7 +552,7 @@ Castro::estdt_rad (int is_new) #if AMREX_SPACEDIM >= 2 Real dt2 = dx[1] / (c + std::abs(uy)); if (geom.IsSPHERICAL()) { - dt2 *= geom.ProbLoArray()[0] + 0.5_rt * dx[0]; + dt2 *= problo[0] + 0.5_rt * dx[0]; } #else Real dt2 = std::numeric_limits::max(); diff --git a/Source/hydro/Castro_hydro.cpp b/Source/hydro/Castro_hydro.cpp index 9e3116b0b9..11dfe7fa72 100644 --- a/Source/hydro/Castro_hydro.cpp +++ b/Source/hydro/Castro_hydro.cpp @@ -237,6 +237,8 @@ Castro::check_for_cfl_violation(const MultiFab& State, const Real dt) int cfl_violation = 0; auto dx = geom.CellSizeArray(); + const auto problo = geom.ProbLoArray(); + amrex::ignore_unused(problo); Real dtdx = dt / dx[0]; @@ -246,7 +248,7 @@ Castro::check_for_cfl_violation(const MultiFab& State, const Real dt) if (geom.IsSPHERICAL()) { // dx[1] in Spherical2D is just rdtheta, need rdtheta for physical length // Just choose to divide by the smallest r - dtdy /= geom.ProbLoArray()[0] + 0.5_rt * dx[0]; + dtdy /= problo[0] + 0.5_rt * dx[0]; } }