2007-02-21 08:18:41 +08:00
|
|
|
<HTML>
|
|
|
|
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
|
|
|
|
</CENTER>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H3>fix ave/time command
|
|
|
|
</H3>
|
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<PRE>fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...
|
2007-02-21 08:18:41 +08:00
|
|
|
</PRE>
|
2007-10-19 06:02:20 +08:00
|
|
|
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
|
|
|
|
|
|
|
|
<LI>ave/time = style name of this fix command
|
|
|
|
|
2009-12-15 09:21:23 +08:00
|
|
|
<LI>Nevery = use input values every this many timesteps
|
2007-10-19 06:02:20 +08:00
|
|
|
|
2009-12-15 09:21:23 +08:00
|
|
|
<LI>Nrepeat = # of times to use input values for calculating averages
|
2007-10-19 06:02:20 +08:00
|
|
|
|
2009-12-15 09:21:23 +08:00
|
|
|
<LI>Nfreq = calculate averages every this many timesteps
|
|
|
|
one or more input values can be listed
|
2007-10-19 06:02:20 +08:00
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
<LI>value = c_ID, c_ID[N], f_ID, f_ID[N], v_name
|
2007-10-19 06:02:20 +08:00
|
|
|
|
2009-12-12 05:41:25 +08:00
|
|
|
<PRE> c_ID = global scalar or vector calculated by a compute with ID
|
|
|
|
c_ID[I] = Ith component of global vector or Ith column of global array calculated by a compute with ID
|
|
|
|
f_ID = global scalar or vector calculated by a fix with ID
|
|
|
|
f_ID[I] = Ith component of global vector or Ith column of global array calculated by a fix with ID
|
2008-01-03 03:25:15 +08:00
|
|
|
v_name = global value calculated by an equal-style variable with name
|
|
|
|
</PRE>
|
2007-10-19 06:02:20 +08:00
|
|
|
<LI>zero or more keyword/arg pairs may be appended
|
|
|
|
|
2009-12-12 05:41:25 +08:00
|
|
|
<LI>keyword = <I>mode</I> or <I>file</I> or <I>ave</I> or <I>start</I> or <I>off</I> or <I>title1</I> or <I>title2</I> or <I>title3</I>
|
2007-10-19 06:02:20 +08:00
|
|
|
|
2009-12-12 05:41:25 +08:00
|
|
|
<PRE> <I>mode</I> arg = <I>scalar</I> or <I>vector</I>
|
|
|
|
scalar = all input values are global scalars
|
|
|
|
vector = all input values are global vectors
|
|
|
|
<I>file</I> arg = filename
|
2007-11-27 02:22:03 +08:00
|
|
|
filename = name of file to output time averages to
|
2007-10-19 06:02:20 +08:00
|
|
|
<I>ave</I> args = <I>one</I> or <I>running</I> or <I>window M</I>
|
2008-01-03 03:25:15 +08:00
|
|
|
one = output a new average value every Nfreq steps
|
2008-03-01 09:13:20 +08:00
|
|
|
running = output cumulative average of all previous Nfreq steps
|
2008-03-04 05:52:06 +08:00
|
|
|
window M = output average of M most recent Nfreq steps
|
|
|
|
<I>start</I> args = Nstart
|
2009-12-12 05:41:25 +08:00
|
|
|
Nstart = start averaging on this timestep
|
|
|
|
<I>off</I> arg = M = do not average this value
|
|
|
|
M = value # from 1 to Nvalues
|
|
|
|
<I>title1</I> arg = string
|
2009-12-22 01:51:05 +08:00
|
|
|
string = text to print as 1st line of output file
|
2009-12-12 05:41:25 +08:00
|
|
|
<I>title2</I> arg = string
|
|
|
|
string = text to print as 2nd line of output file
|
|
|
|
<I>title3</I> arg = string
|
|
|
|
string = text to print as 3rd line of output file, only for vector mode
|
2007-10-19 06:02:20 +08:00
|
|
|
</PRE>
|
|
|
|
|
2007-02-21 08:18:41 +08:00
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
2008-07-03 22:59:09 +08:00
|
|
|
<PRE>fix 1 all ave/time 100 5 1000 c_myTemp c_thermo_temp file temp.profile
|
2009-12-12 05:41:25 +08:00
|
|
|
fix 1 all ave/time 100 5 1000 c_thermo_press[2] ave window 20 &
|
|
|
|
title1 "My output values"
|
|
|
|
fix 1 all ave/time 1 100 1000 f_indent f_indent[1] file temp.indent off 1
|
2007-02-21 08:18:41 +08:00
|
|
|
</PRE>
|
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>Use one or more global values as inputs every few timesteps, and
|
|
|
|
average them over longer timescales. The resulting averages can be
|
|
|
|
used by other <A HREF = "Section_howto.html#4_15">output commands</A> such as
|
|
|
|
<A HREF = "thermo_style.html">thermo_style custom</A>, and can also be written to a
|
|
|
|
file. Note that if no time averaging is done, this command can be
|
|
|
|
used as a convenient way to simply output one or more global values to
|
|
|
|
a file.
|
2009-12-12 05:41:25 +08:00
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>The group specified with this command is ignored. However, note that
|
|
|
|
calculations may be performed by computes and fixes which store their
|
|
|
|
own "group" definitions.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>Each input value can be the result of a <A HREF = "compute.html">compute</A> or
|
2008-01-03 03:25:15 +08:00
|
|
|
<A HREF = "fix.html">fix</A> or the evaluation of an equal-style
|
|
|
|
<A HREF = "variable.html">variable</A>. In each case, the compute, fix, or variable
|
2009-12-15 09:21:23 +08:00
|
|
|
must produce a global quantity, not a per-atom or local quantity. If
|
|
|
|
you wish to spatial- or time-average or histogram per-atom quantities
|
|
|
|
from a compute, fix, or variable, then see the <A HREF = "fix_ave_spatial.html">fix
|
|
|
|
ave/spatial</A>, <A HREF = "fix_ave_atom.html">fix ave/atom</A>,
|
|
|
|
or <A HREF = "fix_ave_histo.html">fix ave/histo</A> commands. If you wish to sum a
|
2008-02-26 00:06:38 +08:00
|
|
|
per-atom quantity into a single global quantity, see the <A HREF = "compute_reduce.html">compute
|
|
|
|
reduce</A> command.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<P><A HREF = "compute.html">Computes</A> that produce global quantities are those which
|
|
|
|
do not have the word <I>atom</I> in their style name. Only a few
|
|
|
|
<A HREF = "fix.html">fixes</A> produce global quantities. See the doc pages for
|
|
|
|
individual fixes for info on which ones produce such values.
|
|
|
|
<A HREF = "variable.html">Variables</A> of style <I>equal</I> are the only ones that can
|
|
|
|
be used with this fix. Variables of style <I>atom</I> cannot be used,
|
|
|
|
since they produce per-atom values.
|
2007-02-21 08:18:41 +08:00
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>The listed values must either be all scalars or all vectors, depending
|
|
|
|
on the setting of the <I>mode</I> option. In both cases, the averaging is
|
|
|
|
performed independently on each input value. I.e. each input scalar
|
|
|
|
or the elements of each input vector is averaged independently.
|
2009-12-12 05:41:25 +08:00
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>If <I>mode</I> = vector, then all the input vectors must be the same
|
|
|
|
length.
|
2009-12-12 05:41:25 +08:00
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<HR>
|
|
|
|
|
2007-10-19 06:02:20 +08:00
|
|
|
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what
|
2009-12-15 09:21:23 +08:00
|
|
|
timesteps the input values will be used in order to contribute to the
|
2008-01-03 03:25:15 +08:00
|
|
|
average. The final averaged quantities are generated every <I>Nfreq</I>
|
|
|
|
timesteps. The average is over <I>Nrepeat</I> quantities, computed in the
|
2008-05-27 22:03:44 +08:00
|
|
|
preceding portion of the simulation every <I>Nevery</I> timesteps. <I>Nfreq</I>
|
|
|
|
must be a multiple of <I>Nevery</I> and <I>Nevery</I> must be non-zero even if
|
|
|
|
<I>Nrepeat</I> is 1. Also, the timesteps contributing to the average value
|
|
|
|
cannot overlap, i.e. Nfreq > (Nrepeat-1)*Nevery is required.
|
2007-10-10 02:24:42 +08:00
|
|
|
</P>
|
2007-10-19 06:02:20 +08:00
|
|
|
<P>For example, 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
|
2008-03-01 09:13:20 +08:00
|
|
|
on timestep 100. Similarly for timesteps 190,192,194,196,198,200 on
|
2008-01-03 03:25:15 +08:00
|
|
|
timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time
|
|
|
|
averaging is done; values are simply generated on timesteps
|
|
|
|
100,200,etc.
|
2007-10-10 02:24:42 +08:00
|
|
|
</P>
|
2007-10-19 06:02:20 +08:00
|
|
|
<HR>
|
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
<P>If a value begins with "c_", a compute ID must follow which has been
|
2009-12-12 05:41:25 +08:00
|
|
|
previously defined in the input script. If <I>mode</I> = scalar, then if
|
|
|
|
no bracketed term is appended, the global scalar calculated by the
|
|
|
|
compute is used. If a bracketed term is appended, the Ith element of
|
|
|
|
the global vector calculated by the compute is used. If <I>mode</I> =
|
|
|
|
vector, then if no bracketed term is appended, the global vector
|
|
|
|
calculated by the compute is used. If a bracketed term is appended,
|
|
|
|
the Ith column of the global array calculated by the compute is used.
|
|
|
|
</P>
|
|
|
|
<P>Note that there is a <A HREF = "compute_reduce.html">compute reduce</A> command
|
|
|
|
which can sum per-atom quantities into a global scalar or vector which
|
|
|
|
can thus be accessed by fix ave/time. Or it can be a compute defined
|
|
|
|
not in your input script, but by <A HREF = "thermo_style.html">thermodynamic
|
|
|
|
output</A> or other fixes such as <A HREF = "fix_nvt.html">fix
|
|
|
|
nvt</A> or <A HREF = "fix_temp_rescale.html">fix temp/rescale</A>. See
|
|
|
|
the doc pages for these commands which give the IDs of these computes.
|
|
|
|
Users can also write code for their own compute styles and <A HREF = "Section_modify.html">add them
|
|
|
|
to LAMMPS</A>.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<P>If a value begins with "f_", a fix ID must follow which has been
|
2009-12-12 05:41:25 +08:00
|
|
|
previously defined in the input script. If <I>mode</I> = scalar, then if
|
|
|
|
no bracketed term is appended, the global scalar calculated by the fix
|
|
|
|
is used. If a bracketed term is appended, the Ith element of the
|
|
|
|
global vector calculated by the fix is used. If <I>mode</I> = vector, then
|
|
|
|
if no bracketed term is appended, the global vector calculated by the
|
|
|
|
fix is used. If a bracketed term is appended, the Ith column of the
|
|
|
|
global array calculated by the fix is used.
|
|
|
|
</P>
|
|
|
|
<P>Note that some fixes only produce their values on certain timesteps,
|
|
|
|
which must be compatible with <I>Nevery</I>, else an error will result.
|
|
|
|
Users can also write code for their own fix styles and <A HREF = "Section_modify.html">add them to
|
|
|
|
LAMMPS</A>.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<P>If a value begins with "v_", a variable name must follow which has
|
2009-12-12 05:41:25 +08:00
|
|
|
been previously defined in the input script. Variables can only be
|
|
|
|
used as input for <I>mode</I> = scalar. Only equal-style variables can be
|
|
|
|
referenced. See the <A HREF = "variable.html">variable</A> command for details.
|
|
|
|
Note that variables of style <I>equal</I> define a formula which can
|
2008-01-03 03:25:15 +08:00
|
|
|
reference individual atom properties or thermodynamic keywords, or
|
|
|
|
they can invoke other computes, fixes, or variables when they are
|
2009-12-12 05:41:25 +08:00
|
|
|
evaluated, so this is a very general means of specifying quantities to
|
2008-01-03 03:25:15 +08:00
|
|
|
time average.
|
2007-10-19 06:02:20 +08:00
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>Additional optional keywords also affect the operation of this fix.
|
2007-10-19 06:02:20 +08:00
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>If the <I>mode</I> keyword is set to <I>scalar</I>, then all input values must
|
|
|
|
be global scalars, or elements of global vectors. If the <I>mode</I>
|
|
|
|
keyword is set to <I>vector</I>, then all input values must be global
|
|
|
|
vectors, or columns of global arrays.
|
|
|
|
</P>
|
2009-12-12 05:41:25 +08:00
|
|
|
<P>The <I>ave</I> keyword determines how the values produced every <I>Nfreq</I>
|
|
|
|
steps are averaged with values produced on previous steps that were
|
|
|
|
multiples of <I>Nfreq</I>, before they are accessed by another output
|
|
|
|
command or written to a file.
|
2007-10-19 06:02:20 +08:00
|
|
|
</P>
|
|
|
|
<P>If the <I>ave</I> setting is <I>one</I>, then the values produced on timesteps
|
|
|
|
that are multiples of <I>Nfreq</I> are independent of each other; they are
|
|
|
|
output as-is without further averaging.
|
|
|
|
</P>
|
|
|
|
<P>If the <I>ave</I> setting is <I>running</I>, then the values produced on
|
|
|
|
timesteps that are multiples of <I>Nfreq</I> are summed and averaged in a
|
2008-03-01 09:13:20 +08:00
|
|
|
cumulative sense before being output. Each output value is thus the
|
|
|
|
average of the value produced on that timestep with all preceding
|
2007-10-19 06:27:53 +08:00
|
|
|
values. This running average begins when the fix is defined; it can
|
|
|
|
only be restarted by deleting the fix via the <A HREF = "unfix.html">unfix</A>
|
2008-01-03 03:25:15 +08:00
|
|
|
command, or by re-defining the fix by re-specifying it.
|
2007-10-19 06:02:20 +08:00
|
|
|
</P>
|
|
|
|
<P>If the <I>ave</I> setting is <I>window</I>, then the values produced on
|
|
|
|
timesteps that are multiples of <I>Nfreq</I> are summed and averaged within
|
|
|
|
a moving "window" of time, so that the last M values are used to
|
|
|
|
produce the output. E.g. if M = 3 and Nfreq = 1000, then the output
|
|
|
|
on step 10000 will be the average of the individual values on steps
|
|
|
|
8000,9000,10000. Outputs on early steps will average over less than M
|
|
|
|
values if they are not available.
|
2007-02-21 08:18:41 +08:00
|
|
|
</P>
|
2008-03-04 05:52:06 +08:00
|
|
|
<P>The <I>start</I> keyword specifies what timestep averaging will begin on.
|
2009-12-12 05:41:25 +08:00
|
|
|
The default is step 0. Often input values can be 0.0 at time 0, so
|
|
|
|
setting <I>start</I> to a larger value can avoid including a 0.0 in a
|
|
|
|
running or windowed average.
|
|
|
|
</P>
|
|
|
|
<P>The <I>off</I> keyword can be used to flag any of the input values. If a
|
|
|
|
value is flagged, it will not be time averaged. Instead the most
|
|
|
|
recent input value will always be stored and output. This is useful
|
|
|
|
if one of more of the inputs produced by a compute or fix or variable
|
|
|
|
are effectively constant or are simply current values. E.g. they are
|
|
|
|
being written to a file with other time-averaged values for purposes
|
|
|
|
of creating well-formatted output.
|
|
|
|
</P>
|
|
|
|
<P>The <I>file</I> keyword allows a filename to be specified. Every <I>Nfreq</I>
|
|
|
|
steps, one quantity or vector of quantities is written to the file for
|
|
|
|
each input value specified in the fix ave/time command. For <I>mode</I> =
|
|
|
|
scalar, this means a single line is written each time output is
|
|
|
|
performed. Thus the file ends up to be a series of lines, i.e. one
|
|
|
|
column of numbers for each input value. For <I>mode</I> = vector, an array
|
|
|
|
of numbers is written each time output is performed. The number of
|
|
|
|
rows is the length of the input vectors, and the number of columns is
|
|
|
|
the number of values. Thus the file ends up to be a series of these
|
|
|
|
array sections.
|
|
|
|
</P>
|
|
|
|
<P>The <I>title1</I> and <I>title2</I> and <I>title3</I> keywords allow specification of
|
|
|
|
the strings that will be printed as the first 2 or 3 lines of the
|
|
|
|
output file, assuming the <I>file</I> keyword was used. LAMMPS uses
|
|
|
|
default values for each of these, so they do not need to be specified.
|
|
|
|
</P>
|
|
|
|
<P>By default, these header lines are as follows for <I>mode</I> = scalar:
|
|
|
|
</P>
|
|
|
|
<PRE># Time-averaged data for fix ID
|
|
|
|
# TimeStep value1 value2 ...
|
|
|
|
</PRE>
|
|
|
|
<P>In the first line, ID is replaced with the fix-ID. In the second line
|
|
|
|
the values are replaced with the appropriate fields from the fix
|
|
|
|
ave/time command. There is no third line in the header of the file,
|
|
|
|
so the <I>title3</I> setting is ignored when <I>mode</I> = scalar.
|
|
|
|
</P>
|
|
|
|
<P>By default, these header lines are as follows for <I>mode</I> = vector:
|
|
|
|
</P>
|
|
|
|
<PRE># Time-averaged data for fix ID
|
|
|
|
# TimeStep Number-of-rows
|
|
|
|
# Row value1 value2 ...
|
|
|
|
</PRE>
|
|
|
|
<P>In the first line, ID is replaced with the fix-ID. The second line
|
|
|
|
describes the two values that are printed at the first of each section
|
|
|
|
of output. In the third line the values are replaced with the
|
|
|
|
appropriate fields from the fix ave/time command.
|
2008-03-04 05:52:06 +08:00
|
|
|
</P>
|
2007-10-19 06:02:20 +08:00
|
|
|
<HR>
|
|
|
|
|
2007-10-11 06:28:11 +08:00
|
|
|
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
|
2007-06-26 08:03:39 +08:00
|
|
|
</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
|
2007-10-15 23:07:59 +08:00
|
|
|
are relevant to this fix.
|
|
|
|
</P>
|
2009-12-12 05:41:25 +08:00
|
|
|
<P>This fix produces a global scalar or vector or array which can be
|
|
|
|
accessed by various <A HREF = "Section_howto.html#4_15">output commands</A>. The
|
|
|
|
values can only be accessed on timesteps that are multiples of <I>Nfreq</I>
|
|
|
|
since that is when averaging is performed.
|
|
|
|
</P>
|
|
|
|
<P>A scalar is produced if only a single input value is averaged and
|
|
|
|
<I>mode</I> = scalar. A vector is produced if multiple input values are
|
|
|
|
averaged for <I>mode</I> = scalar, or a single input value for <I>mode</I> =
|
|
|
|
vector. In the first case, the length of the vector is the number of
|
|
|
|
inputs. In the second case, the length of the vector is the same as
|
|
|
|
the length of the input vector. An array is produced if multiple
|
2009-12-15 09:21:23 +08:00
|
|
|
input values are averaged and <I>mode</I> = vector. The global array has #
|
|
|
|
of rows = length of the input vectors and # of columns = number of
|
|
|
|
inputs.
|
2009-12-12 05:41:25 +08:00
|
|
|
</P>
|
|
|
|
<P>If the fix prouduces a scalar or vector, then the scalar and each
|
|
|
|
element of the vector may be either "intensive" or "extensive". If
|
|
|
|
the fix produces an array, then all elements in the array will be
|
|
|
|
either "intensive" or "extensive". Intensive means the value is
|
|
|
|
independent of the number of atoms in the simulation. Extensive means
|
|
|
|
the value scales with the number of atoms in the simulation. If a
|
|
|
|
compute or fix provides the value being time averaged, then the
|
|
|
|
compute or fix determines whether the value is intensive or extensive;
|
|
|
|
see the doc page for that compute or fix for further info. Values
|
|
|
|
produced by a variable are whatever the variable calculates.
|
2007-10-15 23:07:59 +08:00
|
|
|
</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>.
|
2007-06-26 08:03:39 +08:00
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<P><B>Restrictions:</B> none
|
2007-02-21 08:18:41 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P><A HREF = "compute.html">compute</A>, <A HREF = "fix_ave_atom.html">fix ave/atom</A>, <A HREF = "fix_ave_spatial.html">fix
|
|
|
|
ave/spatial</A>, <A HREF = "fix_ave_histo.html">fix ave/histo</A>,
|
|
|
|
<A HREF = "variable.html">variable</A>
|
2007-02-21 08:18:41 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Default:</B> none
|
|
|
|
</P>
|
2009-12-12 05:41:25 +08:00
|
|
|
<P>The option defaults are mode = scalar, ave = one, start = 0, no file
|
|
|
|
output, title 1,2,3 = strings as described above, and no off settings
|
|
|
|
for any input values.
|
2007-10-19 06:02:20 +08:00
|
|
|
</P>
|
2007-02-21 08:18:41 +08:00
|
|
|
</HTML>
|