git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5447 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -372,20 +372,11 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
|
||||
values_list = NULL;
|
||||
|
||||
// nvalid = next step on which end_of_step does something
|
||||
// can be this timestep if multiple of nfreq and nrepeat = 1
|
||||
// else backup from next multiple of nfreq
|
||||
|
||||
nvalid = (update->ntimestep/nfreq)*nfreq + nfreq;
|
||||
if (nvalid-nfreq == update->ntimestep && nrepeat == 1)
|
||||
nvalid = update->ntimestep;
|
||||
else
|
||||
nvalid -= (nrepeat-1)*nevery;
|
||||
if (nvalid < update->ntimestep) nvalid += nfreq;
|
||||
|
||||
// add nvalid to all computes that store invocation times
|
||||
// since don't know a priori which are invoked by this fix
|
||||
// once in end_of_step() can set timestep for ones actually invoked
|
||||
|
||||
nvalid = nextvalid();
|
||||
modify->addstep_compute_all(nvalid);
|
||||
}
|
||||
|
||||
@ -474,6 +465,14 @@ void FixAveSpatial::init()
|
||||
|
||||
} else value2index[m] = -1;
|
||||
}
|
||||
|
||||
// need to reset nvalid if nvalid < ntimestep b/c minimize was performed
|
||||
|
||||
if (nvalid < update->ntimestep) {
|
||||
irepeat = 0;
|
||||
nvalid = nextvalid();
|
||||
modify->addstep_compute_all(nvalid);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -1263,6 +1262,23 @@ double FixAveSpatial::compute_array(int i, int j)
|
||||
return values_total[i][j]/norm;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
calculate nvalid = next step on which end_of_step does something
|
||||
can be this timestep if multiple of nfreq and nrepeat = 1
|
||||
else backup from next multiple of nfreq
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixAveSpatial::nextvalid()
|
||||
{
|
||||
int nvalid = (update->ntimestep/nfreq)*nfreq + nfreq;
|
||||
if (nvalid-nfreq == update->ntimestep && nrepeat == 1)
|
||||
nvalid = update->ntimestep;
|
||||
else
|
||||
nvalid -= (nrepeat-1)*nevery;
|
||||
if (nvalid < update->ntimestep) nvalid += nfreq;
|
||||
return nvalid;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of varatom and bins
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user