merge set_time command into reset_timestep

This commit is contained in:
Axel Kohlmeyer
2022-05-04 13:24:23 -04:00
parent 0bedff1ce0
commit f8742d599b
8 changed files with 65 additions and 108 deletions

View File

@ -457,9 +457,19 @@ void Update::new_minimize(char *style, int /* narg */, char ** /* arg */, int tr
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, true);
if (narg < 1) utils::missing_cmd_args(FLERR, "reset_timestep", error);
if (!utils::strmatch(arg[0], "^NULL$"))
reset_timestep(utils::bnumeric(FLERR, arg[0], false, lmp), true);
if (narg > 1) {
if (utils::strmatch(arg[1], "^time$")) {
if (narg < 3) utils::missing_cmd_args(FLERR, "reset_timestep time", error);
atimestep = ntimestep;
atime = utils::numeric(FLERR, arg[2], false, lmp);
} else
error->all(FLERR, "Unknown reset_timestep option {}", arg[1]);
}
}
/* ----------------------------------------------------------------------