Change Update::reset_timestep() API so that rerun can bypass the time depended fix check
This commit is contained in:
@ -460,7 +460,7 @@ void Update::reset_timestep(int narg, char **arg)
|
||||
{
|
||||
if (narg != 1) error->all(FLERR, "Illegal reset_timestep command");
|
||||
bigint newstep = utils::bnumeric(FLERR, arg[0], false, lmp);
|
||||
reset_timestep(newstep);
|
||||
reset_timestep(newstep, true);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -468,7 +468,7 @@ void Update::reset_timestep(int narg, char **arg)
|
||||
called from input script (indirectly) or rerun command
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Update::reset_timestep(bigint newstep)
|
||||
void Update::reset_timestep(bigint newstep, bool do_check)
|
||||
{
|
||||
if (newstep < 0) error->all(FLERR, "Timestep must be >= 0");
|
||||
|
||||
@ -490,11 +490,14 @@ void Update::reset_timestep(bigint newstep)
|
||||
|
||||
output->reset_timestep(ntimestep);
|
||||
|
||||
// do not allow timestep-dependent fixes to be defined
|
||||
// rerun will not be meaningful with this check active.
|
||||
if (do_check) {
|
||||
// do not allow timestep-dependent fixes to be defined
|
||||
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->time_depend)
|
||||
error->all(FLERR, "Cannot reset timestep with time-dependent fix {} defined", ifix->style);
|
||||
for (const auto &ifix : modify->get_fix_list())
|
||||
if (ifix->time_depend)
|
||||
error->all(FLERR, "Cannot reset timestep with time-dependent fix {} defined", ifix->style);
|
||||
}
|
||||
|
||||
// reset eflag/vflag global so no commands will think eng/virial are current
|
||||
|
||||
|
||||
Reference in New Issue
Block a user