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: fix ave/time for time averaging, fix ave/spatial for spatial averaging, and fix print. These are described below. @@ -895,7 +895,8 @@ global quantities like temperature or pressure. The global quantities are calculated by a compute or a fix. The compute or fix must generate global scalar or vector quantities. The time-averaged values generated by fix ave/time 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 command.
The fix ave/spatial command enables @@ -907,7 +908,9 @@ Note that if you use the fix ave/atom 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 fix -ave/spatial are written directly to a file. +ave/spatial 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 command.
The fix print 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 @@
-
keyword = norm or units @@ -61,11 +59,15 @@ fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 dens.profile density massCalculate 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 (energy, stress) or -by another fix (see the fix ave/atom 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 such as +thermo_style custom. +
+This fix can be used to spatially average per-atom properties +(velocity, force) or per-atom quantities calculated by a +compute (energy, stress) or by another fix (see the +fix ave/atom command) or by a variable via an +equation you define (see the compute variable/atom command).
The density styles means to simply count the number of atoms in each @@ -153,8 +155,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 @@ -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.
-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 @@ -197,11 +199,22 @@ fix ave/spatial, it can slow down a simulation.
No information about this fix is written to binary restart files. None of the fix_modify 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. No parameter of this fix can be -used with the start/stop keywords of the run command. -This fix is not invoked during energy minimization. +are relevant to this fix. +
+This fix computes a vector of quantities which can be accessed by +various output commands. 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 command. This fix is not invoked during energy +minimization.
Restrictions: none
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 @@Syntax:
-fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID flag file +fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID type file
Examples: @@ -68,15 +68,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 @@ -94,11 +95,17 @@ calculating virial terms for the pressure every timestep.
No information about this fix is written to binary restart files. None of the fix_modify 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. No parameter of this fix can be -used with the start/stop keywords of the run command. -This fix is not invoked during energy minimization. +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. 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 command. This fix is not invoked during energy +minimization.
Restrictions: none
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