Skip to content

Commit

Permalink
Protect against use_post_step_regrid when not subcycling (#2639)
Browse files Browse the repository at this point in the history
The castro.use_post_step_regrid parameter doesn't make sense when we're not subcycling. By the time we finish the coarse step we will already have finished all of the fine timesteps (thanks to the recent change in #2505), so there's nothing left to do.
  • Loading branch information
maxpkatz authored Oct 17, 2023
1 parent 466e5a5 commit 951276e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Castro::read_params ()
initialize_cpp_runparams();

ParmParse pp("castro");
ParmParse ppa("amr");

using namespace castro;

Expand Down Expand Up @@ -441,6 +442,13 @@ Castro::read_params ()
}
}

// Post-timestep regrids only make sense if we're subcycling.
std::string subcycling_mode;
ppa.query("subcycling_mode", subcycling_mode);
if (use_post_step_regrid == 1 && subcycling_mode == "None") {
amrex::Error("castro.use_post_step_regrid == 1 is not consistent with amr.subcycling_mode = None.");
}

#ifdef AMREX_PARTICLES
read_particle_params();
#endif
Expand Down Expand Up @@ -545,7 +553,6 @@ Castro::read_params ()

}

ParmParse ppa("amr");
ppa.query("probin_file",probin_file);

Vector<int> tilesize(AMREX_SPACEDIM);
Expand Down

0 comments on commit 951276e

Please sign in to comment.