Commit b0b1da13 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1570 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 8b1e54dc
Loading
Loading
Loading
Loading
+30 −23
Original line number Diff line number Diff line
@@ -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

+1 −1
Original line number Diff line number Diff line
@@ -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;