From f46eb9dedb3d613aa5cd8eb9bf80ea7ec509ea2a Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Tue, 5 Jun 2012 23:48:09 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8225
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/update.cpp | 19 ++++++++++++++-----
 src/update.h   |  1 +
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/update.cpp b/src/update.cpp
index e2132cecfb..d1f084f91f 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -344,7 +344,18 @@ void Update::create_minimize(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   reset timestep from input script
+   reset timestep as called from input script
+------------------------------------------------------------------------- */
+
+void Update::reset_timestep(int narg, char **arg)
+{
+  if (narg != 1) error->all(FLERR,"Illegal reset_timestep command");
+  bigint newstep = ATOBIGINT(arg[0]);
+  reset_timestep(newstep);
+}
+
+/* ----------------------------------------------------------------------
+   reset timestep
    do not allow dump files or a restart to be defined
    do not allow any timestep-dependent fixes to be defined
    do not allow any dynamic regions to be defined
@@ -354,10 +365,8 @@ void Update::create_minimize(int narg, char **arg)
    clear timestep list of computes that store future invocation times
 ------------------------------------------------------------------------- */
 
-void Update::reset_timestep(int narg, char **arg)
+void Update::reset_timestep(bigint newstep)
 {
-  if (narg != 1) error->all(FLERR,"Illegal reset_timestep command");
-
   for (int i = 0; i < output->ndump; i++)
     if (output->last_dump[i] >= 0)
       error->all(FLERR,
@@ -389,7 +398,7 @@ void Update::reset_timestep(int narg, char **arg)
   for (int i = 0; i < modify->ncompute; i++)
     if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
 
-  ntimestep = ATOBIGINT(arg[0]);
+  ntimestep = newstep;
   if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
   if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
 }
diff --git a/src/update.h b/src/update.h
index 36b27f22a6..9f9e1388c3 100644
--- a/src/update.h
+++ b/src/update.h
@@ -51,6 +51,7 @@ class Update : protected Pointers {
   void create_integrate(int, char **, char *);
   void create_minimize(int, char **);
   void reset_timestep(int, char **);
+  void reset_timestep(bigint);
   bigint memory_usage();
 
  private:
-- 
GitLab