git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2330 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -16,6 +16,9 @@
|
||||
#include "update.h"
|
||||
#include "neighbor.h"
|
||||
#include "force.h"
|
||||
#include "modify.h"
|
||||
#include "fix.h"
|
||||
#include "compute.h"
|
||||
#include "output.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
@ -42,6 +45,8 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp)
|
||||
firststep = laststep = 0;
|
||||
beginstep = endstep = 0;
|
||||
|
||||
eflag_global = vflag_global = -1;
|
||||
|
||||
unit_style = NULL;
|
||||
set_units("lj");
|
||||
|
||||
@ -207,6 +212,10 @@ void Update::create_minimize(int narg, char **arg)
|
||||
/* ----------------------------------------------------------------------
|
||||
reset timestep from input script
|
||||
do not allow dump files or a restart to be defined
|
||||
do not allow any timestep-dependent fixes to be defined
|
||||
reset eflag/vflag global so nothing will think eng/virial are current
|
||||
reset invoked flags of computes, so nothing will think they are current
|
||||
clear timestep list of computes that store one
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Update::reset_timestep(int narg, char **arg)
|
||||
@ -219,6 +228,21 @@ void Update::reset_timestep(int narg, char **arg)
|
||||
if (output->restart && output->last_restart >= 0)
|
||||
error->all("Cannot reset timestep with restart file already written");
|
||||
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (modify->fix[i]->time_depend)
|
||||
error->all("Cannot reset timestep with a time-dependent fix defined");
|
||||
|
||||
eflag_global = vflag_global = -1;
|
||||
|
||||
for (int i = 0; i < modify->ncompute; i++) {
|
||||
modify->compute[i]->invoked_scalar = -1;
|
||||
modify->compute[i]->invoked_vector = -1;
|
||||
modify->compute[i]->invoked_peratom = -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < modify->ncompute; i++)
|
||||
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
|
||||
|
||||
ntimestep = atoi(arg[0]);
|
||||
if (ntimestep < 0) error->all("Timestep must be >= 0");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user