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

This commit is contained in:
sjplimp
2009-12-09 21:20:59 +00:00
parent 8b6877e6d0
commit d5334c038f
14 changed files with 890 additions and 548 deletions

View File

@ -28,40 +28,90 @@ compute 3 all ke/atom
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Create a computation that will be performed on a group of atoms. <P>Define a computation that will be performed on a group of atoms.
Quantities calculated by a compute are instantaneous values, meaning Quantities calculated by a compute are instantaneous values, meaning
they are calculated from information about atoms on the current they are calculated from information about atoms on the current
timestep or iteration. There are two kinds of computes, "global" timestep or iteration, though a compute may internally store some
computes that calculate one or more values for the entire group of information about a previous state of the system.
atoms, and "per-atom" computes that calculate one or more values for
each atom in the group. The latter has the word "atom" in its style
name.
</P>
<P>In LAMMPS, a "compute" can be used in several ways. The results of
global computes can be output via the <A HREF = "thermo_style.html">thermo_style
custom</A> or <A HREF = "fix_ave_time.html">fix ave/time</A> command.
Or the values can be referenced in a <A HREF = "variable.html">variable equal</A> or
<A HREF = "variable.html">variable atom</A> command. The results of computes that
calculate a global temperature or pressure can be used by fixes that
do thermostatting or barostatting and when atom velocities are
created.
</P>
<P>The results of per-atom computes that calculate a per-atom vector or
array can be output via the <A HREF = "dump.html">dump custom</A> command or the
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command. Or the per-atom
values can be time-averaged via the <A HREF = "fix_ave_atom.html">fix ave/atom</A>
command and then output via the <A HREF = "dump.html">dump custom</A> or <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> commands. Or the per-atom values
can be referenced in a <A HREF = "variable.html">variable atom</A> command. Note
that the value of per-atom computes will be 0.0 for atoms not in the
specified compute group.
</P>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options, many of which involve computes.
</P> </P>
<P>The ID of a compute can only contain alphanumeric characters and <P>The ID of a compute can only contain alphanumeric characters and
underscores. underscores.
</P> </P>
<HR>
<P>Computes calculate one of three styles of quantities: global,
per-atom, or local. A global quantity is one or more system-wide
values, e.g. the temperature of the system. A per-atom quantity is
one or more values per atom, e.g. the kinetic energy of each atom.
Per-atom values are set to 0.0 for atoms not in the specified compute
group. Local quantities are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances. Computes that produce per-atom quantities have the
word "atom" in their style, e.g. <I>ke/atom</I>. Computes that produce
local quantities have the word "local" in their style,
e.g. <I>bond/local</I>. Styles with neither "atom" or "local" in their
style produce global quantities.
</P>
<P>Note that a single compute produces either global or per-atom or local
quantities, but never more than one of these.
</P>
<P>Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each compute describes the style and kind of values it
produces, e.g. a per-atom vector. Some computes produce more than one
kind of a single style, e.g. a global scalar and a global vector.
</P>
<P>When a compute quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the compute:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >c_ID </TD><TD > entire scalar, vector, or array</TD></TR>
<TR><TD >c_ID[I] </TD><TD > one element of vector, one column of array</TD></TR>
<TR><TD >c_ID[I][J] </TD><TD > one element of array
</TD></TR></TABLE></DIV>
<P>In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets
reduces the dimension twice (array -> scalar). Thus a command that
uses scalar compute values as input can also process elements of a
vector or array.
</P>
<P>Note that commands and <A HREF = "variable.html">variables</A> which use compute
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a compute quantity as c_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
</P>
<HR>
<P>In LAMMPS, the values generated by a compute can be used in several
ways:
</P>
<UL><LI>The results of computes that calculate a global temperature or
pressure can be used by fixes that do thermostatting or barostatting
or when atom velocities are created.
<LI>Global values can be output via the <A HREF = "thermo_style.html">thermo_style
custom</A> or <A HREF = "fix_ave_time.html">fix ave/time</A> command.
Or the values can be referenced in a <A HREF = "variable.html">variable equal</A> or
<A HREF = "variable.html">variable atom</A> command.
<LI>Per-atom values can be output via the <A HREF = "dump.html">dump custom</A> command
or the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command. Or they can be
time-averaged via the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command or
reduced by the <A HREF = "compute_reduce.html">compute reduce</A> command. Or the
per-atom values can be referenced in an <A HREF = "variable.html">atom-style
variable</A>.
<LI>Local values can be reduced by the <A HREF = "compute_reduce.html">compute
reduce</A> command, or histogrammed by the <A HREF = "fix_ave_histo.html">fix
ave/histo</A> command.
</UL>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options, many of which involve computes.
</P>
<P>The results of computes that calculate global quantities can be either <P>The results of computes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is "intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, independent of the number of atoms in the simulation,
@ -74,7 +124,9 @@ compute value is accessed in another way, e.g. by a
intensive or extensive value. See the doc page for individual intensive or extensive value. See the doc page for individual
computes for further info. computes for further info.
</P> </P>
<P>LAMMPS creates its own global computes for thermodynamic output. <HR>
<P>LAMMPS creates its own computes internally for thermodynamic output.
Three computes are always created, named "thermo_temp", Three computes are always created, named "thermo_temp",
"thermo_press", and "thermo_pe", as if these commands had been invoked "thermo_press", and "thermo_pe", as if these commands had been invoked
in the input script: in the input script:
@ -91,10 +143,10 @@ style requires it. See the documentation for the
or barostatting, may also create computes. These are discussed in the or barostatting, may also create computes. These are discussed in the
documentation for specific <A HREF = "fix.html">fix</A> commands. documentation for specific <A HREF = "fix.html">fix</A> commands.
</P> </P>
<P>In all these cases, the default computes can be replaced by computes <P>In all these cases, the default computes LAMMPS creates can be
defined by the user in the input script, as described by the replaced by computes defined by the user in the input script, as
<A HREF = "thermo_modify.html">thermo_modify</A> and <A HREF = "fix_modify.html">fix modify</A> described by the <A HREF = "thermo_modify.html">thermo_modify</A> and <A HREF = "fix_modify.html">fix
commands. modify</A> commands.
</P> </P>
<P>Properties of either a default or user-defined compute can be modified <P>Properties of either a default or user-defined compute can be modified
via the <A HREF = "compute_modify.html">compute_modify</A> command. via the <A HREF = "compute_modify.html">compute_modify</A> command.
@ -105,6 +157,8 @@ via the <A HREF = "compute_modify.html">compute_modify</A> command.
section</A> of the manual) and the results of their section</A> of the manual) and the results of their
calculations accessed in the various ways described above. calculations accessed in the various ways described above.
</P> </P>
<HR>
<P>Each compute style has its own doc page which describes its arguments <P>Each compute style has its own doc page which describes its arguments
and what it does. Here is an alphabetic list of compute styles and what it does. Here is an alphabetic list of compute styles
available in LAMMPS: available in LAMMPS:

View File

@ -25,40 +25,88 @@ compute 3 all ke/atom :pre
[Description:] [Description:]
Create a computation that will be performed on a group of atoms. Define a computation that will be performed on a group of atoms.
Quantities calculated by a compute are instantaneous values, meaning Quantities calculated by a compute are instantaneous values, meaning
they are calculated from information about atoms on the current they are calculated from information about atoms on the current
timestep or iteration. There are two kinds of computes, "global" timestep or iteration, though a compute may internally store some
computes that calculate one or more values for the entire group of information about a previous state of the system.
atoms, and "per-atom" computes that calculate one or more values for
each atom in the group. The latter has the word "atom" in its style
name.
In LAMMPS, a "compute" can be used in several ways. The results of
global computes can be output via the "thermo_style
custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command.
Or the values can be referenced in a "variable equal"_variable.html or
"variable atom"_variable.html command. The results of computes that
calculate a global temperature or pressure can be used by fixes that
do thermostatting or barostatting and when atom velocities are
created.
The results of per-atom computes that calculate a per-atom vector or
array can be output via the "dump custom"_dump.html command or the
"fix ave/spatial"_fix_ave_spatial.html command. Or the per-atom
values can be time-averaged via the "fix ave/atom"_fix_ave_atom.html
command and then output via the "dump custom"_dump.html or "fix
ave/spatial"_fix_ave_spatial.html commands. Or the per-atom values
can be referenced in a "variable atom"_variable.html command. Note
that the value of per-atom computes will be 0.0 for atoms not in the
specified compute group.
See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options, many of which involve computes.
The ID of a compute can only contain alphanumeric characters and The ID of a compute can only contain alphanumeric characters and
underscores. underscores.
:line
Computes calculate one of three styles of quantities: global,
per-atom, or local. A global quantity is one or more system-wide
values, e.g. the temperature of the system. A per-atom quantity is
one or more values per atom, e.g. the kinetic energy of each atom.
Per-atom values are set to 0.0 for atoms not in the specified compute
group. Local quantities are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances. Computes that produce per-atom quantities have the
word "atom" in their style, e.g. {ke/atom}. Computes that produce
local quantities have the word "local" in their style,
e.g. {bond/local}. Styles with neither "atom" or "local" in their
style produce global quantities.
Note that a single compute produces either global or per-atom or local
quantities, but never more than one of these.
Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each compute describes the style and kind of values it
produces, e.g. a per-atom vector. Some computes produce more than one
kind of a single style, e.g. a global scalar and a global vector.
When a compute quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the compute:
c_ID | entire scalar, vector, or array
c_ID\[I\] | one element of vector, one column of array
c_ID\[I\]\[J\] | one element of array :tb(s=|)
In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets
reduces the dimension twice (array -> scalar). Thus a command that
uses scalar compute values as input can also process elements of a
vector or array.
Note that commands and "variables"_variable.html which use compute
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a compute quantity as c_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
:line
In LAMMPS, the values generated by a compute can be used in several
ways:
The results of computes that calculate a global temperature or
pressure can be used by fixes that do thermostatting or barostatting
or when atom velocities are created. :ulb,l
Global values can be output via the "thermo_style
custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command.
Or the values can be referenced in a "variable equal"_variable.html or
"variable atom"_variable.html command. :l
Per-atom values can be output via the "dump custom"_dump.html command
or the "fix ave/spatial"_fix_ave_spatial.html command. Or they can be
time-averaged via the "fix ave/atom"_fix_ave_atom.html command or
reduced by the "compute reduce"_compute_reduce.html command. Or the
per-atom values can be referenced in an "atom-style
variable"_variable.html. :l
Local values can be reduced by the "compute
reduce"_compute_reduce.html command, or histogrammed by the "fix
ave/histo"_fix_ave_histo.html command. :l,ule
See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options, many of which involve computes.
The results of computes that calculate global quantities can be either The results of computes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is "intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, independent of the number of atoms in the simulation,
@ -71,7 +119,9 @@ compute value is accessed in another way, e.g. by a
intensive or extensive value. See the doc page for individual intensive or extensive value. See the doc page for individual
computes for further info. computes for further info.
LAMMPS creates its own global computes for thermodynamic output. :line
LAMMPS creates its own computes internally for thermodynamic output.
Three computes are always created, named "thermo_temp", Three computes are always created, named "thermo_temp",
"thermo_press", and "thermo_pe", as if these commands had been invoked "thermo_press", and "thermo_pe", as if these commands had been invoked
in the input script: in the input script:
@ -88,10 +138,10 @@ Fixes that calculate temperature or pressure, i.e. for thermostatting
or barostatting, may also create computes. These are discussed in the or barostatting, may also create computes. These are discussed in the
documentation for specific "fix"_fix.html commands. documentation for specific "fix"_fix.html commands.
In all these cases, the default computes can be replaced by computes In all these cases, the default computes LAMMPS creates can be
defined by the user in the input script, as described by the replaced by computes defined by the user in the input script, as
"thermo_modify"_thermo_modify.html and "fix modify"_fix_modify.html described by the "thermo_modify"_thermo_modify.html and "fix
commands. modify"_fix_modify.html commands.
Properties of either a default or user-defined compute can be modified Properties of either a default or user-defined compute can be modified
via the "compute_modify"_compute_modify.html command. via the "compute_modify"_compute_modify.html command.
@ -102,6 +152,8 @@ Code for new computes can be added to LAMMPS (see "this
section"_Section_modify.html of the manual) and the results of their section"_Section_modify.html of the manual) and the results of their
calculations accessed in the various ways described above. calculations accessed in the various ways described above.
:line
Each compute style has its own doc page which describes its arguments Each compute style has its own doc page which describes its arguments
and what it does. Here is an alphabetic list of compute styles and what it does. Here is an alphabetic list of compute styles
available in LAMMPS: available in LAMMPS:

View File

@ -25,17 +25,17 @@
<I>reduce/region</I> arg = region-ID <I>reduce/region</I> arg = region-ID
region-ID = ID of region to use for choosing atoms region-ID = ID of region to use for choosing atoms
</PRE> </PRE>
<LI>mode = <I>sum</I> or <I>min</I> or <I>max</I> <LI>mode = <I>sum</I> or <I>min</I> or <I>max</I> or <I>ave</I>
<LI>one or more inputs can be listed <LI>one or more inputs can be listed
<LI>input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name <LI>input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name
<PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component) <PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component)
c_ID = per-atom vector value calculated by a compute with ID c_ID = vector calculated by a compute with ID
c_ID[N] = Nth column of per-atom array calculated by a compute with ID c_ID[I] = Ith column of array calculated by a compute with ID
f_ID = per-atom vector value calculated by a fix with ID f_ID = vector calculated by a fix with ID
f_ID[N] = Nth column of per-atom array calculated by a fix with ID f_ID[I] = Ith column of array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name v_name = per-atom vector calculated by an atom-style variable with name
</PRE> </PRE>
@ -48,37 +48,63 @@ compute 2 all reduce min c_press<B>2</B> f_ave v_myKE
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Define a calculation that "reduces" one or more per-atom inputs across <P>Define a calculation that "reduces" one or more vector inputs into
all atoms in the group to yield a single global scalar for each listed scalar values, one per listed input. The inputs can be global,
input. If the compute reduce/region command is used, the selection of per-atom, or local quantities. Atom attributes are per-atom
atoms is limited to atoms in the region as well as in the group. quantities, <A HREF = "compute.html">computes</A> and <A HREF = "fix.html">fixes</A> may generate
any of the three kinds of quantities, and <A HREF = "variable.html">atom-style
variables</A> generate per-atom quantities.
</P> </P>
<P>The reduction operation is specified by the <I>mode</I> setting. The <I>sum</I> <P>The reduction operation is specified by the <I>mode</I> setting. The <I>sum</I>
option adds the per-atom quantities into a global total. The <I>min</I> or option adds the values in the vector into a global total. The <I>min</I>
<I>max</I> options find the minimum or maximum value across all per-atom or <I>max</I> options find the minimum or maximum value across all vector
quantities. values. The <I>ave</I> setting adds the vector values into a global total,
then divides by the number of values in the vector.
</P> </P>
<P>Each listed input is operated on independently. The group specified <P>Each listed input is operated on independently. For per-atom inputs,
with the command means only atoms within the group contribute to the the group specified with this command means only atoms within the
result. If the compute reduce/region command is used, the atoms must group contribute to the result. For per-atom inputs, if the compute
also be within the region. Note that the input that produces the reduce/region command is used, the atoms must also currently be within
per-atom quantities may define its own group which affects the the region. Note that an input that produces per-atom quantities may
quantities it returns. For example, if a per-atom compute is used as define its own group which affects the quantities it returns. For
an input, it will generate values of 0.0 for atoms that are not in the example, if a compute is used as an input which generates a per-atom
vector, it will generate values of 0.0 for atoms that are not in the
group specified for that compute. group specified for that compute.
</P> </P>
<P>Each listed input can be an atom attribute (position, velocity, force <P>Each listed input can be an atom attribute (position, velocity, force
component) or can be the result of a <A HREF = "compute.html">compute</A> or component) or can be the result of a <A HREF = "compute.html">compute</A> or
<A HREF = "fix.html">fix</A> or the evaluation of an atom-style <A HREF = "fix.html">fix</A> or the evaluation of an atom-style
<A HREF = "variable.html">variable</A>. In the latter cases, the compute, fix, or <A HREF = "variable.html">variable</A>.
variable must produce per-atom quantities, not a global quantity.
</P> </P>
<P><A HREF = "compute.html">Computes</A> that produce per-atom quantities are those <P>Atom attributes are per-atom inputs.
which have the word <I>atom</I> in their style name. See the doc pages for </P>
individual <A HREF = "fix.html">fixes</A> to determine which ones produce per-atom <P>If a value begins with "c_", a compute ID must follow which has been
quantities. <A HREF = "variable.html">Variables</A> of style <I>atom</I> are the only previously defined in the input script. Computes can generate global,
ones that can be used with this compute since all other variable per-atom, or local quantities. See the individual
styles produce global quantities. <A HREF = "compute.html">compute</A> doc page for details. If no bracketed integer
is appended, the vector calculated by the compute is used. If a
bracketed interger is appended, the Ith column of the array calculated
by the compute is used. Users can also write code for their own
compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P>
<P>If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. Fixes can generate global,
per-atom, or local quantities. See the individual <A HREF = "fix.html">fix</A> doc
page for details. Note that some fixes only produce their values on
certain timesteps, which must be compatible with when compute reduce
references the values, else an error results. If no bracketed integer
is appended, the vector calculated by the fix is used. If a bracketed
integer is appended, the Ith column of the array calculated by the fix
is used. Users can also write code for their own fix style and <A HREF = "Section_modify.html">add
them to LAMMPS</A>.
</P>
<P>If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. It must be an
<A HREF = "variable.html">atom-style variable</A>. Atom-style variables can
reference thermodynamic keywords and various per-atom attributes, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
reduce.
</P> </P>
<P>If a single input is specified this compute produces a global scalar <P>If a single input is specified this compute produces a global scalar
value. If multiple inputs are specified, this compute produces a value. If multiple inputs are specified, this compute produces a
@ -97,15 +123,15 @@ divides by the appropriate atom count.
</P> </P>
<P>This compute calculates a global scalar or global vector of length N <P>This compute calculates a global scalar or global vector of length N
where N is the number of inputs, and which can be accessed by indices where N is the number of inputs, and which can be accessed by indices
1-6. These values can be used by any command that uses global scalar 1-N. These values can be used by any command that uses global scalar
or vector values from a compute as input. See <A HREF = "Section_howto.html#4_15">this or vector values from a compute as input. See <A HREF = "Section_howto.html#4_15">this
section</A> for an overview of LAMMPS output section</A> for an overview of LAMMPS output
options. options.
</P> </P>
<P>For <I>sum</I> mode, the scalar and vector values calculated by this <P>For <I>sum</I> mode, the scalar and vector values calculated by this
compute are "extensive", meaning they scale with the number of atoms compute are "extensive", meaning they scale with the number of atoms
in the simulation. For <I>min</I> and <I>max</I> modes, the value(s) are in the simulation. For <I>min</I> or <I>max</I> or <I>ave</I> modes, the value(s)
intensive. are intensive.
</P> </P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>

View File

@ -18,14 +18,14 @@ style = {reduce} or {reduce/region} :l
{reduce} arg = none {reduce} arg = none
{reduce/region} arg = region-ID {reduce/region} arg = region-ID
region-ID = ID of region to use for choosing atoms :pre region-ID = ID of region to use for choosing atoms :pre
mode = {sum} or {min} or {max} :l mode = {sum} or {min} or {max} or {ave} :l
one or more inputs can be listed :l one or more inputs can be listed :l
input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component) x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component)
c_ID = per-atom vector value calculated by a compute with ID c_ID = vector calculated by a compute with ID
c_ID\[N\] = Nth column of per-atom array calculated by a compute with ID c_ID\[I\] = Ith column of array calculated by a compute with ID
f_ID = per-atom vector value calculated by a fix with ID f_ID = vector calculated by a fix with ID
f_ID\[N\] = Nth column of per-atom array calculated by a fix with ID f_ID\[I\] = Ith column of array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre v_name = per-atom vector calculated by an atom-style variable with name :pre
:ule :ule
@ -37,37 +37,63 @@ compute 2 all reduce min c_press[2] f_ave v_myKE :pre
[Description:] [Description:]
Define a calculation that "reduces" one or more per-atom inputs across Define a calculation that "reduces" one or more vector inputs into
all atoms in the group to yield a single global scalar for each listed scalar values, one per listed input. The inputs can be global,
input. If the compute reduce/region command is used, the selection of per-atom, or local quantities. Atom attributes are per-atom
atoms is limited to atoms in the region as well as in the group. quantities, "computes"_compute.html and "fixes"_fix.html may generate
any of the three kinds of quantities, and "atom-style
variables"_variable.html generate per-atom quantities.
The reduction operation is specified by the {mode} setting. The {sum} The reduction operation is specified by the {mode} setting. The {sum}
option adds the per-atom quantities into a global total. The {min} or option adds the values in the vector into a global total. The {min}
{max} options find the minimum or maximum value across all per-atom or {max} options find the minimum or maximum value across all vector
quantities. values. The {ave} setting adds the vector values into a global total,
then divides by the number of values in the vector.
Each listed input is operated on independently. The group specified Each listed input is operated on independently. For per-atom inputs,
with the command means only atoms within the group contribute to the the group specified with this command means only atoms within the
result. If the compute reduce/region command is used, the atoms must group contribute to the result. For per-atom inputs, if the compute
also be within the region. Note that the input that produces the reduce/region command is used, the atoms must also currently be within
per-atom quantities may define its own group which affects the the region. Note that an input that produces per-atom quantities may
quantities it returns. For example, if a per-atom compute is used as define its own group which affects the quantities it returns. For
an input, it will generate values of 0.0 for atoms that are not in the example, if a compute is used as an input which generates a per-atom
vector, it will generate values of 0.0 for atoms that are not in the
group specified for that compute. group specified for that compute.
Each listed input can be an atom attribute (position, velocity, force Each listed input can be an atom attribute (position, velocity, force
component) or can be the result of a "compute"_compute.html or component) or can be the result of a "compute"_compute.html or
"fix"_fix.html or the evaluation of an atom-style "fix"_fix.html or the evaluation of an atom-style
"variable"_variable.html. In the latter cases, the compute, fix, or "variable"_variable.html.
variable must produce per-atom quantities, not a global quantity.
"Computes"_compute.html that produce per-atom quantities are those Atom attributes are per-atom inputs.
which have the word {atom} in their style name. See the doc pages for
individual "fixes"_fix.html to determine which ones produce per-atom If a value begins with "c_", a compute ID must follow which has been
quantities. "Variables"_variable.html of style {atom} are the only previously defined in the input script. Computes can generate global,
ones that can be used with this compute since all other variable per-atom, or local quantities. See the individual
styles produce global quantities. "compute"_compute.html doc page for details. If no bracketed integer
is appended, the vector calculated by the compute is used. If a
bracketed interger is appended, the Ith column of the array calculated
by the compute is used. Users can also write code for their own
compute styles and "add them to LAMMPS"_Section_modify.html.
If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. Fixes can generate global,
per-atom, or local quantities. See the individual "fix"_fix.html doc
page for details. Note that some fixes only produce their values on
certain timesteps, which must be compatible with when compute reduce
references the values, else an error results. If no bracketed integer
is appended, the vector calculated by the fix is used. If a bracketed
integer is appended, the Ith column of the array calculated by the fix
is used. Users can also write code for their own fix style and "add
them to LAMMPS"_Section_modify.html.
If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. It must be an
"atom-style variable"_variable.html. Atom-style variables can
reference thermodynamic keywords and various per-atom attributes, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
reduce.
If a single input is specified this compute produces a global scalar If a single input is specified this compute produces a global scalar
value. If multiple inputs are specified, this compute produces a value. If multiple inputs are specified, this compute produces a
@ -86,15 +112,15 @@ divides by the appropriate atom count.
This compute calculates a global scalar or global vector of length N This compute calculates a global scalar or global vector of length N
where N is the number of inputs, and which can be accessed by indices where N is the number of inputs, and which can be accessed by indices
1-6. These values can be used by any command that uses global scalar 1-N. These values can be used by any command that uses global scalar
or vector values from a compute as input. See "this or vector values from a compute as input. See "this
section"_Section_howto.html#4_15 for an overview of LAMMPS output section"_Section_howto.html#4_15 for an overview of LAMMPS output
options. options.
For {sum} mode, the scalar and vector values calculated by this For {sum} mode, the scalar and vector values calculated by this
compute are "extensive", meaning they scale with the number of atoms compute are "extensive", meaning they scale with the number of atoms
in the simulation. For {min} and {max} modes, the value(s) are in the simulation. For {min} or {max} or {ave} modes, the value(s)
intensive. are intensive.
[Restrictions:] none [Restrictions:] none

View File

@ -66,31 +66,6 @@ made to the old fix via the <A HREF = "fix_modify.html">fix_modify</A> command.
<P>The <A HREF = "fix_modify.html">fix modify</A> command allows settings for some <P>The <A HREF = "fix_modify.html">fix modify</A> command allows settings for some
fixes to be reset. See the doc page for individual fixes for details. fixes to be reset. See the doc page for individual fixes for details.
</P> </P>
<P>Some fixes calculate a global scalar or vector quantity which can be
accessed by various commands for output, including <A HREF = "variable.html">equal- and
atom-style variables</A>, <A HREF = "thermo_style.html">thermo_style
custom</A>, and <A HREF = "fix_ave_time.html">fix ave/time</A>.
</P>
<P>Some fixes calculate a per-atom vector or array quantity which can be
accessed by various commands for output, including <A HREF = "variable.html">atom-style
variables</A>, <A HREF = "dump.html">dump_style custom</A>, and <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A>.
</P>
<P>The results of fixes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, e.g. timestep
size. Extensive means the value scales with the number of atoms in
the simulation, e.g. total force applied by the fix. <A HREF = "thermo_style.html">Thermodynamic
output</A> will normalize extensive values depending on
the "thermo_modify norm" setting. But if a fix value is accessed in
another way, e.g. by a <A HREF = "variable.html">variable</A>, you may need to know
whether it is an intensive or extensive value. See the doc page for
individual fixes for further info.
</P>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options. See the doc pages for individual fixes
for info on which ones calculate these quantities.
</P>
<P>Some fixes store an internal "state" which is written to binary <P>Some fixes store an internal "state" which is written to binary
restart files via the <A HREF = "restart.html">restart</A> or restart files via the <A HREF = "restart.html">restart</A> or
<A HREF = "write_restart.html">write_restart</A> commands. This allows the fix to <A HREF = "write_restart.html">write_restart</A> commands. This allows the fix to
@ -99,6 +74,86 @@ continue on with its calculations in a restarted simulation. See the
a fix in an input script that reads a restart file. See the doc pages a fix in an input script that reads a restart file. See the doc pages
for individual fixes for info on which ones can be restarted. for individual fixes for info on which ones can be restarted.
</P> </P>
<HR>
<P>Some fixes calculate one of three styles of quantities: global,
per-atom, or local, which can be used by other commands or output as
described below. A global quantity is one or more system-wide values,
e.g. the energy of a wall interacting with particles. A per-atom
quantity is one or more values per atom, e.g. the displacement vector
for each atom since time 0. Per-atom values are set to 0.0 for atoms
not in the specified fix group. Local quantities are calculated by
each processor based on the atoms it owns, but there may be zero or
more per atoms.
</P>
<P>Note that a single fix may produces either global or per-atom or local
quantities (or none at all), but never more than one of these.
</P>
<P>Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each fix describes the style and kind of values it
produces, e.g. a per-atom vector. Some fixes produce more than one
kind of a single style, e.g. a global scalar and a global vector.
</P>
<P>When a fix quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the fix:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >f_ID </TD><TD > entire scalar, vector, or array</TD></TR>
<TR><TD >f_ID[I] </TD><TD > one element of vector, one column of array</TD></TR>
<TR><TD >f_ID[I][J] </TD><TD > one element of array
</TD></TR></TABLE></DIV>
<P>In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets
reduces the dimension twice (array -> scalar). Thus a command that
uses scalar fix values as input can also process elements of a vector
or array.
</P>
<P>Note that commands and <A HREF = "variable.html">variables</A> which use fix
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a fix quantity as f_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
</P>
<HR>
<P>In LAMMPS, the values generated by a fix can be used in several ways:
</P>
<UL><LI>Global values can be output via the <A HREF = "thermo_style.html">thermo_style
custom</A> or <A HREF = "fix_ave_time.html">fix ave/time</A> command.
Or the values can be referenced in a <A HREF = "variable.html">variable equal</A> or
<A HREF = "variable.html">variable atom</A> command.
<LI>Per-atom values can be output via the <A HREF = "dump.html">dump custom</A> command
or the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command. Or they can be
time-averaged via the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command or
reduced by the <A HREF = "compute_reduce.html">compute reduce</A> command. Or the
per-atom values can be referenced in an <A HREF = "variable.html">atom-style
variable</A>.
<LI>Local values can be reduced by the <A HREF = "compute_reduce.html">compute
reduce</A> command, or histogrammed by the <A HREF = "fix_ave_histo.html">fix
ave/histo</A> command.
</UL>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options, many of which involve fixes.
</P>
<P>The results of fixes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation,
e.g. temperature. Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy.
<A HREF = "thermo_style.html">Thermodynamic output</A> will normalize extensive
values depending on the "thermo_modify norm" setting. But if a fix
value is accessed in another way, e.g. by a <A HREF = "variable.html">variable</A>,
you may need to know whether it is an intensive or extensive value.
See the doc page for individual fixes for further info.
</P>
<HR>
<P>Each fix style has its own documentation page which describes its <P>Each fix style has its own documentation page which describes its
arguments and what it does, as listed below. Here is an alphabetic arguments and what it does, as listed below. Here is an alphabetic
list of fix styles available in LAMMPS: list of fix styles available in LAMMPS:

View File

@ -63,31 +63,6 @@ made to the old fix via the "fix_modify"_fix_modify.html command.
The "fix modify"_fix_modify.html command allows settings for some The "fix modify"_fix_modify.html command allows settings for some
fixes to be reset. See the doc page for individual fixes for details. fixes to be reset. See the doc page for individual fixes for details.
Some fixes calculate a global scalar or vector quantity which can be
accessed by various commands for output, including "equal- and
atom-style variables"_variable.html, "thermo_style
custom"_thermo_style.html, and "fix ave/time"_fix_ave_time.html.
Some fixes calculate a per-atom vector or array quantity which can be
accessed by various commands for output, including "atom-style
variables"_variable.html, "dump_style custom"_dump.html, and "fix
ave/spatial"_fix_ave_spatial.html.
The results of fixes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, e.g. timestep
size. Extensive means the value scales with the number of atoms in
the simulation, e.g. total force applied by the fix. "Thermodynamic
output"_thermo_style.html will normalize extensive values depending on
the "thermo_modify norm" setting. But if a fix value is accessed in
another way, e.g. by a "variable"_variable.html, you may need to know
whether it is an intensive or extensive value. See the doc page for
individual fixes for further info.
See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options. See the doc pages for individual fixes
for info on which ones calculate these quantities.
Some fixes store an internal "state" which is written to binary Some fixes store an internal "state" which is written to binary
restart files via the "restart"_restart.html or restart files via the "restart"_restart.html or
"write_restart"_write_restart.html commands. This allows the fix to "write_restart"_write_restart.html commands. This allows the fix to
@ -96,6 +71,84 @@ continue on with its calculations in a restarted simulation. See the
a fix in an input script that reads a restart file. See the doc pages a fix in an input script that reads a restart file. See the doc pages
for individual fixes for info on which ones can be restarted. for individual fixes for info on which ones can be restarted.
:line
Some fixes calculate one of three styles of quantities: global,
per-atom, or local, which can be used by other commands or output as
described below. A global quantity is one or more system-wide values,
e.g. the energy of a wall interacting with particles. A per-atom
quantity is one or more values per atom, e.g. the displacement vector
for each atom since time 0. Per-atom values are set to 0.0 for atoms
not in the specified fix group. Local quantities are calculated by
each processor based on the atoms it owns, but there may be zero or
more per atoms.
Note that a single fix may produces either global or per-atom or local
quantities (or none at all), but never more than one of these.
Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each fix describes the style and kind of values it
produces, e.g. a per-atom vector. Some fixes produce more than one
kind of a single style, e.g. a global scalar and a global vector.
When a fix quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the fix:
f_ID | entire scalar, vector, or array
f_ID\[I\] | one element of vector, one column of array
f_ID\[I\]\[J\] | one element of array :tb(s=|)
In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets
reduces the dimension twice (array -> scalar). Thus a command that
uses scalar fix values as input can also process elements of a vector
or array.
Note that commands and "variables"_variable.html which use fix
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a fix quantity as f_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
:line
In LAMMPS, the values generated by a fix can be used in several ways:
Global values can be output via the "thermo_style
custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command.
Or the values can be referenced in a "variable equal"_variable.html or
"variable atom"_variable.html command. :ulb,l
Per-atom values can be output via the "dump custom"_dump.html command
or the "fix ave/spatial"_fix_ave_spatial.html command. Or they can be
time-averaged via the "fix ave/atom"_fix_ave_atom.html command or
reduced by the "compute reduce"_compute_reduce.html command. Or the
per-atom values can be referenced in an "atom-style
variable"_variable.html. :l
Local values can be reduced by the "compute
reduce"_compute_reduce.html command, or histogrammed by the "fix
ave/histo"_fix_ave_histo.html command. :l,ule
See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options, many of which involve fixes.
The results of fixes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation,
e.g. temperature. Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy.
"Thermodynamic output"_thermo_style.html will normalize extensive
values depending on the "thermo_modify norm" setting. But if a fix
value is accessed in another way, e.g. by a "variable"_variable.html,
you may need to know whether it is an intensive or extensive value.
See the doc page for individual fixes for further info.
:line
Each fix style has its own documentation page which describes its Each fix style has its own documentation page which describes its
arguments and what it does, as listed below. Here is an alphabetic arguments and what it does, as listed below. Here is an alphabetic
list of fix styles available in LAMMPS: list of fix styles available in LAMMPS:

View File

@ -27,13 +27,13 @@
<LI>one or more values can be listed <LI>one or more values can be listed
<LI>value = x, y, z, xu, yu, zu, vx, vy, vz, fx, fy, fz, c_ID, c_ID[N], f_ID, f_ID[N], v_name <LI>value = x, y, z, xu, yu, zu, vx, vy, vz, fx, fy, fz, c_ID, c_ID[i], f_ID, f_ID[i], v_name
<PRE> x,y,z,xu,yu,zu,vx,vy,vz,fx,fy,fz = atom attribute (position, unwrapped position, velocity, force component) <PRE> x,y,z,xu,yu,zu,vx,vy,vz,fx,fy,fz = atom attribute (position, unwrapped position, velocity, force component)
c_ID = per-atom vector value calculated by a compute with ID c_ID = per-atom vector calculated by a compute with ID
c_ID[N] = Nth column of per-atom array calculated by a compute with ID c_ID[I] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector value calculated by a fix with ID f_ID = per-atom vector calculated by a fix with ID
f_ID[N] = Nth column of per-atom array calculated by a fix with ID f_ID[I] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name v_name = per-atom vector calculated by an atom-style variable with name
</PRE> </PRE>
@ -59,17 +59,17 @@ computed. Atoms not in the group have their result(s) set to 0.0.
position, velocity, force component) or can be the result of a position, velocity, force component) or can be the result of a
<A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or the evaluation of an <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or the evaluation of an
atom-style <A HREF = "variable.html">variable</A>. In the latter cases, the atom-style <A HREF = "variable.html">variable</A>. In the latter cases, the
compute, fix, or variable must produce a per-atom quantity, not a compute, fix, or variable must produce a per-atom vector, not a global
global quantity. If you wish to time-average global quantities from a scalar or vector or array. If you wish to time-average global
compute, fix, or variable, then see the <A HREF = "fix_ave_time.html">fix quantities from a compute, fix, or variable, then see the <A HREF = "fix_ave_time.html">fix
ave/time</A> command. ave/time</A> command.
</P> </P>
<P><A HREF = "compute.html">Computes</A> that produce per-atom quantities are those <P><A HREF = "compute.html">Computes</A> that produce per-atom vectors or arrays are
which have the word <I>atom</I> in their style name. See the doc pages for those which have the word <I>atom</I> in their style name. See the doc
individual <A HREF = "fix.html">fixes</A> to determine which ones produce per-atom pages for individual <A HREF = "fix.html">fixes</A> to determine which ones produce
quantities. <A HREF = "variable.html">Variables</A> of style <I>atom</I> are the only per-atom vectors or arrays. <A HREF = "variable.html">Variables</A> of style <I>atom</I>
ones that can be used with this fix since all other styles of variable are the only ones that can be used with this fix since they are the
produce global quantities. only ones that produce per-atom vectors.
</P> </P>
<HR> <HR>
@ -102,24 +102,27 @@ is meant by image flags.
<P>If a value begins with "c_", a compute ID must follow which has been <P>If a value begins with "c_", a compute ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed term is
appended, the per-atom vector calculated by the compute is used. If a appended, the per-atom vector calculated by the compute is used. If a
bracketed term is appended, the Nth columnd of the per-atom array bracketed term containing an index I is appended, the Ith column of
calculated by the compute is used. Users can also write code for the per-atom array calculated by the compute is used. Users can also
their own compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>. write code for their own compute styles and <A HREF = "Section_modify.html">add them to
LAMMPS</A>.
</P> </P>
<P>If a value begins with "f_", a fix ID must follow which has been <P>If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed term is
appended, the per-atom vector calculated by the fix is used. If a appended, the per-atom vector calculated by the fix is used. If a
bracketed term is appended, the Nth column of the per-atom array bracketed term containing an index I is appended, the Ith column of
calculated by the fix is used. Note that some fixes only produce the per-atom array calculated by the fix is used. Note that some
their values on certain timesteps, which must be compatible with fixes only produce their values on certain timesteps, which must be
<I>Nevery</I>, else an error will results. Users can also write code for compatible with <I>Nevery</I>, else an error will result. Users can also
their own fix styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>. write code for their own fix styles and <A HREF = "Section_modify.html">add them to
LAMMPS</A>.
</P> </P>
<P>If a value begins with "v_", a variable name must follow which has <P>If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. Variables of style been previously defined in the input script as an <A HREF = "variable.html">atom-style
<I>atom</I> can reference thermodynamic keywords, or invoke other computes, variable</A> Variables of style <I>atom</I> can reference
fixes, or variables when they are evaluated, so this is a very general thermodynamic keywords, or invoke other computes, fixes, or variables
means of generating per-atom quantities to time average. when they are evaluated, so this is a very general means of generating
per-atom quantities to time average.
</P> </P>
<HR> <HR>

View File

@ -18,12 +18,12 @@ Nevery = calculate property every this many timesteps :l
Nrepeat = # of times to repeat the Nevery calculation before averaging :l Nrepeat = # of times to repeat the Nevery calculation before averaging :l
Nfreq = timestep frequency at which the average value is calculated :l Nfreq = timestep frequency at which the average value is calculated :l
one or more values can be listed :l one or more values can be listed :l
value = x, y, z, xu, yu, zu, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l value = x, y, z, xu, yu, zu, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[i\], f_ID, f_ID\[i\], v_name :l
x,y,z,xu,yu,zu,vx,vy,vz,fx,fy,fz = atom attribute (position, unwrapped position, velocity, force component) x,y,z,xu,yu,zu,vx,vy,vz,fx,fy,fz = atom attribute (position, unwrapped position, velocity, force component)
c_ID = per-atom vector value calculated by a compute with ID c_ID = per-atom vector calculated by a compute with ID
c_ID\[N\] = Nth column of per-atom array calculated by a compute with ID c_ID\[I\] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector value calculated by a fix with ID f_ID = per-atom vector calculated by a fix with ID
f_ID\[N\] = Nth column of per-atom array calculated by a fix with ID f_ID\[I\] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre v_name = per-atom vector calculated by an atom-style variable with name :pre
:ule :ule
@ -48,17 +48,17 @@ Each listed value can be an atom attribute (position, unwrapped
position, velocity, force component) or can be the result of a position, velocity, force component) or can be the result of a
"compute"_compute.html or "fix"_fix.html or the evaluation of an "compute"_compute.html or "fix"_fix.html or the evaluation of an
atom-style "variable"_variable.html. In the latter cases, the atom-style "variable"_variable.html. In the latter cases, the
compute, fix, or variable must produce a per-atom quantity, not a compute, fix, or variable must produce a per-atom vector, not a global
global quantity. If you wish to time-average global quantities from a scalar or vector or array. If you wish to time-average global
compute, fix, or variable, then see the "fix quantities from a compute, fix, or variable, then see the "fix
ave/time"_fix_ave_time.html command. ave/time"_fix_ave_time.html command.
"Computes"_compute.html that produce per-atom quantities are those "Computes"_compute.html that produce per-atom vectors or arrays are
which have the word {atom} in their style name. See the doc pages for those which have the word {atom} in their style name. See the doc
individual "fixes"_fix.html to determine which ones produce per-atom pages for individual "fixes"_fix.html to determine which ones produce
quantities. "Variables"_variable.html of style {atom} are the only per-atom vectors or arrays. "Variables"_variable.html of style {atom}
ones that can be used with this fix since all other styles of variable are the only ones that can be used with this fix since they are the
produce global quantities. only ones that produce per-atom vectors.
:line :line
@ -91,24 +91,27 @@ is meant by image flags.
If a value begins with "c_", a compute ID must follow which has been If a value begins with "c_", a compute ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed term is
appended, the per-atom vector calculated by the compute is used. If a appended, the per-atom vector calculated by the compute is used. If a
bracketed term is appended, the Nth columnd of the per-atom array bracketed term containing an index I is appended, the Ith column of
calculated by the compute is used. Users can also write code for the per-atom array calculated by the compute is used. Users can also
their own compute styles and "add them to LAMMPS"_Section_modify.html. write code for their own compute styles and "add them to
LAMMPS"_Section_modify.html.
If a value begins with "f_", a fix ID must follow which has been If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed term is
appended, the per-atom vector calculated by the fix is used. If a appended, the per-atom vector calculated by the fix is used. If a
bracketed term is appended, the Nth column of the per-atom array bracketed term containing an index I is appended, the Ith column of
calculated by the fix is used. Note that some fixes only produce the per-atom array calculated by the fix is used. Note that some
their values on certain timesteps, which must be compatible with fixes only produce their values on certain timesteps, which must be
{Nevery}, else an error will results. Users can also write code for compatible with {Nevery}, else an error will result. Users can also
their own fix styles and "add them to LAMMPS"_Section_modify.html. write code for their own fix styles and "add them to
LAMMPS"_Section_modify.html.
If a value begins with "v_", a variable name must follow which has If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. Variables of style been previously defined in the input script as an "atom-style
{atom} can reference thermodynamic keywords, or invoke other computes, variable"_variable.html Variables of style {atom} can reference
fixes, or variables when they are evaluated, so this is a very general thermodynamic keywords, or invoke other computes, fixes, or variables
means of generating per-atom quantities to time average. when they are evaluated, so this is a very general means of generating
per-atom quantities to time average.
:line :line

View File

@ -33,19 +33,19 @@
<LI>one or more values can be listed <LI>one or more values can be listed
<LI>value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID[N], f_ID, f_ID[N], v_name <LI>value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID[I], f_ID, f_ID[I], v_name
<PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) <PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
density/number, density/mass = number or mass density density/number, density/mass = number or mass density
c_ID = per-atom vector value calculated by a compute with ID c_ID = per-atom vector calculated by a compute with ID
c_ID[N] = Nth column of per-atom array calculated by a compute with ID c_ID[I] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector value calculated by a fix with ID f_ID = per-atom vector calculated by a fix with ID
f_ID[N] = Nth column of per-atom array calculated by a fix with ID f_ID[I] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name v_name = per-atom vector calculated by an atom-style variable with name
</PRE> </PRE>
<LI>zero or more keyword/arg pairs may be appended <LI>zero or more keyword/arg pairs may be appended
<LI>keyword = <I>norm</I> or <I>units</I> or <I>file</I> or <I>ave</I> <LI>keyword = <I>norm</I> or <I>units</I> or <I>file</I> or <I>ave</I> or <I>title1</I> or <I>title2</I> or <I>title3</I>
<PRE> <I>units</I> arg = <I>box</I> or <I>lattice</I> or <I>reduced</I> <PRE> <I>units</I> arg = <I>box</I> or <I>lattice</I> or <I>reduced</I>
<I>norm</I> arg = <I>all</I> or <I>sample</I> <I>norm</I> arg = <I>all</I> or <I>sample</I>
@ -54,13 +54,20 @@
<I>ave</I> args = <I>one</I> or <I>running</I> or <I>window M</I> <I>ave</I> args = <I>one</I> or <I>running</I> or <I>window M</I>
one = output new average value every Nfreq steps one = output new average value every Nfreq steps
running = output cumulative average of all previous Nfreq steps running = output cumulative average of all previous Nfreq steps
window M = output average of M most recent Nfreq steps window M = output average of M most recent Nfreq steps
<I>title1</I> arg = string
string = text to print as 1st line of output file = title
<I>title2</I> arg = string
string = text to print as 2nd line of output file = timestep, # of layers
<I>title3</I> arg = string
string = text to print as 3rd line of output file = values
</PRE> </PRE>
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>fix 1 all ave/spatial 10000 1 10000 z lower 0.02 c_myCentro units reduced <PRE>fix 1 all ave/spatial 10000 1 10000 z lower 0.02 c_myCentro units reduced &
title1 "My output values"
fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile
fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density/mass ave running fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density/mass ave running
</PRE> </PRE>
@ -155,16 +162,16 @@ volume of the layer so that units of number/volume or mass/volume are
output. output.
</P> </P>
<P>If a value begins with "c_", a compute ID must follow which has been <P>If a value begins with "c_", a compute ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the compute is used. If a appended, the per-atom vector calculated by the compute is used. If a
bracketed term is appended, the Nth column of the per-atom array bracketed interger is appended, the Ith column of the per-atom array
calculated by the compute is used. Users can also write code for calculated by the compute is used. Users can also write code for
their own compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>. their own compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P> </P>
<P>If a value begins with "f_", a fix ID must follow which has been <P>If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the fix is used. If a appended, the per-atom vector calculated by the fix is used. If a
bracketed term is appended, the Nth column of the per-atom array bracketed integer is appended, the Ith column of the per-atom array
calculated by the fix is used. Note that some fixes only produce calculated by the fix is used. Note that some fixes only produce
their values on certain timesteps, which must be compatible with their values on certain timesteps, which must be compatible with
<I>Nevery</I>, else an error results. Users can also write code for their <I>Nevery</I>, else an error results. Users can also write code for their
@ -172,9 +179,10 @@ own fix styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P> </P>
<P>If a value begins with "v_", a variable name must follow which has <P>If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. Variables of style been previously defined in the input script. Variables of style
<I>atom</I> can reference thermodynamic keywords, or invoke other computes, <I>atom</I> can reference thermodynamic keywords and various per-atom
fixes, or variables when they are evaluated, so this is a very general attributes, or invoke other computes, fixes, or variables when they
means of generating per-atom quantities to spatially average. are evaluated, so this is a very general means of generating per-atom
quantities to spatially average.
</P> </P>
<HR> <HR>
@ -255,6 +263,24 @@ then the output on step 10000 will be the average of the individual
layer values on steps 8000,9000,10000. Outputs on early steps will layer values on steps 8000,9000,10000. Outputs on early steps will
average over less than M values if they are not available. average over less than M values if they are not available.
</P> </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 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. By
default, theses lines are as follows:
</P>
<PRE># Spatial-averaged data for fix ID and group name
# Timestep Number-of-layers
# Layer Coord Ncount value1 value2 ...
</PRE>
<P>In the first line, ID and name are replaced with the fix-ID and group
name. In the last line the values are replaced with the appropriate
fields from the fix ave/spatial command. Note the first line is
essentially a title for the file. The second line describes the
header line that appears at the first of each section of output. The
third line describes the columns of each layer line within a section
of output.
</P>
<HR> <HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B> <P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
@ -263,21 +289,19 @@ average over less than M values if they are not available.
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix. are relevant to this fix.
</P> </P>
<P>This fix computes a global vector of quantities which can be accessed <P>This fix computes a global array of values which can be accessed by
by various <A HREF = "Section_howto.html#4_15">output commands</A>. The values can 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 only be accessed on timesteps that are multiples of <I>Nfreq</I> since that
is when averaging is performed. The global vector is of length N = is when averaging is performed. The global array has Nlayers rows and
nlayers*nvalues where nlayers is the number of layers and nvalues is Nvalues+2 columns. The first column has the layer coordinate, the 2nd
the number of values per layer that the fix is averaging. When column has the count of atoms in that layer, and the remaining columns
accessed by another output command, a single index M is specified are the Nvalue quantities. When the array is accessed with an I that
which is mapped into a layer I as I = M / nvalues + 1 and into value J exceeds the current number of layers, than a 0.0 is returned by the
as J = M % nvalues + 1. If I exceeds the current number of layers fix instead of an error, since the number of layers can vary as a
than a 0.0 is returned by the fix instead of an error, since the simulation runs, depending on the simulation box size. The array
number of layers can vary as a simulation runs, depending on the values calculated by this fix are "intensive", meaning they are
simulation box size. The vector values calculated by this fix are independent of the number of atoms in the simulation, since they are
"intensive", meaning they are independent of the number of atoms in already normalized by the count of atoms in each layer.
the simulation, since they are already normalized by the count of
atoms in each layer.
</P> </P>
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of <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 the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
@ -298,6 +322,6 @@ simulation box size doesn't change or if the <I>units</I> keyword is set to
<P><B>Default:</B> <P><B>Default:</B>
</P> </P>
<P>The option defaults are units = lattice, norm = all, no file output, <P>The option defaults are units = lattice, norm = all, no file output,
and ave = one. and ave = one, title 1,2,3 = strings as described above.
</P> </P>
</HTML> </HTML>

View File

@ -21,17 +21,17 @@ dim = {x} or {y} or {z} :l
origin = {lower} or {center} or {upper} or coordinate value (distance units) :l origin = {lower} or {center} or {upper} or coordinate value (distance units) :l
delta = thickness of spatial layers in dim (distance units) :l delta = thickness of spatial layers in dim (distance units) :l
one or more values can be listed :l one or more values can be listed :l
value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID\[I\], f_ID, f_ID\[I\], v_name :l
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
density/number, density/mass = number or mass density density/number, density/mass = number or mass density
c_ID = per-atom vector value calculated by a compute with ID c_ID = per-atom vector calculated by a compute with ID
c_ID\[N\] = Nth column of per-atom array calculated by a compute with ID c_ID\[I\] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector value calculated by a fix with ID f_ID = per-atom vector calculated by a fix with ID
f_ID\[N\] = Nth column of per-atom array calculated by a fix with ID f_ID\[I\] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre v_name = per-atom vector calculated by an atom-style variable with name :pre
zero or more keyword/arg pairs may be appended :l zero or more keyword/arg pairs may be appended :l
keyword = {norm} or {units} or {file} or {ave} :l keyword = {norm} or {units} or {file} or {ave} or {title1} or {title2} or {title3} :l
{units} arg = {box} or {lattice} or {reduced} {units} arg = {box} or {lattice} or {reduced}
{norm} arg = {all} or {sample} {norm} arg = {all} or {sample}
{file} arg = filename {file} arg = filename
@ -39,12 +39,19 @@ keyword = {norm} or {units} or {file} or {ave} :l
{ave} args = {one} or {running} or {window M} {ave} args = {one} or {running} or {window M}
one = output new average value every Nfreq steps one = output new average value every Nfreq steps
running = output cumulative average of all previous Nfreq steps running = output cumulative average of all previous Nfreq steps
window M = output average of M most recent Nfreq steps :pre window M = output average of M most recent Nfreq steps
{title1} arg = string
string = text to print as 1st line of output file = title
{title2} arg = string
string = text to print as 2nd line of output file = timestep, # of layers
{title3} arg = string
string = text to print as 3rd line of output file = values :pre
:ule :ule
[Examples:] [Examples:]
fix 1 all ave/spatial 10000 1 10000 z lower 0.02 c_myCentro units reduced fix 1 all ave/spatial 10000 1 10000 z lower 0.02 c_myCentro units reduced &
title1 "My output values"
fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile
fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density/mass ave running :pre fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density/mass ave running :pre
@ -139,16 +146,16 @@ volume of the layer so that units of number/volume or mass/volume are
output. output.
If a value begins with "c_", a compute ID must follow which has been If a value begins with "c_", a compute ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the compute is used. If a appended, the per-atom vector calculated by the compute is used. If a
bracketed term is appended, the Nth column of the per-atom array bracketed interger is appended, the Ith column of the per-atom array
calculated by the compute is used. Users can also write code for calculated by the compute is used. Users can also write code for
their own compute styles and "add them to LAMMPS"_Section_modify.html. their own compute styles and "add them to LAMMPS"_Section_modify.html.
If a value begins with "f_", a fix ID must follow which has been If a value begins with "f_", a fix ID must follow which has been
previously defined in the input script. If no bracketed term is previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the fix is used. If a appended, the per-atom vector calculated by the fix is used. If a
bracketed term is appended, the Nth column of the per-atom array bracketed integer is appended, the Ith column of the per-atom array
calculated by the fix is used. Note that some fixes only produce calculated by the fix is used. Note that some fixes only produce
their values on certain timesteps, which must be compatible with their values on certain timesteps, which must be compatible with
{Nevery}, else an error results. Users can also write code for their {Nevery}, else an error results. Users can also write code for their
@ -156,9 +163,10 @@ own fix styles and "add them to LAMMPS"_Section_modify.html.
If a value begins with "v_", a variable name must follow which has If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. Variables of style been previously defined in the input script. Variables of style
{atom} can reference thermodynamic keywords, or invoke other computes, {atom} can reference thermodynamic keywords and various per-atom
fixes, or variables when they are evaluated, so this is a very general attributes, or invoke other computes, fixes, or variables when they
means of generating per-atom quantities to spatially average. are evaluated, so this is a very general means of generating per-atom
quantities to spatially average.
:line :line
@ -239,6 +247,24 @@ then the output on step 10000 will be the average of the individual
layer values on steps 8000,9000,10000. Outputs on early steps will layer values on steps 8000,9000,10000. Outputs on early steps will
average over less than M values if they are not available. average over less than M values if they are not available.
The {title1} and {title2} and {title3} keywords allow specification of
the strings that will be printed as the first 3 lines of the output
file, assuming the {file} keyword was used. LAMMPS uses default
values for each of these, so they do not need to be specified. By
default, theses lines are as follows:
# Spatial-averaged data for fix ID and group name
# Timestep Number-of-layers
# Layer Coord Ncount value1 value2 ... :pre
In the first line, ID and name are replaced with the fix-ID and group
name. In the last line the values are replaced with the appropriate
fields from the fix ave/spatial command. Note the first line is
essentially a title for the file. The second line describes the
header line that appears at the first of each section of output. The
third line describes the columns of each layer line within a section
of output.
:line :line
[Restart, fix_modify, output, run start/stop, minimize info:] [Restart, fix_modify, output, run start/stop, minimize info:]
@ -247,21 +273,19 @@ No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. are relevant to this fix.
This fix computes a global vector of quantities which can be accessed This fix computes a global array of values which can be accessed by
by various "output commands"_Section_howto.html#4_15. The values can various "output commands"_Section_howto.html#4_15. The values can
only be accessed on timesteps that are multiples of {Nfreq} since that only be accessed on timesteps that are multiples of {Nfreq} since that
is when averaging is performed. The global vector is of length N = is when averaging is performed. The global array has Nlayers rows and
nlayers*nvalues where nlayers is the number of layers and nvalues is Nvalues+2 columns. The first column has the layer coordinate, the 2nd
the number of values per layer that the fix is averaging. When column has the count of atoms in that layer, and the remaining columns
accessed by another output command, a single index M is specified are the Nvalue quantities. When the array is accessed with an I that
which is mapped into a layer I as I = M / nvalues + 1 and into value J exceeds the current number of layers, than a 0.0 is returned by the
as J = M % nvalues + 1. If I exceeds the current number of layers fix instead of an error, since the number of layers can vary as a
than a 0.0 is returned by the fix instead of an error, since the simulation runs, depending on the simulation box size. The array
number of layers can vary as a simulation runs, depending on the values calculated by this fix are "intensive", meaning they are
simulation box size. The vector values calculated by this fix are independent of the number of atoms in the simulation, since they are
"intensive", meaning they are independent of the number of atoms in already normalized by the count of atoms in each layer.
the simulation, since they are already normalized by the count of
atoms in each layer.
No parameter of this fix can be used with the {start/stop} keywords of 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 the "run"_run.html command. This fix is not invoked during "energy
@ -282,4 +306,5 @@ simulation box size doesn't change or if the {units} keyword is set to
[Default:] [Default:]
The option defaults are units = lattice, norm = all, no file output, The option defaults are units = lattice, norm = all, no file output,
and ave = one. and ave = one, title 1,2,3 = strings as described above.

View File

@ -29,7 +29,9 @@
vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi,
xy, xz, yz, xy, xz, yz,
pxx, pyy, pzz, pxy, pxz, pyz, pxx, pyy, pzz, pxy, pxz, pyz,
c_ID, c_ID[n], f_ID, f_ID[n], v_name c_ID, c_ID[I], c_ID[I][J],
f_ID, f_ID[I], f_ID[I][J],
v_name
step = timestep step = timestep
atoms = # of atoms atoms = # of atoms
cpu = elapsed CPU time cpu = elapsed CPU time
@ -55,10 +57,12 @@
xy,xz,yz = box tilt for triclinic (non-orthogonal) simulation boxes xy,xz,yz = box tilt for triclinic (non-orthogonal) simulation boxes
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
c_ID = global scalar value calculated by a compute with ID c_ID = global scalar value calculated by a compute with ID
c_ID[N] = Nth component of global vector calculated by a compute with ID c_ID[I] = Ith component of global vector calculated by a compute with ID
c_ID[I][J] = I,J component of global array calculated by a compute with ID
f_ID = global scalar value calculated by a fix with ID f_ID = global scalar value calculated by a fix with ID
f_ID[N] = Nth component of global vector calculated by a fix with ID f_ID[I] = Ith component of global vector calculated by a fix with ID
v_name = global value calculated by an equal-style variable with name f_ID[I][J] = I,J component of global array calculated by a fix with ID
v_name = scalar value calculated by an equal-style variable with name
</PRE> </PRE>
</UL> </UL>
@ -187,75 +191,65 @@ etc.
</P> </P>
<HR> <HR>
<P>The <I>c_ID</I> and <I>c_ID[N]</I> keywords allow global scalar or vector <P>The <I>c_ID</I> and <I>c_ID[I]</I> and <I>c_ID[I][J]</I> keywords allow global
quantities calculated by a compute to be output. The ID in the values calculated by a compute to be output. As discussed on the
keyword should be replaced by the actual ID of the compute that has <A HREF = "compute.html">compute</A> doc page, computes can calculate global,
been defined elsewhere in the input script. See the per-atom, or local values. Only global values can be referenced by
<A HREF = "compute.html">compute</A> command for details. Note that only global this command. However, per-atom compute values can be referenced in a
scalar or vector quantities calculated by a compute can be output as <A HREF = "variable.html">variable</A> and the variable referenced by thermo_style
thermodynamic data; per-atom quantities calculated by a compute can be custom, as discussed below.
output by the <A HREF = "dump.html">dump custom</A> command. There is a <A HREF = "compute_reduce.html">compute </P>
reduce</A> command which can sum per-atom quantities <P>The ID in the keyword should be replaced by the actual ID of a compute
into a global scalar or vector which can be output by thermo_style that has been defined elsewhere in the input script. See the
custom. <A HREF = "compute.html">compute</A> command for details. If the compute calculates
a global scalar, vector, or array, then the keyword formats with 0, 1,
or 2 brackets will reference a scalar value from the compute.
</P> </P>
<P>Note that some computes calculate "intensive" global quantities like <P>Note that some computes calculate "intensive" global quantities like
temperature; others calculate "extensive" global quantities like temperature; others calculate "extensive" global quantities like
kinetic energy that are summed over all atoms in the compute group. kinetic energy that are summed over all atoms in the compute group.
Intensive quantities are printed directly as is by thermo_style Intensive quantities are printed directly without normalization by
custom. Extensive quantities may be normalized when output by the thermo_style custom. Extensive quantities may be normalized by the
total number of atoms in the simulation (NOT the number of atoms in total number of atoms in the simulation (NOT the number of atoms in
the compute group) depending on the <A HREF = "thermo_modify.html">thermo_modify the compute group) when output, depending on the <A HREF = "thermo_modify.html">thermo_modify
norm</A> option being used. norm</A> option being used.
</P> </P>
<P>If <I>c_ID</I> is used as a keyword, then the scalar quantity calculated by <P>The <I>f_ID</I> and <I>f_ID[I]</I> and <I>f_ID[I][J]</I> keywords allow global
the compute is printed. If <I>c_ID[N]</I> is used, then N must be an values calculated by a fix to be output. As discussed on the
index from 1-M where M is the length of the vector calculated by the <A HREF = "fix.html">fix</A> doc page, fixes can calculate global, per-atom, or
compute. See the doc pages for individual compute styles for info on local values. Only global values can be referenced by this command.
what these quantities are. However, per-atom fix values can be referenced in a
<A HREF = "variable.html">variable</A> and the variable referenced by thermo_style
custom, as discussed below.
</P> </P>
<P>The <I>f_ID</I> and <I>f_ID[N]</I> keywords allow global scalar or vector <P>The ID in the keyword should be replaced by the actual ID of a fix
quantities calculated by a fix to be output. The ID in the keyword that has been defined elsewhere in the input script. See the
should be replaced by the actual ID of the fix that has been defined <A HREF = "fix.html">fix</A> command for details. If the fix calculates a global
elsewhere in the input script. See the doc pages for individual <A HREF = "fix.html">fix scalar, vector, or array, then the keyword formats with 0, 1, or 2
commands</A> for details of which fixes generate global values. brackets will reference a scalar value from the fix.
One particularly useful fix to use in this context is the <A HREF = "fix_ave_time.html">fix
ave/time</A> command, which calculates time-averages of
global scalar and vector quantities calculated by other
<A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, or
<A HREF = "variable.html">variables</A>.
</P> </P>
<P>Note that some fixes calculate "intensive" global quantities like <P>Note that some fixes calculate "intensive" global quantities like
timestep size; others calculate "extensive" global quantities like timestep size; others calculate "extensive" global quantities like
energy that are summed over all atoms in the fix group. Intensive energy that are summed over all atoms in the fix group. Intensive
quantities are printed directly as is by thermo_style custom. quantities are printed directly without normalization by thermo_style
Extensive quantities may be normalized when output by the total number custom. Extensive quantities may be normalized by the total number of
of atoms in the simulation (NOT the number of atoms in the fix group) atoms in the simulation (NOT the number of atoms in the fix group)
depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A> option being when output, depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A>
used. option being used.
</P>
<P>If <I>f_ID</I> is used as a keyword, then the scalar quantity calculated by
the fix is printed. If <I>f_ID[N]</I> is used, then N must be an index
from 1-M where M is the length of the vector calculated by the fix.
See the doc pages for individual fix styles for info on which fixes
calculate these global quantities and what they are. For fixes that
compute a contribution to the potential energy of the system, the
scalar quantity referenced by f_ID is typically that quantity.
</P> </P>
<P>The <I>v_name</I> keyword allow the current value of a variable to be <P>The <I>v_name</I> keyword allow the current value of a variable to be
output. The name in the keyword should be replaced by the actual name output. The name in the keyword should be replaced by the actual name
of the variable that has been defined elsewhere in the input script. of the variable that has been defined elsewhere in the input script.
Only equal-style variables can be referenced. See the Only equal-style variables can be referenced. See the
<A HREF = "variable.html">variable</A> command for details. Variables of style <A HREF = "variable.html">variable</A> command for details. Variables of style
<I>equal</I> can reference individual atom properties or thermodynamic <I>equal</I> can reference per-atom properties or thermodynamic keywords,
keywords, or they can invoke other computes, fixes, or variables when or they can invoke other computes, fixes, or variables when evaluated,
evaluated, so this is a very general means of creating thermodynamic so this is a very general means of creating thermodynamic output.
output.
</P> </P>
<P>See <A HREF = "Section_modify.html">this section</A> for information on how to add <P>See <A HREF = "Section_modify.html">this section</A> for information on how to add
new compute and fix styles to LAMMPS to calculate quantities that new compute and fix styles to LAMMPS to calculate quantities that can
could then be output with these keywords as part of thermodynamic then be referenced with these keywords to generate thermodynamic
information. output.
</P> </P>
<HR> <HR>

View File

@ -24,7 +24,9 @@ args = list of arguments for a particular style :l
vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi,
xy, xz, yz, xy, xz, yz,
pxx, pyy, pzz, pxy, pxz, pyz, pxx, pyy, pzz, pxy, pxz, pyz,
c_ID, c_ID\[n\], f_ID, f_ID\[n\], v_name c_ID, c_ID\[I\], c_ID\[I\]\[J\],
f_ID, f_ID\[I\], f_ID\[I\]\[J\],
v_name
step = timestep step = timestep
atoms = # of atoms atoms = # of atoms
cpu = elapsed CPU time cpu = elapsed CPU time
@ -50,10 +52,12 @@ args = list of arguments for a particular style :l
xy,xz,yz = box tilt for triclinic (non-orthogonal) simulation boxes xy,xz,yz = box tilt for triclinic (non-orthogonal) simulation boxes
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
c_ID = global scalar value calculated by a compute with ID c_ID = global scalar value calculated by a compute with ID
c_ID\[N\] = Nth component of global vector calculated by a compute with ID c_ID\[I\] = Ith component of global vector calculated by a compute with ID
c_ID\[I\]\[J\] = I,J component of global array calculated by a compute with ID
f_ID = global scalar value calculated by a fix with ID f_ID = global scalar value calculated by a fix with ID
f_ID\[N\] = Nth component of global vector calculated by a fix with ID f_ID\[I\] = Ith component of global vector calculated by a fix with ID
v_name = global value calculated by an equal-style variable with name :pre f_ID\[I\]\[J\] = I,J component of global array calculated by a fix with ID
v_name = scalar value calculated by an equal-style variable with name :pre
:ule :ule
[Examples:] [Examples:]
@ -181,75 +185,65 @@ etc.
:line :line
The {c_ID} and {c_ID\[N\]} keywords allow global scalar or vector The {c_ID} and {c_ID\[I\]} and {c_ID\[I\]\[J\]} keywords allow global
quantities calculated by a compute to be output. The ID in the values calculated by a compute to be output. As discussed on the
keyword should be replaced by the actual ID of the compute that has "compute"_compute.html doc page, computes can calculate global,
been defined elsewhere in the input script. See the per-atom, or local values. Only global values can be referenced by
"compute"_compute.html command for details. Note that only global this command. However, per-atom compute values can be referenced in a
scalar or vector quantities calculated by a compute can be output as "variable"_variable.html and the variable referenced by thermo_style
thermodynamic data; per-atom quantities calculated by a compute can be custom, as discussed below.
output by the "dump custom"_dump.html command. There is a "compute
reduce"_compute_reduce.html command which can sum per-atom quantities The ID in the keyword should be replaced by the actual ID of a compute
into a global scalar or vector which can be output by thermo_style that has been defined elsewhere in the input script. See the
custom. "compute"_compute.html command for details. If the compute calculates
a global scalar, vector, or array, then the keyword formats with 0, 1,
or 2 brackets will reference a scalar value from the compute.
Note that some computes calculate "intensive" global quantities like Note that some computes calculate "intensive" global quantities like
temperature; others calculate "extensive" global quantities like temperature; others calculate "extensive" global quantities like
kinetic energy that are summed over all atoms in the compute group. kinetic energy that are summed over all atoms in the compute group.
Intensive quantities are printed directly as is by thermo_style Intensive quantities are printed directly without normalization by
custom. Extensive quantities may be normalized when output by the thermo_style custom. Extensive quantities may be normalized by the
total number of atoms in the simulation (NOT the number of atoms in total number of atoms in the simulation (NOT the number of atoms in
the compute group) depending on the "thermo_modify the compute group) when output, depending on the "thermo_modify
norm"_thermo_modify.html option being used. norm"_thermo_modify.html option being used.
If {c_ID} is used as a keyword, then the scalar quantity calculated by The {f_ID} and {f_ID\[I\]} and {f_ID\[I\]\[J\]} keywords allow global
the compute is printed. If {c_ID\[N\]} is used, then N must be an values calculated by a fix to be output. As discussed on the
index from 1-M where M is the length of the vector calculated by the "fix"_fix.html doc page, fixes can calculate global, per-atom, or
compute. See the doc pages for individual compute styles for info on local values. Only global values can be referenced by this command.
what these quantities are. However, per-atom fix values can be referenced in a
"variable"_variable.html and the variable referenced by thermo_style
custom, as discussed below.
The {f_ID} and {f_ID\[N\]} keywords allow global scalar or vector The ID in the keyword should be replaced by the actual ID of a fix
quantities calculated by a fix to be output. The ID in the keyword that has been defined elsewhere in the input script. See the
should be replaced by the actual ID of the fix that has been defined "fix"_fix.html command for details. If the fix calculates a global
elsewhere in the input script. See the doc pages for individual "fix scalar, vector, or array, then the keyword formats with 0, 1, or 2
commands"_fix.html for details of which fixes generate global values. brackets will reference a scalar value from the fix.
One particularly useful fix to use in this context is the "fix
ave/time"_fix_ave_time.html command, which calculates time-averages of
global scalar and vector quantities calculated by other
"computes"_compute.html, "fixes"_fix.html, or
"variables"_variable.html.
Note that some fixes calculate "intensive" global quantities like Note that some fixes calculate "intensive" global quantities like
timestep size; others calculate "extensive" global quantities like timestep size; others calculate "extensive" global quantities like
energy that are summed over all atoms in the fix group. Intensive energy that are summed over all atoms in the fix group. Intensive
quantities are printed directly as is by thermo_style custom. quantities are printed directly without normalization by thermo_style
Extensive quantities may be normalized when output by the total number custom. Extensive quantities may be normalized by the total number of
of atoms in the simulation (NOT the number of atoms in the fix group) atoms in the simulation (NOT the number of atoms in the fix group)
depending on the "thermo_modify norm"_thermo_modify.html option being when output, depending on the "thermo_modify norm"_thermo_modify.html
used. option being used.
If {f_ID} is used as a keyword, then the scalar quantity calculated by
the fix is printed. If {f_ID\[N\]} is used, then N must be an index
from 1-M where M is the length of the vector calculated by the fix.
See the doc pages for individual fix styles for info on which fixes
calculate these global quantities and what they are. For fixes that
compute a contribution to the potential energy of the system, the
scalar quantity referenced by f_ID is typically that quantity.
The {v_name} keyword allow the current value of a variable to be The {v_name} keyword allow the current value of a variable to be
output. The name in the keyword should be replaced by the actual name output. The name in the keyword should be replaced by the actual name
of the variable that has been defined elsewhere in the input script. of the variable that has been defined elsewhere in the input script.
Only equal-style variables can be referenced. See the Only equal-style variables can be referenced. See the
"variable"_variable.html command for details. Variables of style "variable"_variable.html command for details. Variables of style
{equal} can reference individual atom properties or thermodynamic {equal} can reference per-atom properties or thermodynamic keywords,
keywords, or they can invoke other computes, fixes, or variables when or they can invoke other computes, fixes, or variables when evaluated,
evaluated, so this is a very general means of creating thermodynamic so this is a very general means of creating thermodynamic output.
output.
See "this section"_Section_modify.html for information on how to add See "this section"_Section_modify.html for information on how to add
new compute and fix styles to LAMMPS to calculate quantities that new compute and fix styles to LAMMPS to calculate quantities that can
could then be output with these keywords as part of thermodynamic then be referenced with these keywords to generate thermodynamic
information. output.
:line :line

View File

@ -38,13 +38,11 @@
region functions = count(group,region), mass(group,region), charge(group,region), region functions = count(group,region), mass(group,region), charge(group,region),
xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region), xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region),
bound(group,xmin,region), gyration(group,region), ke(group,reigon) bound(group,xmin,region), gyration(group,region), ke(group,reigon)
atom value = mass[N], type[N], x[N], y[N], z[N], atom value = mass[i], type[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i]
vx[N], vy[N], vz[N], fx[N], fy[N], fz[N] atom vector = mass, type, x, y, z, vx, vy, vz, fx, fy, fz
atom vector = mass[], type[], x[], y[], z[], compute references = c_ID, c_ID[i], c_ID[i][j]
vx[], vy[], vz[], fx[], fy[], fz[] fix references = f_ID, f_ID[i], f_ID[i][j]
compute references = c_ID, c_ID[2], c_ID[N], c_ID[N][2], c_ID[], c_ID[][2] variable references = v_name, v_name[i]
fix references = f_ID, f_ID[2], f_ID[N], f_ID[N][2], f_ID[], f_ID[][2]
variable references = v_abc, v_abc[N], v_abc[]
</PRE> </PRE>
</UL> </UL>
@ -57,7 +55,7 @@ variable b1 equal x[234]+0.5*vol
variable b1 equal "x[234] + 0.5*vol" variable b1 equal "x[234] + 0.5*vol"
variable b equal xcm(mol1,x)/2.0 variable b equal xcm(mol1,x)/2.0
variable b equal c_myTemp variable b equal c_myTemp
variable b atom x[]*y[]/vol variable b atom x*y/vol
variable temp world 300.0 310.0 320.0 ${Tfinal} variable temp world 300.0 310.0 320.0 ${Tfinal}
variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
variable x uloop 15 variable x uloop 15
@ -250,21 +248,23 @@ references, fix references, and references to other variables.
<TR><TD >Math operations</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), ceil(x), floor(x), round(x)</TD></TR> <TR><TD >Math operations</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), ceil(x), floor(x), round(x)</TD></TR>
<TR><TD >Group functions</TD><TD > count(ID), mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID)</TD></TR> <TR><TD >Group functions</TD><TD > count(ID), mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID)</TD></TR>
<TR><TD >Region functions</TD><TD > count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR)</TD></TR> <TR><TD >Region functions</TD><TD > count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR)</TD></TR>
<TR><TD >Atom values</TD><TD > mass[N], type[N], x[N], y[N], z[N], vx[N], vy[N], vz[N], fx[N], fy[N], fz[N]</TD></TR> <TR><TD >Atom values</TD><TD > mass[i], type[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i]</TD></TR>
<TR><TD >Atom vectors</TD><TD > mass[], type[], x[], y[], z[], vx[], vy[], vz[], fx[], fy[], fz[]</TD></TR> <TR><TD >Atom vectors</TD><TD > mass, type, x, y, z, vx, vy, vz, fx, fy, fz</TD></TR>
<TR><TD >Compute references</TD><TD > c_ID, c_ID[2], c_ID[N], c_ID[N][2], c_ID[], c_ID[][2]</TD></TR> <TR><TD >Compute references</TD><TD > c_ID, c_ID[i], c_ID[i][j]</TD></TR>
<TR><TD >Fix references</TD><TD > f_ID, f_ID[2], f_ID[N], f_ID[N][2], f_ID[], f_ID[][2]</TD></TR> <TR><TD >Fix references</TD><TD > f_ID, f_ID[i], f_ID[i][j]</TD></TR>
<TR><TD >Other variables</TD><TD > v_abc, v_abc[N], v_abc[] <TR><TD >Other variables</TD><TD > v_name, v_name[i]
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<P>Note that formula elements that contain empty brackets, such as an <P>Most of the formula elements generate scalar values. The exceptions
atom vector, produce per-atom values. All other formula elements are those that represent a per-atom vector of values. These are the
produce a global value. atom vectors, compute references that represent a per-atom vector, fix
references that represent a per-atom vector, and variables that are
atom-style variables.
</P> </P>
<P>A formula for equal-style variables cannot use any formula element <P>A formula for equal-style variables cannot use any formula element
that produces per-atom values. A formula for an atom-style variable that generates a per-atom vector. A formula for an atom-style
can use formula elements that produce either global values or per-atom variable can use formula elements that produce either scalar values or
values. per-atom vectors.
</P> </P>
<P>The thermo keywords allowed in a formula are those defined by the <P>The thermo keywords allowed in a formula are those defined by the
<A HREF = "thermo_style.html">thermo_style custom</A> command. Thermo keywords that <A HREF = "thermo_style.html">thermo_style custom</A> command. Thermo keywords that
@ -276,9 +276,9 @@ the thermo_style command (and the thermo keywords associated with that
style) also define and use the needed compute. Note that some thermo style) also define and use the needed compute. Note that some thermo
keywords use a compute indirectly to calculate their value (e.g. the keywords use a compute indirectly to calculate their value (e.g. the
enthalpy keyword uses temp, pe, and pressure). If a variable is enthalpy keyword uses temp, pe, and pressure). If a variable is
evaluated in an input script (not during a run), then the values evaluated directly in an input script (not during a run), then the
accessed by the thermo keyword must be current. See the discussion values accessed by the thermo keyword must be current. See the
below about "Variable Accuracy". discussion below about "Variable Accuracy".
</P> </P>
<P>Math operations are written in the usual way, where the "x" and "y" in <P>Math operations are written in the usual way, where the "x" and "y" in
the examples above can be another section of the formula. Operators the examples above can be another section of the formula. Operators
@ -307,79 +307,97 @@ coordinate for all atoms in the group. Gyration() computes the
radius-of-gyration of the group of atoms. See the <A HREF = "fix_gyration.html">fix radius-of-gyration of the group of atoms. See the <A HREF = "fix_gyration.html">fix
gyration</A> command for a definition of the formula. gyration</A> command for a definition of the formula.
</P> </P>
<P>Region functions are exactly the same as group functions with an <P>Region functions are exactly the same as group functions except they
extra argument which is the region ID. The function is computed take an extra argument which is the region ID. The function is
for all atoms that are in both the group and the region. If the computed for all atoms that are in both the group and the region. If
group is "all", then the only criteria for atom inclusion is the group is "all", then the only criteria for atom inclusion is that
that it be in the region. it be in the region.
</P> </P>
<P>Atom values take a single integer argument from 1-N, which is the <P>Atom values take a single integer argument I from 1 to N, where I is
desired atom-ID, e.g. x[243]., which means use the x coordinate of the an atom-ID, e.g. x[243], which means use the x coordinate of the
the atom with ID=243. atom with ID = 243.
</P> </P>
<P>Atom vectors use empty brackets, i.e. they take no argument. They <P>Atom vectors generate one value per atom, so that a reference like
generate one value per atom, so that a reference like x[] means the "vx" means the x-component of each atom's velocity will be used when
x-coord of each atom will be used when evaluating the variable. evaluating the variable.
</P> </P>
<P>Compute references access one or more quantities calculated by a <P>Compute references access quantities calculated by a
<A HREF = "compute.html">compute</A>. The ID in the reference should be replaced by <A HREF = "compute.html">compute</A>. The ID in the reference should be replaced by
the actual ID of the compute defined elsewhere in the input script. the ID of a compute defined elsewhere in the input script. As
See the doc pages for individual computes to see which ones calculate discussed in the doc page for the <A HREF = "compute.html">compute</A> command,
global versus per-atom quantities. If the compute reference contains computes can produce global, per-atom, or local values. Only global
empty brackets, then per-atom values calculated by the compute are and per-atom values can be used in a variable. Computes can also
accessed. Otherwise a single value (global or per-atom) calculated by produce a scalar, vector, or array. An equal-style variable can use
the compute is accessed. If a variable containing a compute is scalar values, which means a scalar itself, or an element of a vector
evaluated in an input script (not during a run), then the values or array. Atom-style variables can use either scalar or vector
values. A vector value can be a vector itself, or a column of an
array. See the doc pages for individual computes to see what kind of
values they produce.
</P>
<P>Examples of different kinds of compute references are as follows.
There is no ambiguity as to what a reference means, since computes
only produce global or per-atom quantities, never both.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >c_ID</TD><TD > global scalar, or per-atom vector</TD></TR>
<TR><TD >c_ID[I]</TD><TD > Ith element of global vector, or atom I's value in per-atom vector, or Ith column from per-atom array</TD></TR>
<TR><TD >c_ID[I][J]</TD><TD > I,J element of global array, or atom I's Jth value in per-atom array
</TD></TR></TABLE></DIV>
<P>If a variable containing a compute is evaluated
directly in an input script (not during a run), then the values
accessed by the compute must be current. See the discussion below accessed by the compute must be current. See the discussion below
about "Variable Accuracy". about "Variable Accuracy".
</P> </P>
<P>The different kinds of compute references are as follows. M is a <P>Fix references access quantities calculated by a <A HREF = "compute.html">fix</A>.
positive integer <= the number of vector values calculated by the The ID in the reference should be replaced by the ID of a fix defined
compute. N is a global atom ID (positive integer). elsewhere in the input script. As discussed in the doc page for the
<A HREF = "fix.html">fix</A> command, fixes can produce global, per-atom, or local
values. Only global and per-atom values can be used in a variable.
Fixes can also produce a scalar, vector, or array. An equal-style
variable can use scalar values, which means a scalar itself, or an
element of a vector or array. Atom-style variables can use either
scalar or vector values. A vector value can be a vector itself, or a
column of an array. See the doc pages for individual fixes to see
what kind of values they produce.
</P>
<P>The different kinds of fix references are exactly the same as the
compute references listed in the above table, where "c_" is replaced
by "f_".
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >c_ID</TD><TD > scalar value of a global compute</TD></TR> <TR><TD >f_ID</TD><TD > global scalar, or per-atom vector</TD></TR>
<TR><TD >c_ID[2]</TD><TD > vector component of a global compute</TD></TR> <TR><TD >f_ID[I]</TD><TD > Ith element of global vector, or atom I's value in per-atom vector, or Ith column from per-atom array</TD></TR>
<TR><TD >c_ID[N]</TD><TD > single atom's scalar value of a per-atom compute</TD></TR> <TR><TD >f_ID[I][J]</TD><TD > I,J element of global array, or atom I's Jth value in per-atom array
<TR><TD >c_ID[N][M]</TD><TD > single atom's vector component of a per-atom compute</TD></TR>
<TR><TD >c_ID[]</TD><TD > per-atom vector from a per-atom compute</TD></TR>
<TR><TD >c_ID[][M]</TD><TD > column of per-atom array from a per-atom compute
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<P>Fix references access one or more quantities calculated by a <P>If a variable containing a fix is evaluated directly in an input
<A HREF = "fix.html">fix</A>. The ID in the reference should be replaced by the script (not during a run), then the values accessed by the fix should
actual ID of the fix defined elsewhere in the input script. See the be current. See the discussion below about "Variable Accuracy".
doc pages for individual computes to see which ones calculate global
versus per-atom quantities. If the fix reference contains empty
brackets, then per-atom values calculated by the fix are accessed.
Otherwise a single value (global or per-atom) calculated by the fix is
accessed.
</P> </P>
<P>Note that some fixes only generate quantities on certain timesteps. <P>Note that some fixes only generate quantities on certain timesteps.
If a variable attempts to access the fix on non-allowed timesteps, an If a variable attempts to access the fix on non-allowed timesteps, an
error is generated. For example, the <A HREF = "fix_ave_time.html">fix ave/time</A> error is generated. For example, the <A HREF = "fix_ave_time.html">fix ave/time</A>
command may only generate averaged quantities every 100 steps. See command may only generate averaged quantities every 100 steps. See
the doc pages for individual fix commands for details. If a variable the doc pages for individual fix commands for details.
containing a fix is evaluated in an input script (not during a run),
then the values accessed by the fix should be current. See the
discussion below about "Variable Accuracy".
</P> </P>
<P>The different kinds of fix references are exactly the same as the <P>Variable references access quantities calulated by other variables,
compute references listed in the above table, where "c_" is replaced which will cause those variables to be evaluated. The name in the
by "f_", and the word "compute" is replaced by "fix". reference should be replaced by the name of a variable defined
elsewhere in the input script. As discussed on this doc page,
atom-style variables generate a per-atom vector of values; all other
variable styles generate a single scalar value. An equal-style
variable can use scalar values produce by another variable, but not
per-atom vectors. Atom-style variables can use either scalar or
per-atom vector values.
</P> </P>
<P>The current values of other variables can be accessed by prepending a <P>Examples of different kinds of variable references are as follows.
"v_" to the variable name. This will cause that variable to be There is no ambiguity as to what a reference means, since variables
evaluated. Atom-style variables generate per-atom values; all other only produce scalar or per-atom vectors, never both.
styles of variables generate a single scalar value.
</P>
<P>The different kinds of variable references are as follows. N is a
global atom ID (positive integer).
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >v_ID</TD><TD > scalar value of a non atom-style variable</TD></TR> <TR><TD >v_name</TD><TD > scalar, or per-atom vector</TD></TR>
<TR><TD >v_ID[N]</TD><TD > single atom's scalar value from an atom-style variable</TD></TR> <TR><TD >v_name[I]</TD><TD > atom I's value in per-atom vector
<TR><TD >v_ID[]</TD><TD > per-atom value from an atom-style variable
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<P>IMPORTANT NOTE: If you define variables in circular manner like this: <P>IMPORTANT NOTE: If you define variables in circular manner like this:
@ -388,7 +406,7 @@ global atom ID (positive integer).
variable b equal v_a variable b equal v_a
print $a print $a
</PRE> </PRE>
<P>then LAMMPS will run for a while when the print statement is invoked! <P>then LAMMPS may run for a while when the print statement is invoked!
</P> </P>
<HR> <HR>

View File

@ -33,13 +33,11 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {eq
region functions = count(group,region), mass(group,region), charge(group,region), region functions = count(group,region), mass(group,region), charge(group,region),
xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region), xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region),
bound(group,xmin,region), gyration(group,region), ke(group,reigon) bound(group,xmin,region), gyration(group,region), ke(group,reigon)
atom value = mass\[N\], type\[N\], x\[N\], y\[N\], z\[N\], atom value = mass\[i\], type\[i\], x\[i\], y\[i\], z\[i\], vx\[i\], vy\[i\], vz\[i\], fx\[i\], fy\[i\], fz\[i\]
vx\[N\], vy\[N\], vz\[N\], fx\[N\], fy\[N\], fz\[N\] atom vector = mass, type, x, y, z, vx, vy, vz, fx, fy, fz
atom vector = mass\[\], type\[\], x\[\], y\[\], z\[\], compute references = c_ID, c_ID\[i\], c_ID\[i\]\[j\]
vx\[\], vy\[\], vz\[\], fx\[\], fy\[\], fz\[\] fix references = f_ID, f_ID\[i\], f_ID\[i\]\[j\]
compute references = c_ID, c_ID\[2\], c_ID\[N\], c_ID\[N\]\[2\], c_ID\[\], c_ID\[\]\[2\] variable references = v_name, v_name\[i\] :pre
fix references = f_ID, f_ID\[2\], f_ID\[N\], f_ID\[N\]\[2\], f_ID\[\], f_ID\[\]\[2\]
variable references = v_abc, v_abc\[N\], v_abc\[\] :pre
:ule :ule
[Examples:] [Examples:]
@ -51,7 +49,7 @@ variable b1 equal x\[234\]+0.5*vol
variable b1 equal "x\[234\] + 0.5*vol" variable b1 equal "x\[234\] + 0.5*vol"
variable b equal xcm(mol1,x)/2.0 variable b equal xcm(mol1,x)/2.0
variable b equal c_myTemp variable b equal c_myTemp
variable b atom x\[\]*y\[\]/vol variable b atom x*y/vol
variable temp world 300.0 310.0 320.0 $\{Tfinal\} variable temp world 300.0 310.0 320.0 $\{Tfinal\}
variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
variable x uloop 15 variable x uloop 15
@ -245,22 +243,23 @@ Group functions: count(ID), mass(ID), charge(ID), xcm(ID,dim), \
vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID) vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID)
Region functions: count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), \ Region functions: count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), \
vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR) vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR)
Atom values: mass\[N\], type\[N\], x\[N\], y\[N\], z\[N\], \ Atom values: mass\[i\], type\[i\], x\[i\], y\[i\], z\[i\], \
vx\[N\], vy\[N\], vz\[N\], fx\[N\], fy\[N\], fz\[N\] vx\[i\], vy\[i\], vz\[i\], fx\[i\], fy\[i\], fz\[i\]
Atom vectors: mass\[\], type\[\], x\[\], y\[\], z\[\], \ Atom vectors: mass, type, x, y, z, vx, vy, vz, fx, fy, fz
vx\[\], vy\[\], vz\[\], fx\[\], fy\[\], fz\[\] Compute references: c_ID, c_ID\[i\], c_ID\[i\]\[j\]
Compute references: c_ID, c_ID\[2\], c_ID\[N\], c_ID\[N\]\[2\], c_ID\[\], c_ID\[\]\[2\] Fix references: f_ID, f_ID\[i\], f_ID\[i\]\[j\]
Fix references: f_ID, f_ID\[2\], f_ID\[N\], f_ID\[N\]\[2\], f_ID\[\], f_ID\[\]\[2\] Other variables: v_name, v_name\[i\] :tb(s=:)
Other variables: v_abc, v_abc\[N\], v_abc\[\] :tb(s=:)
Note that formula elements that contain empty brackets, such as an Most of the formula elements generate scalar values. The exceptions
atom vector, produce per-atom values. All other formula elements are those that represent a per-atom vector of values. These are the
produce a global value. atom vectors, compute references that represent a per-atom vector, fix
references that represent a per-atom vector, and variables that are
atom-style variables.
A formula for equal-style variables cannot use any formula element A formula for equal-style variables cannot use any formula element
that produces per-atom values. A formula for an atom-style variable that generates a per-atom vector. A formula for an atom-style
can use formula elements that produce either global values or per-atom variable can use formula elements that produce either scalar values or
values. per-atom vectors.
The thermo keywords allowed in a formula are those defined by the The thermo keywords allowed in a formula are those defined by the
"thermo_style custom"_thermo_style.html command. Thermo keywords that "thermo_style custom"_thermo_style.html command. Thermo keywords that
@ -272,9 +271,9 @@ the thermo_style command (and the thermo keywords associated with that
style) also define and use the needed compute. Note that some thermo style) also define and use the needed compute. Note that some thermo
keywords use a compute indirectly to calculate their value (e.g. the keywords use a compute indirectly to calculate their value (e.g. the
enthalpy keyword uses temp, pe, and pressure). If a variable is enthalpy keyword uses temp, pe, and pressure). If a variable is
evaluated in an input script (not during a run), then the values evaluated directly in an input script (not during a run), then the
accessed by the thermo keyword must be current. See the discussion values accessed by the thermo keyword must be current. See the
below about "Variable Accuracy". discussion below about "Variable Accuracy".
Math operations are written in the usual way, where the "x" and "y" in Math operations are written in the usual way, where the "x" and "y" in
the examples above can be another section of the formula. Operators the examples above can be another section of the formula. Operators
@ -303,76 +302,92 @@ coordinate for all atoms in the group. Gyration() computes the
radius-of-gyration of the group of atoms. See the "fix radius-of-gyration of the group of atoms. See the "fix
gyration"_fix_gyration.html command for a definition of the formula. gyration"_fix_gyration.html command for a definition of the formula.
Region functions are exactly the same as group functions with an Region functions are exactly the same as group functions except they
extra argument which is the region ID. The function is computed take an extra argument which is the region ID. The function is
for all atoms that are in both the group and the region. If the computed for all atoms that are in both the group and the region. If
group is "all", then the only criteria for atom inclusion is the group is "all", then the only criteria for atom inclusion is that
that it be in the region. it be in the region.
Atom values take a single integer argument from 1-N, which is the Atom values take a single integer argument I from 1 to N, where I is
desired atom-ID, e.g. x\[243\]., which means use the x coordinate of the an atom-ID, e.g. x\[243\], which means use the x coordinate of the
the atom with ID=243. atom with ID = 243.
Atom vectors use empty brackets, i.e. they take no argument. They Atom vectors generate one value per atom, so that a reference like
generate one value per atom, so that a reference like x\[\] means the "vx" means the x-component of each atom's velocity will be used when
x-coord of each atom will be used when evaluating the variable. evaluating the variable.
Compute references access one or more quantities calculated by a Compute references access quantities calculated by a
"compute"_compute.html. The ID in the reference should be replaced by "compute"_compute.html. The ID in the reference should be replaced by
the actual ID of the compute defined elsewhere in the input script. the ID of a compute defined elsewhere in the input script. As
See the doc pages for individual computes to see which ones calculate discussed in the doc page for the "compute"_compute.html command,
global versus per-atom quantities. If the compute reference contains computes can produce global, per-atom, or local values. Only global
empty brackets, then per-atom values calculated by the compute are and per-atom values can be used in a variable. Computes can also
accessed. Otherwise a single value (global or per-atom) calculated by produce a scalar, vector, or array. An equal-style variable can use
the compute is accessed. If a variable containing a compute is scalar values, which means a scalar itself, or an element of a vector
evaluated in an input script (not during a run), then the values or array. Atom-style variables can use either scalar or vector
values. A vector value can be a vector itself, or a column of an
array. See the doc pages for individual computes to see what kind of
values they produce.
Examples of different kinds of compute references are as follows.
There is no ambiguity as to what a reference means, since computes
only produce global or per-atom quantities, never both.
c_ID: global scalar, or per-atom vector
c_ID\[I\]: Ith element of global vector, or atom I's value in per-atom vector, or Ith column from per-atom array
c_ID\[I\]\[J\]: I,J element of global array, or atom I's Jth value in per-atom array :tb(s=:)
If a variable containing a compute is evaluated
directly in an input script (not during a run), then the values
accessed by the compute must be current. See the discussion below accessed by the compute must be current. See the discussion below
about "Variable Accuracy". about "Variable Accuracy".
The different kinds of compute references are as follows. M is a Fix references access quantities calculated by a "fix"_compute.html.
positive integer <= the number of vector values calculated by the The ID in the reference should be replaced by the ID of a fix defined
compute. N is a global atom ID (positive integer). elsewhere in the input script. As discussed in the doc page for the
"fix"_fix.html command, fixes can produce global, per-atom, or local
values. Only global and per-atom values can be used in a variable.
Fixes can also produce a scalar, vector, or array. An equal-style
variable can use scalar values, which means a scalar itself, or an
element of a vector or array. Atom-style variables can use either
scalar or vector values. A vector value can be a vector itself, or a
column of an array. See the doc pages for individual fixes to see
what kind of values they produce.
c_ID: scalar value of a global compute The different kinds of fix references are exactly the same as the
c_ID\[2\]: vector component of a global compute compute references listed in the above table, where "c_" is replaced
c_ID\[N\]: single atom's scalar value of a per-atom compute by "f_".
c_ID\[N\]\[M\]: single atom's vector component of a per-atom compute
c_ID\[\]: per-atom vector from a per-atom compute
c_ID\[\]\[M\]: column of per-atom array from a per-atom compute :tb(s=:)
Fix references access one or more quantities calculated by a f_ID: global scalar, or per-atom vector
"fix"_fix.html. The ID in the reference should be replaced by the f_ID\[I\]: Ith element of global vector, or atom I's value in per-atom vector, or Ith column from per-atom array
actual ID of the fix defined elsewhere in the input script. See the f_ID\[I\]\[J\]: I,J element of global array, or atom I's Jth value in per-atom array :tb(s=:)
doc pages for individual computes to see which ones calculate global
versus per-atom quantities. If the fix reference contains empty If a variable containing a fix is evaluated directly in an input
brackets, then per-atom values calculated by the fix are accessed. script (not during a run), then the values accessed by the fix should
Otherwise a single value (global or per-atom) calculated by the fix is be current. See the discussion below about "Variable Accuracy".
accessed.
Note that some fixes only generate quantities on certain timesteps. Note that some fixes only generate quantities on certain timesteps.
If a variable attempts to access the fix on non-allowed timesteps, an If a variable attempts to access the fix on non-allowed timesteps, an
error is generated. For example, the "fix ave/time"_fix_ave_time.html error is generated. For example, the "fix ave/time"_fix_ave_time.html
command may only generate averaged quantities every 100 steps. See command may only generate averaged quantities every 100 steps. See
the doc pages for individual fix commands for details. If a variable the doc pages for individual fix commands for details.
containing a fix is evaluated in an input script (not during a run),
then the values accessed by the fix should be current. See the
discussion below about "Variable Accuracy".
The different kinds of fix references are exactly the same as the Variable references access quantities calulated by other variables,
compute references listed in the above table, where "c_" is replaced which will cause those variables to be evaluated. The name in the
by "f_", and the word "compute" is replaced by "fix". reference should be replaced by the name of a variable defined
elsewhere in the input script. As discussed on this doc page,
atom-style variables generate a per-atom vector of values; all other
variable styles generate a single scalar value. An equal-style
variable can use scalar values produce by another variable, but not
per-atom vectors. Atom-style variables can use either scalar or
per-atom vector values.
The current values of other variables can be accessed by prepending a Examples of different kinds of variable references are as follows.
"v_" to the variable name. This will cause that variable to be There is no ambiguity as to what a reference means, since variables
evaluated. Atom-style variables generate per-atom values; all other only produce scalar or per-atom vectors, never both.
styles of variables generate a single scalar value.
The different kinds of variable references are as follows. N is a v_name: scalar, or per-atom vector
global atom ID (positive integer). v_name\[I\]: atom I's value in per-atom vector :tb(s=:)
v_ID: scalar value of a non atom-style variable
v_ID\[N\]: single atom's scalar value from an atom-style variable
v_ID\[\]: per-atom value from an atom-style variable :tb(s=:)
IMPORTANT NOTE: If you define variables in circular manner like this: IMPORTANT NOTE: If you define variables in circular manner like this:
@ -380,7 +395,7 @@ variable a equal v_b
variable b equal v_a variable b equal v_a
print $a :pre print $a :pre
then LAMMPS will run for a while when the print statement is invoked! then LAMMPS may run for a while when the print statement is invoked!
:line :line