From 0bb3fd9b060255224225ef1e0b835d606865bd3e Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 5 Dec 2007 20:57:47 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1217 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/fix_ave_atom.cpp | 4 ++-- src/fix_ave_spatial.cpp | 4 ++-- src/fix_ave_time.cpp | 4 ++-- src/min_cg.cpp | 8 ++++++++ src/output.cpp | 4 ++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 019d5f7534..9295a7ad4c 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -89,8 +89,8 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : nvalid -= (nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += peratom_freq; - // must set timestep for all computes that store invocation times - // since don't know a priori which are invoked by this fix + // set timestep for all computes that store invocation times + // since don't know a priori which are invoked by this fix // once in end_of_step() can just set timestep for ones actually invoked for (int i = 0; i < modify->ncompute; i++) diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp index 564960349d..0305213a49 100644 --- a/src/fix_ave_spatial.cpp +++ b/src/fix_ave_spatial.cpp @@ -239,8 +239,8 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) : nvalid -= (nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += nfreq; - // must set timestep for all computes that store invocation times - // since don't know a priori which are invoked by this fix + // set timestep for all computes that store invocation times + // since don't know a priori which are invoked by this fix // once in end_of_step() can just set timestep for ones actually invoked if (which == COMPUTE) diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 7b4700b78c..80d6c66f07 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -198,8 +198,8 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : nvalid -= (nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += nfreq; - // must set timestep for all computes that store invocation times - // since don't know a priori which are invoked by this fix + // set timestep for all computes that store invocation times + // since don't know a priori which are invoked by this fix // once in end_of_step() can just set timestep for ones actually invoked for (int i = 0; i < modify->ncompute; i++) diff --git a/src/min_cg.cpp b/src/min_cg.cpp index 88737c6554..d65ce47b92 100644 --- a/src/min_cg.cpp +++ b/src/min_cg.cpp @@ -164,17 +164,25 @@ void MinCG::run() // account for early exit from iterate loop due to convergence // set niter/nsteps for Finish stats to print // set output->next values to this timestep + // set timestep for all computes that store invocation times + // since don't know a priori which are invoked by thermo and dumps // call eng_force to insure vflag is set when forces computed // output->write does final output for thermo, dump, restart files if (niter < update->nsteps) { niter++; update->nsteps = niter; + for (int idump = 0; idump < output->ndump; idump++) output->next_dump[idump] = update->ntimestep; output->next_dump_any = update->ntimestep; if (output->restart_every) output->next_restart = update->ntimestep; output->next_thermo = update->ntimestep; + + for (int i = 0; i < modify->ncompute; i++) + if (modify->compute[i]->timeflag) + modify->compute[i]->add_step(update->ntimestep); + int ntmp; double *xtmp,*htmp,etmp; eng_force(&ntmp,&xtmp,&htmp,&etmp); diff --git a/src/output.cpp b/src/output.cpp index 61b349cfac..de9d504a85 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -136,10 +136,10 @@ void Output::setup(int flag) if (ndump) { for (int idump = 0; idump < ndump; idump++) { + if (strcmp(dump[idump]->style,"custom") == 0) + modify->clearstep_compute(); if (ntimestep % dump_every[idump] == 0 && last_dump[idump] != ntimestep) { - if (strcmp(dump[idump]->style,"custom") == 0) - modify->clearstep_compute(); dump[idump]->write(); last_dump[idump] = ntimestep; }