From 0e0c16c30195b4fdcd278c565648660c37a4f3c7 Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Mon, 15 Oct 2007 15:07:59 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1045
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 doc/Section_howto.html   |  9 ++++--
 doc/Section_howto.txt    |  9 ++++--
 doc/fix_ave_spatial.html | 63 ++++++++++++++++++++++----------------
 doc/fix_ave_spatial.txt  | 65 +++++++++++++++++++++++-----------------
 doc/fix_ave_time.html    | 33 ++++++++++++--------
 doc/fix_ave_time.txt     | 33 ++++++++++++--------
 6 files changed, 128 insertions(+), 84 deletions(-)

diff --git a/doc/Section_howto.html b/doc/Section_howto.html
index f5f61a065d..5a2cd97306 100644
--- a/doc/Section_howto.html
+++ b/doc/Section_howto.html
@@ -805,7 +805,7 @@ at a specified frequency.  A simulation prints one set of
 thermodynamic output; it may generate zero, or one, or multiple dump
 files.  LAMMPS gives you a variety of ways to determine what
 quantities are computed and printed when thermodynamic info or dump
-files are output.  There are also three fixes which do their own
+files are output.  There are also three fixes which can do their own
 output of user-defined quantities: <A HREF = "fix_ave_time.html">fix ave/time</A>
 for time averaging, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> for spatial
 averaging, and <A HREF = "fix_print.html">fix print</A>.  These are described below.
@@ -895,7 +895,8 @@ global quantities like temperature or pressure.  The global quantities
 are calculated by a <A HREF = "compute.html">compute</A> or a <A HREF = "fix.html">fix</A>.  The
 compute or fix must generate global scalar or vector quantities.  The
 time-averaged values generated by <A HREF = "fix_ave_time.html">fix ave/time</A> can
-be written directly to a file and/or accessed by the <A HREF = "thermo_style.html">thermo_style
+be written directly to a file and/or accessed by any output command
+that uses fixes as a source of input, e.g. the <A HREF = "thermo_style.html">thermo_style
 custom</A> command.
 </P>
 <P>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command enables
@@ -907,7 +908,9 @@ Note that if you use the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command
 fix ave/spatial, it means you are effectively calculating a time
 average of a spatial average of a time-averaged per-atom quantity.
 The time-averaged values generated by <A HREF = "fix_ave_spatial.html">fix
-ave/spatial</A> are written directly to a file.
+ave/spatial</A> can be written directly to a file
+and/or accessed by any output command that uses fixes as a source of
+input, e.g. the <A HREF = "thermo_style.html">thermo_style custom</A> command.
 </P>
 <P>The <A HREF = "fix_print.html">fix print</A> command can generate a line of output
 written to the screen and log file periodically during a running
diff --git a/doc/Section_howto.txt b/doc/Section_howto.txt
index 3028f5e39a..02fb9ecad5 100644
--- a/doc/Section_howto.txt
+++ b/doc/Section_howto.txt
@@ -798,7 +798,7 @@ at a specified frequency.  A simulation prints one set of
 thermodynamic output; it may generate zero, or one, or multiple dump
 files.  LAMMPS gives you a variety of ways to determine what
 quantities are computed and printed when thermodynamic info or dump
-files are output.  There are also three fixes which do their own
+files are output.  There are also three fixes which can do their own
 output of user-defined quantities: "fix ave/time"_fix_ave_time.html
 for time averaging, "fix ave/spatial"_fix_ave_spatial.html for spatial
 averaging, and "fix print"_fix_print.html.  These are described below.
@@ -888,7 +888,8 @@ global quantities like temperature or pressure.  The global quantities
 are calculated by a "compute"_compute.html or a "fix"_fix.html.  The
 compute or fix must generate global scalar or vector quantities.  The
 time-averaged values generated by "fix ave/time"_fix_ave_time.html can
-be written directly to a file and/or accessed by the "thermo_style
+be written directly to a file and/or accessed by any output command
+that uses fixes as a source of input, e.g. the "thermo_style
 custom"_thermo_style.html command.
 
 The "fix ave/spatial"_fix_ave_spatial.html command enables
@@ -900,7 +901,9 @@ Note that if you use the "fix ave/atom"_fix_ave_atom.html command with
 fix ave/spatial, it means you are effectively calculating a time
 average of a spatial average of a time-averaged per-atom quantity.
 The time-averaged values generated by "fix
-ave/spatial"_fix_ave_spatial.html are written directly to a file.
+ave/spatial"_fix_ave_spatial.html can be written directly to a file
+and/or accessed by any output command that uses fixes as a source of
+input, e.g. the "thermo_style custom"_thermo_style.html command.
 
 The "fix print"_fix_print.html command can generate a line of output
 written to the screen and log file periodically during a running
diff --git a/doc/fix_ave_spatial.html b/doc/fix_ave_spatial.html
index 0374af6fe7..62569cd0eb 100644
--- a/doc/fix_ave_spatial.html
+++ b/doc/fix_ave_spatial.html
@@ -23,7 +23,7 @@
 
 <LI>Nrepeat = # of times to repeat the Nevery calculation before averaging 
 
-<LI>Nfreq = timestep frequency at which the average value is written to file 
+<LI>Nfreq = timestep frequency at which the average value is computed 
 
 <LI>dim = <I>x</I> or <I>y</I> or <I>z</I> 
 
@@ -31,7 +31,7 @@
 
 <LI>delta = thickness of spatial layers in dim (distance units) 
 
-<LI>file = filename to write results to 
+<LI>file = filename to write results to (NULL = no file) 
 
 <LI>style = <I>density</I> or <I>compute</I> or <I>fix</I> 
 
@@ -41,8 +41,6 @@
   <I>compute</I> arg = compute-ID that stores or calculates per-atom quantities
   <I>fix</I> arg = fix-ID that stores or calculates per-atom quantities 
 </PRE>
-<PRE>
-</PRE>
 <LI>zero or more keyword/value pairs may be appended 
 
 <PRE>keyword = <I>norm</I> or <I>units</I>
@@ -61,11 +59,15 @@ fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 dens.profile density mass
 </P>
 <P>Calculate one or more instantaneous per-atom quantities every few
 timesteps, average them by layer in a chosen dimension and over a
-longer timescale, and print the results to a file.  This can be used
-to spatially average per-atom properties (velocity, force) or per-atom
-quantities calculated by a <A HREF = "compute.html">compute</A> (energy, stress) or
-by another fix (see the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command) or
-by a variable via an equation you define (see the <A HREF = "compute_variable_atom.html">compute
+longer timescale.  The resulting averages can be written to a file
+and/or used by other <A HREF = "Section_howto.html#4_15">output commands</A> such as
+<A HREF = "thermo_style.html">thermo_style custom</A>.
+</P>
+<P>This fix can be used to spatially average per-atom properties
+(velocity, force) or per-atom quantities calculated by a
+<A HREF = "compute.html">compute</A> (energy, stress) or by another fix (see the
+<A HREF = "fix_ave_atom.html">fix ave/atom</A> command) or by a variable via an
+equation you define (see the <A HREF = "compute_variable_atom.html">compute
 variable/atom</A> command).
 </P>
 <P>The <I>density</I> styles means to simply count the number of atoms in each
@@ -153,8 +155,8 @@ computed every <I>Nfreq</I> timesteps.  The average is over <I>Nrepeat</I>
 values, computed in the preceeding portion of the simulation every
 <I>Nevery</I> timesteps.  Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then
 values on timesteps 90,92,94,96,98,100 will be used to compute the
-final average written to the file on timestep 100.  Similary for
-timesteps 190,192,194,196,198,200 on timestep 200, etc.
+final average on timestep 100.  Similary for timesteps
+190,192,194,196,198,200 on timestep 200, etc.
 </P>
 <P>The <I>norm</I> keyword also affects how time-averaging is done.  For an
 <I>all</I> setting, a layer quantity is summed over all atoms in all
@@ -168,15 +170,15 @@ computed, i.e. Sample-quantity / Sample-count.  The printed value for
 the layer is the average of the M "average sample values", where M =
 Nfreq/Nevery.  In other words it is an average of an average.
 </P>
-<P>Each time info is written to the file, it is in the following format.
-A line with the timestep and number of layers is written.  Then one
-line per layer is written, containing the layer ID (1-N), the
-coordinate of the center of the layer, the number of atoms in the
-layer, and one or more calculated values.  The number of atoms and the
-value(s) are average quantities.  If the value of the <I>units</I> keyword
-is <I>box</I> or <I>lattice</I>, the "coord" is printed in box units.  If the
-value of the <I>units</I> keyword is <I>reduced</I>, the "coord" is printed in
-reduced units (0-1).
+<P>If file output is specified, each time info is written to the file, it
+is in the following format.  A line with the timestep and number of
+layers is written.  Then one line per layer is written, containing the
+layer ID (1-N), the coordinate of the center of the layer, the number
+of atoms in the layer, and one or more calculated values.  The number
+of atoms and the value(s) are average quantities.  If the value of the
+<I>units</I> keyword is <I>box</I> or <I>lattice</I>, the "coord" is printed in box
+units.  If the value of the <I>units</I> keyword is <I>reduced</I>, the "coord"
+is printed in reduced units (0-1).
 </P>
 <P>If the <I>density</I> keyword is used, or the <I>compute</I> or <I>fix</I> keyword
 with a compute/fix that calculates a single quantity per atom, then a
@@ -197,11 +199,22 @@ fix ave/spatial, it can slow down a simulation.
 </P>
 <P>No information about this fix is written to <A HREF = "restart.html">binary restart
 files</A>.  None of the <A HREF = "fix_modify.html">fix_modify</A> options
-are relevant to this fix.  No global scalar or vector or per-atom
-quantities are stored by this fix for access by various <A HREF = "Section_howto.html#4_15">output
-commands</A>.  No parameter of this fix can be
-used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
-This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
+are relevant to this fix.
+</P>
+<P>This fix computes a vector of quantities which can be accessed by
+various <A HREF = "Section_howto.html#4_15">output commands</A>.  The values should
+only be accessed on timesteps that are multiples of <I>Nfreq</I> since that
+is when averaging is complete.  The vector is of length N =
+nlayers*nvalues where nvalues is the number of per-atom quantities
+produced by the compute or fix that fix ave/spatial accesses.  Nvalues
+= 1 if the style is <I>density</I>.  If nvalues > 1 and vector value N is
+accessed by another output command, then the average quantity for the
+Ith layer and Jth value in that layer is accessed, where I = N /
+nvalues + 1 and J = N % nvalues + 1.
+</P>
+<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
+the <A HREF = "run.html">run</A> command.  This fix is not invoked during <A HREF = "minimize.html">energy
+minimization</A>.
 </P>
 <P><B>Restrictions:</B> none
 </P>
diff --git a/doc/fix_ave_spatial.txt b/doc/fix_ave_spatial.txt
index d47c22bfa4..8ce58792d8 100644
--- a/doc/fix_ave_spatial.txt
+++ b/doc/fix_ave_spatial.txt
@@ -16,25 +16,21 @@ ID, group-ID are documented in "fix"_fix.html command :ulb,l
 ave/spatial = style name of this fix command :l
 Nevery = calculate property every this many timesteps :l
 Nrepeat = # of times to repeat the Nevery calculation before averaging :l
-Nfreq = timestep frequency at which the average value is written to file :l
+Nfreq = timestep frequency at which the average value is computed :l
 dim = {x} or {y} or {z} :l
 origin = {lower} or {center} or {upper} or coordinate value (distance units) :l
 delta = thickness of spatial layers in dim (distance units) :l
-file = filename to write results to :l
+file = filename to write results to (NULL = no file) :l
 style = {density} or {compute} or {fix} :l
   {density} arg = {mass} or {number}
     {mass} = compute mass density
     {number} = compute number density
   {compute} arg = compute-ID that stores or calculates per-atom quantities
   {fix} arg = fix-ID that stores or calculates per-atom quantities :pre
-
-:pre
-
 zero or more keyword/value pairs may be appended :l
 keyword = {norm} or {units}
   {norm} value = {all} or {sample}
   {units} value = {box} or {lattice} or {reduced} :pre
-  
 :ule
 
 [Examples:]
@@ -47,11 +43,15 @@ fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 dens.profile density mass :pre
 
 Calculate one or more instantaneous per-atom quantities every few
 timesteps, average them by layer in a chosen dimension and over a
-longer timescale, and print the results to a file.  This can be used
-to spatially average per-atom properties (velocity, force) or per-atom
-quantities calculated by a "compute"_compute.html (energy, stress) or
-by another fix (see the "fix ave/atom"_fix_ave_atom.html command) or
-by a variable via an equation you define (see the "compute
+longer timescale.  The resulting averages can be written to a file
+and/or used by other "output commands"_Section_howto.html#4_15 such as
+"thermo_style custom"_thermo_style.html.
+
+This fix can be used to spatially average per-atom properties
+(velocity, force) or per-atom quantities calculated by a
+"compute"_compute.html (energy, stress) or by another fix (see the
+"fix ave/atom"_fix_ave_atom.html command) or by a variable via an
+equation you define (see the "compute
 variable/atom"_compute_variable_atom.html command).
 
 The {density} styles means to simply count the number of atoms in each
@@ -139,8 +139,8 @@ computed every {Nfreq} timesteps.  The average is over {Nrepeat}
 values, computed in the preceeding portion of the simulation every
 {Nevery} timesteps.  Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then
 values on timesteps 90,92,94,96,98,100 will be used to compute the
-final average written to the file on timestep 100.  Similary for
-timesteps 190,192,194,196,198,200 on timestep 200, etc.
+final average on timestep 100.  Similary for timesteps
+190,192,194,196,198,200 on timestep 200, etc.
 
 The {norm} keyword also affects how time-averaging is done.  For an
 {all} setting, a layer quantity is summed over all atoms in all
@@ -154,15 +154,15 @@ computed, i.e. Sample-quantity / Sample-count.  The printed value for
 the layer is the average of the M "average sample values", where M =
 Nfreq/Nevery.  In other words it is an average of an average.
 
-Each time info is written to the file, it is in the following format.
-A line with the timestep and number of layers is written.  Then one
-line per layer is written, containing the layer ID (1-N), the
-coordinate of the center of the layer, the number of atoms in the
-layer, and one or more calculated values.  The number of atoms and the
-value(s) are average quantities.  If the value of the {units} keyword
-is {box} or {lattice}, the "coord" is printed in box units.  If the
-value of the {units} keyword is {reduced}, the "coord" is printed in
-reduced units (0-1).
+If file output is specified, each time info is written to the file, it
+is in the following format.  A line with the timestep and number of
+layers is written.  Then one line per layer is written, containing the
+layer ID (1-N), the coordinate of the center of the layer, the number
+of atoms in the layer, and one or more calculated values.  The number
+of atoms and the value(s) are average quantities.  If the value of the
+{units} keyword is {box} or {lattice}, the "coord" is printed in box
+units.  If the value of the {units} keyword is {reduced}, the "coord"
+is printed in reduced units (0-1).
 
 If the {density} keyword is used, or the {compute} or {fix} keyword
 with a compute/fix that calculates a single quantity per atom, then a
@@ -183,11 +183,22 @@ fix ave/spatial, it can slow down a simulation.
 
 No information about this fix is written to "binary restart
 files"_restart.html.  None of the "fix_modify"_fix_modify.html options
-are relevant to this fix.  No global scalar or vector or per-atom
-quantities are stored by this fix for access by various "output
-commands"_Section_howto.html#4_15.  No parameter of this fix can be
-used with the {start/stop} keywords of the "run"_run.html command.
-This fix is not invoked during "energy minimization"_minimize.html.
+are relevant to this fix.
+
+This fix computes a vector of quantities which can be accessed by
+various "output commands"_Section_howto.html#4_15.  The values should
+only be accessed on timesteps that are multiples of {Nfreq} since that
+is when averaging is complete.  The vector is of length N =
+nlayers*nvalues where nvalues is the number of per-atom quantities
+produced by the compute or fix that fix ave/spatial accesses.  Nvalues
+= 1 if the style is {density}.  If nvalues > 1 and vector value N is
+accessed by another output command, then the average quantity for the
+Ith layer and Jth value in that layer is accessed, where I = N /
+nvalues + 1 and J = N % nvalues + 1.
+
+No parameter of this fix can be used with the {start/stop} keywords of
+the "run"_run.html command.  This fix is not invoked during "energy
+minimization"_minimize.html.
 
 [Restrictions:] none
 
diff --git a/doc/fix_ave_time.html b/doc/fix_ave_time.html
index 8b7279438b..ae26a6e00a 100644
--- a/doc/fix_ave_time.html
+++ b/doc/fix_ave_time.html
@@ -13,16 +13,16 @@
 </H3>
 <P><B>Syntax:</B>
 </P>
-<PRE>fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID flag file 
+<PRE>fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID type file 
 </PRE>
 <UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
 <LI>ave/time = style name of this fix command
 <LI>Nevery = calculate property every this many timesteps
 <LI>Nrepeat = # of times to repeat the Nevery calculation before averaging
-<LI>Nfreq = timestep frequency at which the average value is written to file
+<LI>Nfreq = timestep frequency at which the average value is computed
 <LI>style = <I>compute</I> or <I>fix</I>
 <LI>ID = ID of compute or fix that performs the calculation
-<LI>flag = 0 for scalar quantity, 1 for vector quantity, 2 for both
+<LI>type = 0 for scalar quantity, 1 for vector quantity, 2 for both
 <LI>file = filename to write results to (NULL = no file) 
 </UL>
 <P><B>Examples:</B>
@@ -68,15 +68,16 @@ computed every <I>Nfreq</I> timesteps.  The average is over <I>Nrepeat</I>
 values, computed in the preceeding portion of the simulation every
 <I>Nevery</I> timesteps.  Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then
 values on timesteps 90,92,94,96,98,100 will be used to compute the
-final average written to the file on timestep 100.  Similary for
-timesteps 190,192,194,196,198,200 on timestep 200, etc.
+final average on timestep 100.  Similary for timesteps
+190,192,194,196,198,200 on timestep 200, etc.
 </P>
-<P>The <I>flag</I> argument chooses whether the scalar and/or vector
+<P>The <I>type</I> argument chooses whether the scalar and/or vector
 calculation of the compute or fix is invoked.  The former computes a
 single global value.  The latter computes N global values, where N is
 defined by the compute or fix, e.g. 6 pressure tensor components.  In
-the vector case, each of the N values is averaged independently and N
-values are written to the file at each output.
+the vector case, each of the N values is averaged independently.  If
+file output is specified, all N values are written to the file at each
+output.
 </P>
 <P>Since the calculation is performed by the compute or fix which stores
 its own "group" definition, the group specified for with the fix
@@ -94,11 +95,17 @@ calculating virial terms for the pressure every timestep.
 </P>
 <P>No information about this fix is written to <A HREF = "restart.html">binary restart
 files</A>.  None of the <A HREF = "fix_modify.html">fix_modify</A> options
-are relevant to this fix.  No global scalar or vector or per-atom
-quantities are stored by this fix for access by various <A HREF = "Section_howto.html#4_15">output
-commands</A>.  No parameter of this fix can be
-used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
-This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
+are relevant to this fix.
+</P>
+<P>Depending on the setting of the <I>type</I> parameter, this fix computes a
+scalar and/or a vector of quantities which can be accessed by various
+<A HREF = "Section_howto.html#4_15">output commands</A>.  The values should only be
+accessed on timesteps that are multiples of <I>Nfreq</I> since that is when
+averaging is complete.
+</P>
+<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
+the <A HREF = "run.html">run</A> command.  This fix is not invoked during <A HREF = "minimize.html">energy
+minimization</A>.
 </P>
 <P><B>Restrictions:</B> none
 </P>
diff --git a/doc/fix_ave_time.txt b/doc/fix_ave_time.txt
index defe27334f..c30c8812eb 100644
--- a/doc/fix_ave_time.txt
+++ b/doc/fix_ave_time.txt
@@ -10,16 +10,16 @@ fix ave/time command :h3
 
 [Syntax:]
 
-fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID flag file :pre
+fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID type file :pre
 
 ID, group-ID are documented in "fix"_fix.html command
 ave/time = style name of this fix command
 Nevery = calculate property every this many timesteps
 Nrepeat = # of times to repeat the Nevery calculation before averaging
-Nfreq = timestep frequency at which the average value is written to file
+Nfreq = timestep frequency at which the average value is computed
 style = {compute} or {fix}
 ID = ID of compute or fix that performs the calculation
-flag = 0 for scalar quantity, 1 for vector quantity, 2 for both
+type = 0 for scalar quantity, 1 for vector quantity, 2 for both
 file = filename to write results to (NULL = no file) :ul
 
 [Examples:]
@@ -65,15 +65,16 @@ computed every {Nfreq} timesteps.  The average is over {Nrepeat}
 values, computed in the preceeding portion of the simulation every
 {Nevery} timesteps.  Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then
 values on timesteps 90,92,94,96,98,100 will be used to compute the
-final average written to the file on timestep 100.  Similary for
-timesteps 190,192,194,196,198,200 on timestep 200, etc.
+final average on timestep 100.  Similary for timesteps
+190,192,194,196,198,200 on timestep 200, etc.
 
-The {flag} argument chooses whether the scalar and/or vector
+The {type} argument chooses whether the scalar and/or vector
 calculation of the compute or fix is invoked.  The former computes a
 single global value.  The latter computes N global values, where N is
 defined by the compute or fix, e.g. 6 pressure tensor components.  In
-the vector case, each of the N values is averaged independently and N
-values are written to the file at each output.
+the vector case, each of the N values is averaged independently.  If
+file output is specified, all N values are written to the file at each
+output.
 
 Since the calculation is performed by the compute or fix which stores
 its own "group" definition, the group specified for with the fix
@@ -91,11 +92,17 @@ calculating virial terms for the pressure every timestep.
 
 No information about this fix is written to "binary restart
 files"_restart.html.  None of the "fix_modify"_fix_modify.html options
-are relevant to this fix.  No global scalar or vector or per-atom
-quantities are stored by this fix for access by various "output
-commands"_Section_howto.html#4_15.  No parameter of this fix can be
-used with the {start/stop} keywords of the "run"_run.html command.
-This fix is not invoked during "energy minimization"_minimize.html.
+are relevant to this fix.
+
+Depending on the setting of the {type} parameter, this fix computes a
+scalar and/or a vector of quantities which can be accessed by various
+"output commands"_Section_howto.html#4_15.  The values should only be
+accessed on timesteps that are multiples of {Nfreq} since that is when
+averaging is complete.
+
+No parameter of this fix can be used with the {start/stop} keywords of
+the "run"_run.html command.  This fix is not invoked during "energy
+minimization"_minimize.html.
 
 [Restrictions:] none
 
-- 
GitLab