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

This commit is contained in:
sjplimp 2015-03-18 23:02:50 +00:00
parent ea303bbf9a
commit 448f69a4d4
2 changed files with 6 additions and 3 deletions

View File

@ -43,8 +43,6 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
nrepeat = force->inumeric(FLERR,arg[4]); nrepeat = force->inumeric(FLERR,arg[4]);
peratom_freq = force->inumeric(FLERR,arg[5]); peratom_freq = force->inumeric(FLERR,arg[5]);
time_depend = 1;
// parse remaining values // parse remaining values
which = new int[narg-6]; which = new int[narg-6];
@ -198,6 +196,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
// once in end_of_step() can set timestep for ones actually invoked // once in end_of_step() can set timestep for ones actually invoked
irepeat = 0; irepeat = 0;
nvalid_last = -1;
nvalid = nextvalid(); nvalid = nextvalid();
modify->addstep_compute_all(nvalid); modify->addstep_compute_all(nvalid);
} }
@ -281,9 +280,13 @@ void FixAveAtom::end_of_step()
int i,j,m,n; int i,j,m,n;
// skip if not step which requires doing something // skip if not step which requires doing something
// error check if timestep was reset in an invalid manner
bigint ntimestep = update->ntimestep; bigint ntimestep = update->ntimestep;
if (ntimestep < nvalid_last || ntimestep > nvalid)
error->all(FLERR,"Invalid timestep resets for fix ave/time");
if (ntimestep != nvalid) return; if (ntimestep != nvalid) return;
nvalid_last = nvalid;
// zero if first step // zero if first step

View File

@ -44,7 +44,7 @@ class FixAveAtom : public Fix {
private: private:
int nvalues; int nvalues;
int nrepeat,irepeat; int nrepeat,irepeat;
bigint nvalid; bigint nvalid,nvalid_last;
int *which,*argindex,*value2index; int *which,*argindex,*value2index;
char **ids; char **ids;
double **array; double **array;