From ba3aa8fab590ba22c163ffe18c8dcb8787959043 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 4 May 2022 16:21:06 -0400 Subject: [PATCH] remove NULL option for reset_timestep --- doc/src/reset_timestep.rst | 6 ++---- src/update.cpp | 5 ++--- unittest/commands/test_simple_commands.cpp | 7 ------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/doc/src/reset_timestep.rst b/doc/src/reset_timestep.rst index e6255e2167..fdaec81fa9 100644 --- a/doc/src/reset_timestep.rst +++ b/doc/src/reset_timestep.rst @@ -10,7 +10,7 @@ Syntax reset_timestep N keyword values ... -* N = timestep number (may be NULL) +* N = timestep number * zero or more keyword/value pairs may be appended * keyword = *time* @@ -27,7 +27,6 @@ Examples reset_timestep 0 reset_timestep 4000000 reset_timestep 1000 time 100.0 - reset_timestep NULL time 200.0 Description """"""""""" @@ -40,8 +39,7 @@ simulation run or minimization advanced the timestep. The optional *time* keyword allows to also set the accumulated simulation time. This is usually the number of timesteps times the size of the timestep, but when using variable size timesteps -with :doc:`fix dt/reset ` it can differ. With -NULL as the timestep number, only the accumulated time is reset. +with :doc:`fix dt/reset ` it can differ. The :doc:`read_data ` and :doc:`create_box ` commands set the timestep to 0; the :doc:`read_restart ` diff --git a/src/update.cpp b/src/update.cpp index e9a533df58..8b8dd3d49b 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -459,11 +459,10 @@ void Update::reset_timestep(int narg, char **arg) { 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); + reset_timestep(utils::bnumeric(FLERR, arg[0], false, lmp), true); if (narg > 1) { - if (utils::strmatch(arg[1], "^time$")) { + if (strcmp(arg[1], "time") == 0) { if (narg < 3) utils::missing_cmd_args(FLERR, "reset_timestep time", error); atimestep = ntimestep; atime = utils::numeric(FLERR, arg[2], false, lmp); diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index 1d8d38fb27..ddedae4e9a 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -241,13 +241,6 @@ TEST_F(SimpleCommandsTest, ResetTimestep) ASSERT_EQ(lmp->update->atimestep, 0); ASSERT_DOUBLE_EQ(lmp->update->atime, 0.0); - BEGIN_HIDE_OUTPUT(); - command("reset_timestep NULL time 10.0"); - END_HIDE_OUTPUT(); - ASSERT_EQ(lmp->update->ntimestep, 0); - ASSERT_EQ(lmp->update->atimestep, 0); - ASSERT_DOUBLE_EQ(lmp->update->atime, 10.0); - BEGIN_HIDE_OUTPUT(); command("reset_timestep 10 time 100.0"); END_HIDE_OUTPUT();