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

This commit is contained in:
sjplimp
2008-03-03 21:52:23 +00:00
parent 8b1e54dce5
commit b0b1da1371
2 changed files with 29 additions and 22 deletions

View File

@ -92,6 +92,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
fp = NULL;
ave = ONE;
startstep = 0;
// optional args
@ -120,6 +121,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
}
iarg += 2;
if (ave == WINDOW) iarg++;
} else if (strcmp(arg[iarg],"start") == 0) {
if (iarg+2 > narg) error->all("Illegal fix ave/time command");
startstep = atoi(arg[iarg+1]);
iarg += 2;
} else error->all("Illegal fix ave/time command");
}
@ -393,8 +398,9 @@ void FixAveTime::end_of_step()
// if ave = ONE, only single Nfreq timestep value is needed
// if ave = RUNNING, combine with all previous Nfreq timestep values
// if ave = WINDOW, comine with nwindow most recent Nfreq timestep values
// if ave = WINDOW, combine with nwindow most recent Nfreq timestep values
if (update->ntimestep >= startstep) {
if (ave == ONE) {
for (i = 0; i < nvalues; i++) vector_total[i] = vector[i];
norm = 1;
@ -418,6 +424,7 @@ void FixAveTime::end_of_step()
if (window_limit) norm = nwindow;
else norm = iwindow;
}
}
// output result to file

View File

@ -37,7 +37,7 @@ class FixAveTime : public Fix {
char **ids;
FILE *fp;
int ave,nwindow,nsum;
int ave,nwindow,nsum,startstep;
double *vector;
int norm,iwindow,window_limit;