git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9896 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2013-05-23 17:34:29 +00:00
parent b1af45327d
commit e3b479a4cd
8 changed files with 39 additions and 17 deletions

View File

@ -38,6 +38,8 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp)
char *str;
ntimestep = 0;
atime = 0.0;
atimestep = 0;
first_update = 0;
whichflag = 0;
@ -356,6 +358,7 @@ void Update::reset_timestep(int narg, char **arg)
/* ----------------------------------------------------------------------
reset timestep
set atimestep to new timestep, so future update_time() calls will be correct
trigger reset of timestep for output and for fixes that require it
do not allow any timestep-dependent fixes to be defined
reset eflag/vflag global so nothing will think eng/virial are current
@ -371,6 +374,8 @@ void Update::reset_timestep(bigint newstep)
if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
atimestep = ntimestep;
output->reset_timestep(ntimestep);
for (int i = 0; i < modify->nfix; i++) {
@ -400,6 +405,17 @@ void Update::reset_timestep(bigint newstep)
// error->all(FLERR,"Cannot reset timestep with a dynamic region defined");
}
/* ----------------------------------------------------------------------
update elapsed simulation time
called at end of runs or when timestep size changes
------------------------------------------------------------------------- */
void Update::update_time()
{
atime += (ntimestep-atimestep) * dt;
atimestep = ntimestep;
}
/* ----------------------------------------------------------------------
memory usage of update and integrate/minimize
------------------------------------------------------------------------- */