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

This commit is contained in:
sjplimp
2008-01-02 19:25:15 +00:00
parent b2e9f7dc10
commit c10f59aa18
90 changed files with 2077 additions and 1793 deletions

View File

@ -333,10 +333,9 @@ descriptions of each style or click on the style itself for a full
description: description:
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "compute_attribute_atom.html">attribute/atom</A></TD><TD ><A HREF = "compute_centro_atom.html">centro/atom</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD><TD ><A HREF = "compute_pe.html">pe</A></TD><TD ><A HREF = "compute_pe_atom.html">pe/atom</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "compute_centro_atom.html">centro/atom</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD><TD ><A HREF = "compute_pe.html">pe</A></TD><TD ><A HREF = "compute_pe_atom.html">pe/atom</A></TD><TD ><A HREF = "compute_pressure.html">pressure</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_pressure.html">pressure</A></TD><TD ><A HREF = "compute_rotate_dipole.html">rotate/dipole</A></TD><TD ><A HREF = "compute_rotate_gran.html">rotate/gran</A></TD><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_sum.html">sum</A></TD><TD ><A HREF = "compute_sum_atom.html">sum/atom</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "compute_rotate_dipole.html">rotate/dipole</A></TD><TD ><A HREF = "compute_rotate_gran.html">rotate/gran</A></TD><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_sum.html">sum</A></TD><TD ><A HREF = "compute_temp.html">temp</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_temp.html">temp</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD><TD ><A HREF = "compute_temp_dipole.html">temp/dipole</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial</A></TD><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD><TD ><A HREF = "compute_temp_dipole.html">temp/dipole</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial</A></TD><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD><TD ><A HREF = "compute_temp_region.html">temp/region</A>
<TR ALIGN="center"><TD ><A HREF = "compute_temp_region.html">temp/region</A></TD><TD ><A HREF = "compute_variable.html">variable</A></TD><TD ><A HREF = "compute_variable_atom.html">variable/atom</A>
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<P>These are compute styles contributed by users, which can be used if <P>These are compute styles contributed by users, which can be used if

View File

@ -437,7 +437,6 @@ Compute styles. See the "compute"_compute.html command for one-line
descriptions of each style or click on the style itself for a full descriptions of each style or click on the style itself for a full
description: description:
"attribute/atom"_compute_attribute_atom.html,
"centro/atom"_compute_centro_atom.html, "centro/atom"_compute_centro_atom.html,
"coord/atom"_compute_coord_atom.html, "coord/atom"_compute_coord_atom.html,
"ke/atom"_compute_ke_atom.html, "ke/atom"_compute_ke_atom.html,
@ -448,16 +447,13 @@ description:
"rotate/gran"_compute_rotate_gran.html, "rotate/gran"_compute_rotate_gran.html,
"stress/atom"_compute_stress_atom.html, "stress/atom"_compute_stress_atom.html,
"sum"_compute_sum.html, "sum"_compute_sum.html,
"sum/atom"_compute_sum_atom.html,
"temp"_compute_temp.html, "temp"_compute_temp.html,
"temp/asphere"_compute_temp_asphere.html, "temp/asphere"_compute_temp_asphere.html,
"temp/deform"_compute_temp_deform.html, "temp/deform"_compute_temp_deform.html,
"temp/dipole"_compute_temp_dipole.html, "temp/dipole"_compute_temp_dipole.html,
"temp/partial"_compute_temp_partial.html, "temp/partial"_compute_temp_partial.html,
"temp/ramp"_compute_temp_ramp.html, "temp/ramp"_compute_temp_ramp.html,
"temp/region"_compute_temp_region.html, "temp/region"_compute_temp_region.html :tb(c=6,ea=c)
"variable"_compute_variable.html,
"variable/atom"_compute_variable_atom.html :tb(c=6,ea=c)
These are compute styles contributed by users, which can be used if These are compute styles contributed by users, which can be used if
"LAMMPS is built with the appropriate package"_Section_start.html#2_3. "LAMMPS is built with the appropriate package"_Section_start.html#2_3.

View File

@ -805,131 +805,198 @@ which is a list of quantities printed every few timesteps to the
screen and logfile. The second is <A HREF = "dump.html">dump files</A>, which screen and logfile. The second is <A HREF = "dump.html">dump files</A>, which
contain snapshots of atoms and various per-atom values and are written contain snapshots of atoms and various per-atom values and are written
at a specified frequency. A simulation prints one set of at a specified frequency. A simulation prints one set of
thermodynamic output; it may generate zero, or one, or multiple dump thermodynamic output; it may generate any number of dump files. As
files. LAMMPS gives you a variety of ways to determine what discussed below, LAMMPS gives you a variety of ways to determine what
quantities are computed and printed when thermodynamic info or dump quantities are computed and printed when thermodynamic info or dump
files are output. There are also three fixes which can do their own files are output. There are also three fixes which can do their own
output of user-defined quantities: <A HREF = "fix_ave_time.html">fix ave/time</A> output of user-chosen quantities: <A HREF = "fix_ave_time.html">fix ave/time</A> for
for time averaging, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> for spatial time averaging, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> for spatial
averaging, and <A HREF = "fix_print.html">fix print</A>. These are described below. averaging, and <A HREF = "fix_print.html">fix print</A>. These are also described
below. Throughout this discussion, note that users can <A HREF = "Section_modify.html">add their own
computes and fixes to LAMMPS</A> which can then
generate values that can be output with these commands.
</P> </P>
<H5>Thermodynamic output
</H5>
<P>The frequency and format of thermodynamic output is set by the <P>The frequency and format of thermodynamic output is set by the
<A HREF = "thermo.html">thermo</A>, <A HREF = "thermo_style.html">thermo_style</A>, and <A HREF = "thermo.html">thermo</A>, <A HREF = "thermo_style.html">thermo_style</A>, and
<A HREF = "thermo_modify.html">thermo_modify</A> commands. The <A HREF = "thermo_modify.html">thermo_modify</A> commands. The
<A HREF = "themo_style.html">thermo_style</A> command also specifies what values are <A HREF = "themo_style.html">thermo_style</A> command also specifies what values are
calculated and written out. Pre-defined keywords can be specified calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc) which include time-averaged versions of (e.g. press, etotal, etc). Three addtional kinds of keywords can also
temperature, pressure, and a few other variables (tave, pave, etc). be specified (c_ID, f_ID, v_name), where a <A HREF = "compute.html">compute</A> or
Three addtional kinds of keywords can also be specified (c_ID, f_ID, <A HREF = "fix.html">fix</A> or <A HREF = "variable.html">variable</A> provides the value to be
v_name), where a <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or output. Each of these are described in turn.
<A HREF = "variable.html">variable</A> provides the value(s) to be output. Each of
these are described in turn.
</P> </P>
<P>In LAMMPS, a <A HREF = "compute.html">compute</A> comes in two flavors: ones that <P>In LAMMPS, a <A HREF = "compute.html">compute</A> comes in two flavors: ones that
compute one or more global values (e.g. temperature, kinetic energy compute global values (e.g. temperature, pressure tensor) and ones
tensor) and ones that compute one or more per-atom values. There is a that compute per-atom values. Only global quantities from a compute
<A HREF = "compute_sum.html">compute sum</A> command which sums per-atom quantities can be used for thermodynamic output. The user-defined ID of the
into a global scalar or vector. compute is used along with an optional subscript as part of the
<A HREF = "thermo_style.html">thermo_style</A> command. E.g. c_myTemp outputs the
single scalar value generated by the compute; c_myTemp[2] outputs
the 2nd vector value. Note that there is a <A HREF = "compute_sum.html">compute
sum</A> command which sums per-atom quantities into a
global scalar or vector.
</P> </P>
<P>Only global quantities from a compute can be used for thermodynamic <P><A HREF = "fix.html">Fixes</A> can generate global scalar or vector values which can
output. The user-defined ID of the compute is used along with an be output with thermodynamic output, e.g. the energy of an indenter's
optional subscript as part of the <A HREF = "thermo_style.html">thermo_style</A> interaction with the simulation atoms. These values are accessed via
command. E.g. c_myTemp outputs the single scalar value generated by the same format as a compute's values, as f_ID or f_ID[N]. See the
the compute; c_myTemp[2] would output the 2nd vector value. doc pages for individual fix commands to see which ones generate
global values that can be output with thermodynamic info. The <A HREF = "fix_ave_time.html">fix
ave/time</A> command generates time-averaged global
quantities which can be accessed for thermodynamic output, e.g. a
time-averaged pressure.
</P> </P>
<P><A HREF = "fix.html">Fixes</A> can also generate global scalar or vector values <P><A HREF = "variable.html">Variables</A> can be defined in the input script. All
which can be output with thermodynamic output, e.g. the energy of an styles except the atom-style variable can be used for thermodynamic
indenter's interaction with the simulation atoms. These values are output, since it generates per-atom values. A variable with the name
accessed via the same format as a compute's values, as f_ID or
f_ID[N]. See the doc pages for individual fix commands to see which
ones generate global values that can be output with thermodynamic
info. The <A HREF = "fix_ave_time.html">fix ave/time</A> command generates
time-averaged global quantities which can be accessed for
thermodynamic output.
</P>
<P>Input script variables of various kinds are defined by the
<A HREF = "variable.html">variable</A> command. All kinds except the atom-style
variable can be used for thermodynamic output. A variable with name
"abc" is referenced in a thermo_style command as v_abc. "abc" is referenced in a thermo_style command as v_abc.
</P> </P>
<P>The variable formula defined in the input script can contain math <P>The formula associated with equal-style variables can contain math
functions (add, exp, etc), atom values (x[N], fx[N]), groups operations and functions (x+y,x*y,(),sqrt,exp,etc), atom values
quantities (mass(), vcm(), etc), references to thermodynamic (x[N],fx[N],etc), group functions (mass(),vcm(),etc), references
quantities (e.g. temp, volume, etc), or references to other variables to thermodynamic quantities (temp,press,vol,etc), references to
or <A HREF = "compute.html">computes</A> or <A HREF = "fix.html">fixes</A>. Thus a variable is <A HREF = "compute.html">computes</A> that generate global values, references to
the most general way to define some quantity you want calculated and <A HREF = "fix.html">fixes</A> that generate global values, or references to other
output with thermodynamic info. <A HREF = "variable.html">variables</A>. Thus an equal-style variable is the most
general way to define some quantity to calculate and include with
thermodynamic output.
</P> </P>
<H5>Dump file output
</H5>
<P>Dump file output is specified by the <A HREF = "dump.html">dump</A> and <P>Dump file output is specified by the <A HREF = "dump.html">dump</A> and
<A HREF = "dump_modify.html">dump_modify</A> commands. There are several <A HREF = "dump_modify.html">dump_modify</A> commands. There are several
pre-defined formats (dump atom, dump xtc, etc). There is also a <A HREF = "dump.html">dump pre-defined formats (dump atom, dump xtc, etc). There is also a <A HREF = "dump.html">dump
custom</A> format where you specify what values are output with custom</A> format where the user specifies what values are
each atom. Pre-defined keywords can be specified (e.g. tag, type, x, output with each atom. Pre-defined keywords can be specified (tag, x,
etc). Two additional kinds of keywords can also be specified (c_ID, fx, etc). Three additional kinds of keywords can also be specified
f_ID), where a <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> provides the (c_ID, f_ID, v_name), where a <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A>
values to be output. or <A HREF = "variable.html">variable</A> provides the value to be output. Each of
these are described in turn.
</P> </P>
<P><A HREF = "compute.html">Computes</A> that generate per-atom values can be accessed <P><A HREF = "compute.html">Computes</A> that generate one or more per-atom values can
by the dump custom command. These are computes that have the word be accessed by the dump custom command. These are computes that have
"atom" in their style name, e.g. ke/atom, stress/atom, etc. The the word "atom" in their style name, e.g. ke/atom, stress/atom, etc.
values are accessed as c_myKE for a scalar per-atom quantity or as The values are accessed as c_myKE for a scalar per-atom quantity or as
c_myStress[2] for a component of a vector per-atom quantity. The c_myStress[2] for a component of a vector per-atom quantity.
<A HREF = "compute_variable_atom.html">compute variable/atom</A> command takes a
user-defined atom-style <A HREF = "variable.html">variable</A> as input and
calculates its value for each atom. Since this compute can be
accessed by the dump custom command, this is a general way to define
some quantity you want calculated and output in a dump file.
</P> </P>
<P><A HREF = "fix.html">Fixes</A> can also generate per-atom values to output to dump <P><A HREF = "fix.html">Fixes</A> can generate per-atom values to output to dump files.
files. For example, the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command For example, the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command calculates
calculates time-averages of compute quantities. As indicated in the time-averages of per-atom quantities, such as per-atom
preceeding paragraph, a <A HREF = "compute.html">compute quantity</A> can be a <A HREF = "compute.html">computes</A> and atom-style <A HREF = "variable.html">variables</A>.
calculated value such as <A HREF = "compute_epair_atom.html">energy</A> or
<A HREF = "compute_stress_atom.html">stress</A> or it can be a value calculated by
an atom-style <A HREF = "variable.html">variable</A>, or it can be an <A HREF = "compute_attribute_atom.html">atom
attribute</A> such as velocity or force.
These per-atom fix values are accessed by the <A HREF = "dump.html">dump custom</A> These per-atom fix values are accessed by the <A HREF = "dump.html">dump custom</A>
command as f_myKE for a scalar per-atom quantity or as f_myStress[2] command via the same format as a compute's values, as f_myKE or
for a component of a vector per-atom quantity. f_myStress[2].
</P> </P>
<P><A HREF = "variable.html">Variables</A> can be defined in the input script. Only
atom-style variables can be used for dump custom output, since only
they produce per-atom values. A variable with the name "abc" is
referenced in a dump custom command as v_abc.
</P>
<P>Just like equal-style variables, the formula associated with
atom-style variables can contain math operations and functions
(x+y,x*y,(),sqrt,exp,etc), atom values (x[N],fx[N],etc), group
functions (mass(),vcm(),etc), references to thermodynamic quantities
(temp,press,vol,etc), references to <A HREF = "compute.html">computes</A> that
generate global values, references to <A HREF = "fix.html">fixes</A> that generate
global values, or references to non atom-style variables that generate
global values. In addition, an atom-style variable can reference
vectors of atom values (x[],fx[],etc), <A HREF = "compute.html">computes</A>
that generate per-atom values, <A HREF = "fix.html">fixes</A> that generate per-atom
values, or other atom-style variables. Thus an atom-style variable is
the most general way to define some quantity to calculate and output
to a dump file.
</P>
<H5>Fix output
</H5>
<P>Three other fixes are of particular note for output: <A HREF = "fix_ave_time.html">fix <P>Three other fixes are of particular note for output: <A HREF = "fix_ave_time.html">fix
ave/time</A>, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>, ave/time</A>, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>,
and <A HREF = "fix_print.html">fix print</A>. and <A HREF = "fix_print.html">fix print</A>.
</P> </P>
<P>The <A HREF = "fix_ave_time.html">fix ave/time</A> command enables time-averaging of <P>The <A HREF = "fix_ave_time.html">fix ave/time</A> command enables time-averaging of
global quantities like temperature or pressure. The global quantities any global quantity, like those output with thermodynamic info. The
are calculated by a <A HREF = "compute.html">compute</A> or a <A HREF = "fix.html">fix</A>. The user specifies one or more quantities to time average. These can be
compute or fix must generate global scalar or vector quantities. Note global <A HREF = "compute.html">compute</A> values, global <A HREF = "fix.html">fix</A> values, or
that this includes the "compute sum" command which computes global <A HREF = "variable.html">variables</A> of any style except the atom style which
values by summing per-atom quantities. The time-averaged values produces per-atom values. Since a variable can refer to keywords used
generated by <A HREF = "fix_ave_time.html">fix ave/time</A> can be written directly by the <A HREF = "thermo_style.html">thermo_style custom</A> command (like temp or
to a file and/or accessed by any output command that uses fixes as a press), any thermodynamic quantity can be time averaged in this way.
source of input, e.g. the <A HREF = "thermo_style.html">thermo_style custom</A> </P>
command. Fix ave/time options allow for running cummulative averages <P>The <A HREF = "fix_ave_time.html">fix ave/time</A> command offers several options
or moving time-windowed averages to be output. for how it performs time averaging. The results it produces can be
used in two ways. First, they can be written directly to a file, one
line per timestamp. Note that the averaging parameters can be
specified in such a way that averaging is not done at all, in which
case this is simply a convenient means of outputting desired
quantities directly to a separate file. Like other fixes that produce
global quantities, the results of this fix can also be used as input
to any command that accesses global quantities, e.g. by the
<A HREF = "thermo_style.html">thermo_style custom</A> command, by a variable, etc.
</P> </P>
<P>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command enables <P>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command enables
spatial-averaging of per-atom quantities like per-atom energy or spatial-averaging of per-atom quantities like those output in dump
stress. The per-atom quantities can be atom density (mass or number) files, within 1d layers of the simulation box. The per-atom
or be calculated by a <A HREF = "compute.html">compute</A> or a <A HREF = "fix.html">fix</A>. The quantities can be atom density (mass or number) or atom attributes
compute or fix must generate per-atom scalar or vector quantities. such as position, velocity, force. They can also be per-atom
Note that if you use the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command with quantities calculated by a <A HREF = "compute.html">compute</A>, by a
fix ave/spatial, it means you are effectively calculating a time <A HREF = "fix.html">fix</A>, or by an atom-style <A HREF = "variable.html">variable</A>.
average of a spatial average of a time-averaged per-atom quantity. </P>
The time-averaged values generated by <A HREF = "fix_ave_spatial.html">fix <P>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command offers several
ave/spatial</A> can be written directly to a file options for how it performs time averaging. The per-layer values it
and/or accessed by any output command that uses fixes as a source of produces can be used in two ways. First, they can be written directly
input, e.g. the <A HREF = "thermo_style.html">thermo_style custom</A> command. Fix to a file. Note that the averaging parameters can be specified in
ave/spatial options allow for running cummulative averages or moving such a way that time averaging is not done, in which case this is a
time-windowed averages to be output. convenient means of simply outputting desired quanitities (summed over
atoms within a 1d layer) directly to a separate file. Like other
fixes that produce global quantities, the results of this fix can also
be used as input by any command that accesses global quantities,
e.g. by the <A HREF = "thermo_style.html">thermo_style custom</A> command, by a
variable, etc. See the doc page for <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> for a description of how these
values are indexed.
</P> </P>
<P>The <A HREF = "fix_print.html">fix print</A> command can generate a line of output <P>The <A HREF = "fix_print.html">fix print</A> command can generate a line of output
written to the screen and log file periodically during a running written to the screen and log file or to a separate file, periodically
simulation. Since the line can contain one or more during a running simulation. The line can contain one or more
<A HREF = "variable.html">variable</A> quantities, this command is a means to output <A HREF = "variable.html">variable</A> values (for any style variable except the
desired calculated quantities that are not part of thermodynamic or atom style), and as explained above, variables themselves can contain
dump file output. references to global values generated by <A HREF = "thermo_style.html">thermodynamic
keywords</A>, <A HREF = "compute.html">computes</A>,
<A HREF = "fix.html">fixes</A>, or other <A HREF = "variable.html">variables</A>. Thus the <A HREF = "fix_print.html">fix
print</A> command is a means to output any desired
calculated quantity separate from normal thermodynamic or dump file
output.
</P> </P>
<P>This table summarizes the various output options, specifying what
their inputs and outputs are. The frequency with which they are
invoked and produce output is also listed. Basically, any two
commands can be hooked together so long as one produces output that
matches the input needs of the other. A "match" means that the
frequencies and global vs per-atom attributes are the same.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >Command</TD><TD > Input</TD><TD > Input Freq</TD><TD > Output</TD><TD > Output Freq</TD></TR>
<TR><TD >thermo_style custom</TD><TD > thermo keyword, global scalar/vector compute, global scalar/vector fix, equal variable</TD><TD > nthermo</TD><TD > screen, log</TD><TD > nthermo</TD></TR>
<TR><TD >dump custom</TD><TD > keyword, peratom scalar/vector compute, peratom scalar/vector fix, atom variable</TD><TD > dump freq</TD><TD > file</TD><TD > dump freq</TD></TR>
<TR><TD >global fixes</TD><TD > N/A</TD><TD > N/A</TD><TD > global scalar/vector</TD><TD > 1 or nevery</TD></TR>
<TR><TD >peratom fixes</TD><TD > N/A</TD><TD > N/A</TD><TD > peratom scalar/vector</TD><TD > 1 or nevery</TD></TR>
<TR><TD >fix ave/time</TD><TD > global scalar/vector fix, global scalar/vector compute, equal variable</TD><TD > nevery</TD><TD > global scalar/vector, file</TD><TD > nfreq</TD></TR>
<TR><TD >fix ave/spatial</TD><TD > peratom scalar/vector fix, peratom scalar/vector compute, atom vector, atom variable, density mass/number</TD><TD > nevery</TD><TD > global vector</TD><TD > nfreq, file</TD></TR>
<TR><TD >fix ave/atom</TD><TD > peratom scalar/vector compute, peratom scalar/vector fix, atom variable, atom vector</TD><TD > nevery</TD><TD > peratom scalar/vector</TD><TD > nfreq</TD></TR>
<TR><TD >fix print</TD><TD > any variable</TD><TD > nevery</TD><TD > screen, file</TD><TD > nevery</TD></TR>
<TR><TD >global computes</TD><TD > N/A</TD><TD > N/A</TD><TD > global scalar/vector</TD><TD > N/A</TD></TR>
<TR><TD >peratom computes</TD><TD > N/A</TD><TD > N/A</TD><TD > peratom scalar/vector</TD><TD > N/A</TD></TR>
<TR><TD >compute sum</TD><TD > peratom scalar/vector compute, peratom scalar/vector fix, atom variable</TD><TD > N/A</TD><TD > global scalar/vector</TD><TD > N/A</TD></TR>
<TR><TD >variable equal</TD><TD > thermo keywords, atom value vx[123], global scalar/vector compute, global scalar/vector fix, non-atom variable</TD><TD > N/A</TD><TD > global scalar</TD><TD > N/A</TD></TR>
<TR><TD >variable atom</TD><TD > thermo keywords, atom value vx[123], atom vector vx[], global scalar/vector compute, peratom scalar/vector compute, global scalar/vector fix, peratom scalar/vector fix, any variable</TD><TD > N/A</TD><TD > peratom scalar</TD><TD > N/A</TD></TR>
<TR><TD >print</TD><TD > any variable</TD><TD > N/A</TD><TD > screen, log</TD><TD > between runs</TD></TR>
<TR><TD >run every</TD><TD > any variable</TD><TD > nevery</TD><TD > screen, log</TD><TD > nevery
</TD></TR></TABLE></DIV>
<HR>
<HR> <HR>
<A NAME = "Cornell"></A> <A NAME = "Cornell"></A>

View File

@ -798,131 +798,195 @@ which is a list of quantities printed every few timesteps to the
screen and logfile. The second is "dump files"_dump.html, which screen and logfile. The second is "dump files"_dump.html, which
contain snapshots of atoms and various per-atom values and are written contain snapshots of atoms and various per-atom values and are written
at a specified frequency. A simulation prints one set of at a specified frequency. A simulation prints one set of
thermodynamic output; it may generate zero, or one, or multiple dump thermodynamic output; it may generate any number of dump files. As
files. LAMMPS gives you a variety of ways to determine what discussed below, LAMMPS gives you a variety of ways to determine what
quantities are computed and printed when thermodynamic info or dump quantities are computed and printed when thermodynamic info or dump
files are output. There are also three fixes which can do their own files are output. There are also three fixes which can do their own
output of user-defined quantities: "fix ave/time"_fix_ave_time.html output of user-chosen quantities: "fix ave/time"_fix_ave_time.html for
for time averaging, "fix ave/spatial"_fix_ave_spatial.html for spatial time averaging, "fix ave/spatial"_fix_ave_spatial.html for spatial
averaging, and "fix print"_fix_print.html. These are described below. averaging, and "fix print"_fix_print.html. These are also described
below. Throughout this discussion, note that users can "add their own
computes and fixes to LAMMPS"_Section_modify.html which can then
generate values that can be output with these commands.
Thermodynamic output :h5
The frequency and format of thermodynamic output is set by the The frequency and format of thermodynamic output is set by the
"thermo"_thermo.html, "thermo_style"_thermo_style.html, and "thermo"_thermo.html, "thermo_style"_thermo_style.html, and
"thermo_modify"_thermo_modify.html commands. The "thermo_modify"_thermo_modify.html commands. The
"thermo_style"_themo_style.html command also specifies what values are "thermo_style"_themo_style.html command also specifies what values are
calculated and written out. Pre-defined keywords can be specified calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc) which include time-averaged versions of (e.g. press, etotal, etc). Three addtional kinds of keywords can also
temperature, pressure, and a few other variables (tave, pave, etc). be specified (c_ID, f_ID, v_name), where a "compute"_compute.html or
Three addtional kinds of keywords can also be specified (c_ID, f_ID, "fix"_fix.html or "variable"_variable.html provides the value to be
v_name), where a "compute"_compute.html or "fix"_fix.html or output. Each of these are described in turn.
"variable"_variable.html provides the value(s) to be output. Each of
these are described in turn.
In LAMMPS, a "compute"_compute.html comes in two flavors: ones that In LAMMPS, a "compute"_compute.html comes in two flavors: ones that
compute one or more global values (e.g. temperature, kinetic energy compute global values (e.g. temperature, pressure tensor) and ones
tensor) and ones that compute one or more per-atom values. There is a that compute per-atom values. Only global quantities from a compute
"compute sum"_compute_sum.html command which sums per-atom quantities can be used for thermodynamic output. The user-defined ID of the
into a global scalar or vector. compute is used along with an optional subscript as part of the
"thermo_style"_thermo_style.html command. E.g. c_myTemp outputs the
single scalar value generated by the compute; c_myTemp\[2\] outputs
the 2nd vector value. Note that there is a "compute
sum"_compute_sum.html command which sums per-atom quantities into a
global scalar or vector.
Only global quantities from a compute can be used for thermodynamic "Fixes"_fix.html can generate global scalar or vector values which can
output. The user-defined ID of the compute is used along with an be output with thermodynamic output, e.g. the energy of an indenter's
optional subscript as part of the "thermo_style"_thermo_style.html interaction with the simulation atoms. These values are accessed via
command. E.g. c_myTemp outputs the single scalar value generated by the same format as a compute's values, as f_ID or f_ID\[N\]. See the
the compute; c_myTemp\[2\] would output the 2nd vector value. doc pages for individual fix commands to see which ones generate
global values that can be output with thermodynamic info. The "fix
ave/time"_fix_ave_time.html command generates time-averaged global
quantities which can be accessed for thermodynamic output, e.g. a
time-averaged pressure.
"Fixes"_fix.html can also generate global scalar or vector values "Variables"_variable.html can be defined in the input script. All
which can be output with thermodynamic output, e.g. the energy of an styles except the atom-style variable can be used for thermodynamic
indenter's interaction with the simulation atoms. These values are output, since it generates per-atom values. A variable with the name
accessed via the same format as a compute's values, as f_ID or
f_ID\[N\]. See the doc pages for individual fix commands to see which
ones generate global values that can be output with thermodynamic
info. The "fix ave/time"_fix_ave_time.html command generates
time-averaged global quantities which can be accessed for
thermodynamic output.
Input script variables of various kinds are defined by the
"variable"_variable.html command. All kinds except the atom-style
variable can be used for thermodynamic output. A variable with name
"abc" is referenced in a thermo_style command as v_abc. "abc" is referenced in a thermo_style command as v_abc.
The variable formula defined in the input script can contain math The formula associated with equal-style variables can contain math
functions (add, exp, etc), atom values (x\[N\], fx\[N\]), groups operations and functions (x+y,x*y,(),sqrt,exp,etc), atom values
quantities (mass(), vcm(), etc), references to thermodynamic (x\[N\],fx\[N\],etc), group functions (mass(),vcm(),etc), references
quantities (e.g. temp, volume, etc), or references to other variables to thermodynamic quantities (temp,press,vol,etc), references to
or "computes"_compute.html or "fixes"_fix.html. Thus a variable is "computes"_compute.html that generate global values, references to
the most general way to define some quantity you want calculated and "fixes"_fix.html that generate global values, or references to other
output with thermodynamic info. "variables"_variable.html. Thus an equal-style variable is the most
general way to define some quantity to calculate and include with
thermodynamic output.
Dump file output :h5
Dump file output is specified by the "dump"_dump.html and Dump file output is specified by the "dump"_dump.html and
"dump_modify"_dump_modify.html commands. There are several "dump_modify"_dump_modify.html commands. There are several
pre-defined formats (dump atom, dump xtc, etc). There is also a "dump pre-defined formats (dump atom, dump xtc, etc). There is also a "dump
custom"_dump.html format where you specify what values are output with custom"_dump.html format where the user specifies what values are
each atom. Pre-defined keywords can be specified (e.g. tag, type, x, output with each atom. Pre-defined keywords can be specified (tag, x,
etc). Two additional kinds of keywords can also be specified (c_ID, fx, etc). Three additional kinds of keywords can also be specified
f_ID), where a "compute"_compute.html or "fix"_fix.html provides the (c_ID, f_ID, v_name), where a "compute"_compute.html or "fix"_fix.html
values to be output. or "variable"_variable.html provides the value to be output. Each of
these are described in turn.
"Computes"_compute.html that generate per-atom values can be accessed "Computes"_compute.html that generate one or more per-atom values can
by the dump custom command. These are computes that have the word be accessed by the dump custom command. These are computes that have
"atom" in their style name, e.g. ke/atom, stress/atom, etc. The the word "atom" in their style name, e.g. ke/atom, stress/atom, etc.
values are accessed as c_myKE for a scalar per-atom quantity or as The values are accessed as c_myKE for a scalar per-atom quantity or as
c_myStress\[2\] for a component of a vector per-atom quantity. The c_myStress\[2\] for a component of a vector per-atom quantity.
"compute variable/atom"_compute_variable_atom.html command takes a
user-defined atom-style "variable"_variable.html as input and
calculates its value for each atom. Since this compute can be
accessed by the dump custom command, this is a general way to define
some quantity you want calculated and output in a dump file.
"Fixes"_fix.html can also generate per-atom values to output to dump "Fixes"_fix.html can generate per-atom values to output to dump files.
files. For example, the "fix ave/atom"_fix_ave_atom.html command For example, the "fix ave/atom"_fix_ave_atom.html command calculates
calculates time-averages of compute quantities. As indicated in the time-averages of per-atom quantities, such as per-atom
preceeding paragraph, a "compute quantity"_compute.html can be a "computes"_compute.html and atom-style "variables"_variable.html.
calculated value such as "energy"_compute_epair_atom.html or
"stress"_compute_stress_atom.html or it can be a value calculated by
an atom-style "variable"_variable.html, or it can be an "atom
attribute"_compute_attribute_atom.html such as velocity or force.
These per-atom fix values are accessed by the "dump custom"_dump.html These per-atom fix values are accessed by the "dump custom"_dump.html
command as f_myKE for a scalar per-atom quantity or as f_myStress\[2\] command via the same format as a compute's values, as f_myKE or
for a component of a vector per-atom quantity. f_myStress\[2\].
"Variables"_variable.html can be defined in the input script. Only
atom-style variables can be used for dump custom output, since only
they produce per-atom values. A variable with the name "abc" is
referenced in a dump custom command as v_abc.
Just like equal-style variables, the formula associated with
atom-style variables can contain math operations and functions
(x+y,x*y,(),sqrt,exp,etc), atom values (x\[N\],fx\[N\],etc), group
functions (mass(),vcm(),etc), references to thermodynamic quantities
(temp,press,vol,etc), references to "computes"_compute.html that
generate global values, references to "fixes"_fix.html that generate
global values, or references to non atom-style variables that generate
global values. In addition, an atom-style variable can reference
vectors of atom values (x\[\],fx\[\],etc), "computes"_compute.html
that generate per-atom values, "fixes"_fix.html that generate per-atom
values, or other atom-style variables. Thus an atom-style variable is
the most general way to define some quantity to calculate and output
to a dump file.
Fix output :h5
Three other fixes are of particular note for output: "fix Three other fixes are of particular note for output: "fix
ave/time"_fix_ave_time.html, "fix ave/spatial"_fix_ave_spatial.html, ave/time"_fix_ave_time.html, "fix ave/spatial"_fix_ave_spatial.html,
and "fix print"_fix_print.html. and "fix print"_fix_print.html.
The "fix ave/time"_fix_ave_time.html command enables time-averaging of The "fix ave/time"_fix_ave_time.html command enables time-averaging of
global quantities like temperature or pressure. The global quantities any global quantity, like those output with thermodynamic info. The
are calculated by a "compute"_compute.html or a "fix"_fix.html. The user specifies one or more quantities to time average. These can be
compute or fix must generate global scalar or vector quantities. Note global "compute"_compute.html values, global "fix"_fix.html values, or
that this includes the "compute sum" command which computes global "variables"_variable.html of any style except the atom style which
values by summing per-atom quantities. The time-averaged values produces per-atom values. Since a variable can refer to keywords used
generated by "fix ave/time"_fix_ave_time.html can be written directly by the "thermo_style custom"_thermo_style.html command (like temp or
to a file and/or accessed by any output command that uses fixes as a press), any thermodynamic quantity can be time averaged in this way.
source of input, e.g. the "thermo_style custom"_thermo_style.html
command. Fix ave/time options allow for running cummulative averages The "fix ave/time"_fix_ave_time.html command offers several options
or moving time-windowed averages to be output. for how it performs time averaging. The results it produces can be
used in two ways. First, they can be written directly to a file, one
line per timestamp. Note that the averaging parameters can be
specified in such a way that averaging is not done at all, in which
case this is simply a convenient means of outputting desired
quantities directly to a separate file. Like other fixes that produce
global quantities, the results of this fix can also be used as input
to any command that accesses global quantities, e.g. by the
"thermo_style custom"_thermo_style.html command, by a variable, etc.
The "fix ave/spatial"_fix_ave_spatial.html command enables The "fix ave/spatial"_fix_ave_spatial.html command enables
spatial-averaging of per-atom quantities like per-atom energy or spatial-averaging of per-atom quantities like those output in dump
stress. The per-atom quantities can be atom density (mass or number) files, within 1d layers of the simulation box. The per-atom
or be calculated by a "compute"_compute.html or a "fix"_fix.html. The quantities can be atom density (mass or number) or atom attributes
compute or fix must generate per-atom scalar or vector quantities. such as position, velocity, force. They can also be per-atom
Note that if you use the "fix ave/atom"_fix_ave_atom.html command with quantities calculated by a "compute"_compute.html, by a
fix ave/spatial, it means you are effectively calculating a time "fix"_fix.html, or by an atom-style "variable"_variable.html.
average of a spatial average of a time-averaged per-atom quantity.
The time-averaged values generated by "fix The "fix ave/spatial"_fix_ave_spatial.html command offers several
ave/spatial"_fix_ave_spatial.html can be written directly to a file options for how it performs time averaging. The per-layer values it
and/or accessed by any output command that uses fixes as a source of produces can be used in two ways. First, they can be written directly
input, e.g. the "thermo_style custom"_thermo_style.html command. Fix to a file. Note that the averaging parameters can be specified in
ave/spatial options allow for running cummulative averages or moving such a way that time averaging is not done, in which case this is a
time-windowed averages to be output. convenient means of simply outputting desired quanitities (summed over
atoms within a 1d layer) directly to a separate file. Like other
fixes that produce global quantities, the results of this fix can also
be used as input by any command that accesses global quantities,
e.g. by the "thermo_style custom"_thermo_style.html command, by a
variable, etc. See the doc page for "fix
ave/spatial"_fix_ave_spatial.html for a description of how these
values are indexed.
The "fix print"_fix_print.html command can generate a line of output The "fix print"_fix_print.html command can generate a line of output
written to the screen and log file periodically during a running written to the screen and log file or to a separate file, periodically
simulation. Since the line can contain one or more during a running simulation. The line can contain one or more
"variable"_variable.html quantities, this command is a means to output "variable"_variable.html values (for any style variable except the
desired calculated quantities that are not part of thermodynamic or atom style), and as explained above, variables themselves can contain
dump file output. references to global values generated by "thermodynamic
keywords"_thermo_style.html, "computes"_compute.html,
"fixes"_fix.html, or other "variables"_variable.html. Thus the "fix
print"_fix_print.html command is a means to output any desired
calculated quantity separate from normal thermodynamic or dump file
output.
This table summarizes the various output options, specifying what
their inputs and outputs are. The frequency with which they are
invoked and produce output is also listed. Basically, any two
commands can be hooked together so long as one produces output that
matches the input needs of the other. A "match" means that the
frequencies and global vs per-atom attributes are the same.
Command: Input: Input Freq: Output: Output Freq
thermo_style custom: thermo keyword, global scalar/vector compute, global scalar/vector fix, equal variable: nthermo: screen, log: nthermo
dump custom: keyword, peratom scalar/vector compute, peratom scalar/vector fix, atom variable: dump freq: file: dump freq
global fixes: N/A: N/A: global scalar/vector: 1 or nevery
peratom fixes: N/A: N/A: peratom scalar/vector: 1 or nevery
fix ave/time: global scalar/vector fix, global scalar/vector compute, equal variable: nevery: global scalar/vector, file: nfreq
fix ave/spatial: peratom scalar/vector fix, peratom scalar/vector compute, atom vector, atom variable, density mass/number: nevery: global vector: nfreq, file
fix ave/atom: peratom scalar/vector compute, peratom scalar/vector fix, atom variable, atom vector: nevery: peratom scalar/vector: nfreq
fix print: any variable: nevery: screen, file: nevery
global computes: N/A: N/A: global scalar/vector: N/A
peratom computes: N/A: N/A: peratom scalar/vector: N/A
compute sum: peratom scalar/vector compute, peratom scalar/vector fix, atom variable: N/A: global scalar/vector: N/A
variable equal: thermo keywords, atom value vx\[123\], global scalar/vector compute, global scalar/vector fix, non-atom variable: N/A: global scalar: N/A
variable atom: thermo keywords, atom value vx\[123\], atom vector vx\[\], global scalar/vector compute, peratom scalar/vector compute, global scalar/vector fix, peratom scalar/vector fix, any variable: N/A: peratom scalar: N/A
print: any variable: N/A: screen, log: between runs
run every: any variable: nevery: screen, log: nevery :tb(s=:)
:line
:line :line
:link(Cornell) :link(Cornell)

View File

@ -29,31 +29,50 @@ compute 3 all ke/atom
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Create a computation that will be performed on a group of atoms. <P>Create a computation that will be performed on a group of atoms.
Quantities calculated by a compute are instantaneous values, meaning
they are calculated from information about atoms on the current
timestep or iteration. There are two kinds of computes, "global"
computes that calculate one or more values for the entire group of
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>
<P>In LAMMPS, a "compute" is used in several ways. There are two kinds <P>In LAMMPS, a "compute" can be used in several ways. The results of
of computes, "global" computes that calculate one or more values for global computes can be output via the <A HREF = "thermo_style.html">thermo_style
the entire group of 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>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. 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 the values can be referenced in a <A HREF = "variable.html">variable equal</A> or
command. The results of computes that calculate a global temperature <A HREF = "variable.html">variable atom</A> command. The results of computes that
or pressure can be used by fixes that do thermostatting or calculate a global temperature or pressure can be used by fixes that
barostatting and when atom velocities are created. do thermostatting or barostatting and when atom velocities are
created.
</P> </P>
<P>The results of per-atom computes can be output via the <A HREF = "dump.html">dump <P>The results of per-atom computes can be output via the <A HREF = "dump.html">dump
custom</A> command or the <A HREF = "fix_ave_spatial.html">fix custom</A> command or the <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> command. Or the per-atom values can 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 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 then output via the <A HREF = "dump.html">dump custom</A> or <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> commands. Note that the value of ave/spatial</A> commands. Or the per-atom values
per-atom computes will be 0.0 for atoms not in the specified compute can be referenced in a <A HREF = "variable.html">variable atom</A> command. Note
group. that the value of per-atom computes will be 0.0 for atoms not in the
specified compute group.
</P> </P>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of <P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options. various LAMMPS output options, many of which involve computes.
</P>
<P>The ID of a compute can only contain alphanumeric characters and
underscores.
</P>
<P>The results of computes 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
compute 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
computes for further info.
</P> </P>
<P>LAMMPS creates its own global computes for thermodynamic output. <P>LAMMPS creates its own global computes for thermodynamic output.
Three computes are always created, named "thermo_temp", Three computes are always created, named "thermo_temp",
@ -64,20 +83,20 @@ invoked in the input script:
compute thermo_pressure all pressure thermo_temp compute thermo_pressure all pressure thermo_temp
compute thermo_pe all pe compute thermo_pe all pe
</PRE> </PRE>
<P>Additional computes are created if the thermo style requires it. See <P>Additional computes for other quantities are created if the thermo
the documentation for the <A HREF = "thermo_style.html">thermo_style</A> command. style requires it. See the documentation for the
<A HREF = "thermo_style.html">thermo_style</A> command.
</P> </P>
<P>The dumping of atom snapshots and fixes that compute temperature or <P>Fixes that calculate temperature or pressure, i.e. for thermostatting
pressure also create computes as required. These are discussed in the or barostatting, may also create computes. These are discussed in the
documentation for the <A HREF = "dump.html">dump custom</A> and specific documentation for specific <A HREF = "fix.html">fix</A> commands.
<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 can be replaced by computes
defined by the user in the input script, as described by the defined by the user in the input script, as described by the
<A HREF = "thermo_modify.html">thermo_modify</A>, <A HREF = "fix_modify.html">fix modify</A>, and <A HREF = "thermo_modify.html">thermo_modify</A> and <A HREF = "fix_modify.html">fix modify</A>
<A HREF = "dump.html">dump</A> commands. commands.
</P> </P>
<P>Properties of either a default of 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.
</P> </P>
<P>Computes can be deleted with the <A HREF = "uncompute.html">uncompute</A> command. <P>Computes can be deleted with the <A HREF = "uncompute.html">uncompute</A> command.
@ -88,29 +107,25 @@ calculations accessed in the various ways described above.
</P> </P>
<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
defined in LAMMPS: available in LAMMPS:
</P> </P>
<UL><LI><A HREF = "compute_attribute_atom.html">attribute/atom</A> - attribute (x,v,f,etc) of each atom <UL><LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom
<LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom
<LI><A HREF = "compute_coord_atom.html">coord/atom</A> - coordination number for each atom <LI><A HREF = "compute_coord_atom.html">coord/atom</A> - coordination number for each atom
<LI><A HREF = "compute_ke_atom.html">ke/atom</A> - kinetic energy for each atom <LI><A HREF = "compute_ke_atom.html">ke/atom</A> - kinetic energy for each atom
<LI><A HREF = "compute_pe.html">pe</A> - potential energy <LI><A HREF = "compute_pe.html">pe</A> - potential energy
<LI><A HREF = "compute_pe.html">pe</A> - potential energy for each atom <LI><A HREF = "compute_pe_atom.html">pe/atom</A> - potential energy for each atom
<LI><A HREF = "compute_pressure.html">pressure</A> - total pressure and pressure tensor <LI><A HREF = "compute_pressure.html">pressure</A> - total pressure and pressure tensor
<LI><A HREF = "compute_rotate_dipole.html">rotate/dipole</A> - rotational energy of dipolar atoms <LI><A HREF = "compute_rotate_dipole.html">rotate/dipole</A> - rotational energy of dipolar atoms
<LI><A HREF = "compute_rotate_gran.html">rotate/gran</A> - rotational energy of granular atoms <LI><A HREF = "compute_rotate_gran.html">rotate/gran</A> - rotational energy of granular atoms
<LI><A HREF = "compute_stress_atom.html">stress/atom</A> - stress tensor for each atom <LI><A HREF = "compute_stress_atom.html">stress/atom</A> - stress tensor for each atom
<LI><A HREF = "compute_sum.html">sum</A> - sum per-atom quantities to a global value <LI><A HREF = "compute_sum.html">sum</A> - sum per-atom quantities to a global value
<LI><A HREF = "compute_sum_atom.html">sum/atom</A> - sum per-atom quantities to per-atom values
<LI><A HREF = "compute_temp.html">temp</A> - temperature of group of atoms <LI><A HREF = "compute_temp.html">temp</A> - temperature of group of atoms
<LI><A HREF = "compute_temp_asphere.html">temp/asphere</A> - temperature of aspherical particles <LI><A HREF = "compute_temp_asphere.html">temp/asphere</A> - temperature of aspherical particles
<LI><A HREF = "compute_temp_deform.html">temp/deform</A> - temperature excluding box deformation velocity <LI><A HREF = "compute_temp_deform.html">temp/deform</A> - temperature excluding box deformation velocity
<LI><A HREF = "compute_temp_dipole.html">temp/dipole</A> - temperature of point dipolar particles <LI><A HREF = "compute_temp_dipole.html">temp/dipole</A> - temperature of point dipolar particles
<LI><A HREF = "compute_temp_partial.html">temp/partial</A> - temperature excluding one or more dimensions of velocity <LI><A HREF = "compute_temp_partial.html">temp/partial</A> - temperature excluding one or more dimensions of velocity
<LI><A HREF = "compute_temp_ramp.html">temp/ramp</A> - temperature excluding ramped velocity component <LI><A HREF = "compute_temp_ramp.html">temp/ramp</A> - temperature excluding ramped velocity component
<LI><A HREF = "compute_temp_region.html">temp/region</A> - temperature of a region of atoms <LI><A HREF = "compute_temp_region.html">temp/region</A> - temperature of a region of atoms
<LI><A HREF = "compute_variable.html">variable</A> - calculate a scalar value from a variable
<LI><A HREF = "compute_variable_atom.html">variable/atom</A> - calculate a formula for each atom
</UL> </UL>
<P>There are also additional compute styles submitted by users which are <P>There are also additional compute styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to included in the LAMMPS distribution. The list of these with links to

View File

@ -26,31 +26,50 @@ compute 3 all ke/atom :pre
[Description:] [Description:]
Create a computation that will be performed on a group of atoms. Create a computation that will be performed on a group of atoms.
Quantities calculated by a compute are instantaneous values, meaning
they are calculated from information about atoms on the current
timestep or iteration. There are two kinds of computes, "global"
computes that calculate one or more values for the entire group of
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" is used in several ways. There are two kinds In LAMMPS, a "compute" can be used in several ways. The results of
of computes, "global" computes that calculate one or more values for global computes can be output via the "thermo_style
the entire group of 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.
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. 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 the values can be referenced in a "variable equal"_variable.html or
command. The results of computes that calculate a global temperature "variable atom"_variable.html command. The results of computes that
or pressure can be used by fixes that do thermostatting or calculate a global temperature or pressure can be used by fixes that
barostatting and when atom velocities are created. do thermostatting or barostatting and when atom velocities are
created.
The results of per-atom computes can be output via the "dump The results of per-atom computes can be output via the "dump
custom"_dump.html command or the "fix custom"_dump.html command or the "fix
ave/spatial"_fix_ave_spatial.html command. Or the per-atom values can 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 be time-averaged via the "fix ave/atom"_fix_ave_atom.html command and
then output via the "dump custom"_dump.html or "fix then output via the "dump custom"_dump.html or "fix
ave/spatial"_fix_ave_spatial.html commands. Note that the value of ave/spatial"_fix_ave_spatial.html commands. Or the per-atom values
per-atom computes will be 0.0 for atoms not in the specified compute can be referenced in a "variable atom"_variable.html command. Note
group. 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 See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options. various LAMMPS output options, many of which involve computes.
The ID of a compute can only contain alphanumeric characters and
underscores.
The results of computes 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
compute 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
computes for further info.
LAMMPS creates its own global computes for thermodynamic output. LAMMPS creates its own global computes for thermodynamic output.
Three computes are always created, named "thermo_temp", Three computes are always created, named "thermo_temp",
@ -61,20 +80,20 @@ compute thermo_temp all temp
compute thermo_pressure all pressure thermo_temp compute thermo_pressure all pressure thermo_temp
compute thermo_pe all pe :pre compute thermo_pe all pe :pre
Additional computes are created if the thermo style requires it. See Additional computes for other quantities are created if the thermo
the documentation for the "thermo_style"_thermo_style.html command. style requires it. See the documentation for the
"thermo_style"_thermo_style.html command.
The dumping of atom snapshots and fixes that compute temperature or Fixes that calculate temperature or pressure, i.e. for thermostatting
pressure also create computes as required. These are discussed in the or barostatting, may also create computes. These are discussed in the
documentation for the "dump custom"_dump.html and specific documentation for specific "fix"_fix.html commands.
"fix"_fix.html commands.
In all these cases, the default computes can be replaced by computes In all these cases, the default computes can be replaced by computes
defined by the user in the input script, as described by the defined by the user in the input script, as described by the
"thermo_modify"_thermo_modify.html, "fix modify"_fix_modify.html, and "thermo_modify"_thermo_modify.html and "fix modify"_fix_modify.html
"dump"_dump.html commands. commands.
Properties of either a default of 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.
Computes can be deleted with the "uncompute"_uncompute.html command. Computes can be deleted with the "uncompute"_uncompute.html command.
@ -85,29 +104,25 @@ calculations accessed in the various ways described above.
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
defined in LAMMPS: available in LAMMPS:
"attribute/atom"_compute_attribute_atom.html - attribute (x,v,f,etc) of each atom
"centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom "centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom
"coord/atom"_compute_coord_atom.html - coordination number for each atom "coord/atom"_compute_coord_atom.html - coordination number for each atom
"ke/atom"_compute_ke_atom.html - kinetic energy for each atom "ke/atom"_compute_ke_atom.html - kinetic energy for each atom
"pe"_compute_pe.html - potential energy "pe"_compute_pe.html - potential energy
"pe"_compute_pe.html - potential energy for each atom "pe/atom"_compute_pe_atom.html - potential energy for each atom
"pressure"_compute_pressure.html - total pressure and pressure tensor "pressure"_compute_pressure.html - total pressure and pressure tensor
"rotate/dipole"_compute_rotate_dipole.html - rotational energy of dipolar atoms "rotate/dipole"_compute_rotate_dipole.html - rotational energy of dipolar atoms
"rotate/gran"_compute_rotate_gran.html - rotational energy of granular atoms "rotate/gran"_compute_rotate_gran.html - rotational energy of granular atoms
"stress/atom"_compute_stress_atom.html - stress tensor for each atom "stress/atom"_compute_stress_atom.html - stress tensor for each atom
"sum"_compute_sum.html - sum per-atom quantities to a global value "sum"_compute_sum.html - sum per-atom quantities to a global value
"sum/atom"_compute_sum_atom.html - sum per-atom quantities to per-atom values
"temp"_compute_temp.html - temperature of group of atoms "temp"_compute_temp.html - temperature of group of atoms
"temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles "temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles
"temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity "temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity
"temp/dipole"_compute_temp_dipole.html - temperature of point dipolar particles "temp/dipole"_compute_temp_dipole.html - temperature of point dipolar particles
"temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity "temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity
"temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component "temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component
"temp/region"_compute_temp_region.html - temperature of a region of atoms "temp/region"_compute_temp_region.html - temperature of a region of atoms :ul
"variable"_compute_variable.html - calculate a scalar value from a variable
"variable/atom"_compute_variable_atom.html - calculate a formula for each atom :ul
There are also additional compute styles submitted by users which are There are also additional compute styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to included in the LAMMPS distribution. The list of these with links to

View File

@ -1,75 +0,0 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute attribute/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID attribute/atom style
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>attribute/atom = style name of this compute command
<LI>style = <I>x</I> or <I>y</I> or <I>z</I> or <I>xu</I> or <I>yu</I> or <I>zu</I> or <I>vx</I> or <I>vy</I> or <I>vz</I> or <I>fx</I> or <I>fy</I> or <I>fz</I> or <I>xyz</I> or <I>v</I> or <I>f</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all attribute/atom vy
compute mine all attribute/atom xyz
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates (or simply stores) one or more
attributes for each atom in a group. This is useful for input to the
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command to do spatial averaging
by layers or to the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command to
perform time-averaging of per-atom quantities. The attribute values
can also be output directly by the <A HREF = "dump.html">dump custom</A> command,
but it has keywords that output these quantities without the need to
define an additional compute.
</P>
<P>The value of the attribute will be 0.0 for atoms not in the specified
compute group.
</P>
<P>The styles <I>x</I>, <I>y</I>, <I>z</I>, <I>xu</I>, <I>yu</I>, <I>zu</I>, <I>vx</I>, <I>vy</I>, <I>vz</I>, <I>fx</I>,
<I>fy</I>, and <I>fz</I> each store a single scalar value per atom.
</P>
<P>The <I>x</I>, <I>y</I>, <I>z</I> keywords store atom coordinate in the appropriate
distance <A HREF = "units.html">units</A> (Angstroms, sigma, etc) and will always be
inside (or slightly outside) the simulation box. Use <I>xu</I>, <I>yu</I>, <I>zu</I>
if you want the coordinates "unwrapped" by the image flags for each
atom. Unwrapped means that if the atom has passed thru a periodic
boundary one or more times, the value is printed for what the
coordinate would be if it had not been wrapped back into the periodic
box. Note that using <I>xu</I>, <I>yu</I>, <I>zu</I> means that the coordinate
values may be far outside the simulation box.
</P>
<P>Note that if you want to compute the time-averaged position of an atom
coordinate that could pass thru a periodic boundary (e.g. via the <A HREF = "fix_ave_atom.html">fix
ave/atom</A> command), you probably want to use <I>xu</I>
instead of <I>x</I>.
</P>
<P>The styles <I>xyz</I>, <I>v</I>, and <I>f</I> each store a vector of 3 quantities per
atom.
</P>
<P>Note that the various commands that reference this compute use a
different syntax for accessing scalar versus vector values, e.g. c_ID
versus c_ID[2].
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_ave_atom.html">fix ave/atom</A>, <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A>, <A HREF = "dump.html">dump custom</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>

View File

@ -1,70 +0,0 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute attribute/atom command :h3
[Syntax:]
compute ID group-ID attribute/atom style :pre
ID, group-ID are documented in "compute"_compute.html command
attribute/atom = style name of this compute command
style = {x} or {y} or {z} or {xu} or {yu} or {zu} or {vx} or {vy} or {vz} or {fx} or {fy} or {fz} or {xyz} or {v} or {f} :ul
[Examples:]
compute 1 all attribute/atom vy
compute mine all attribute/atom xyz :pre
[Description:]
Define a computation that calculates (or simply stores) one or more
attributes for each atom in a group. This is useful for input to the
"fix ave/spatial"_fix_ave_spatial.html command to do spatial averaging
by layers or to the "fix ave/atom"_fix_ave_atom.html command to
perform time-averaging of per-atom quantities. The attribute values
can also be output directly by the "dump custom"_dump.html command,
but it has keywords that output these quantities without the need to
define an additional compute.
The value of the attribute will be 0.0 for atoms not in the specified
compute group.
The styles {x}, {y}, {z}, {xu}, {yu}, {zu}, {vx}, {vy}, {vz}, {fx},
{fy}, and {fz} each store a single scalar value per atom.
The {x}, {y}, {z} keywords store atom coordinate in the appropriate
distance "units"_units.html (Angstroms, sigma, etc) and will always be
inside (or slightly outside) the simulation box. Use {xu}, {yu}, {zu}
if you want the coordinates "unwrapped" by the image flags for each
atom. Unwrapped means that if the atom has passed thru a periodic
boundary one or more times, the value is printed for what the
coordinate would be if it had not been wrapped back into the periodic
box. Note that using {xu}, {yu}, {zu} means that the coordinate
values may be far outside the simulation box.
Note that if you want to compute the time-averaged position of an atom
coordinate that could pass thru a periodic boundary (e.g. via the "fix
ave/atom"_fix_ave_atom.html command), you probably want to use {xu}
instead of {x}.
The styles {xyz}, {v}, and {f} each store a vector of 3 quantities per
atom.
Note that the various commands that reference this compute use a
different syntax for accessing scalar versus vector values, e.g. c_ID
versus c_ID\[2\].
[Restrictions:] none
[Related commands:]
"fix ave/atom"_fix_ave_atom.html, "fix
ave/spatial"_fix_ave_spatial.html, "dump custom"_dump.html
[Default:] none

View File

@ -54,6 +54,11 @@ LAMMPS starts up, as if this command were in the input script:
</PRE> </PRE>
<P>See the "thermo_style" command for more details. <P>See the "thermo_style" command for more details.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "extensive", meaning it
it scales with the number of atoms in the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -51,6 +51,11 @@ compute thermo_pe all pe :pre
See the "thermo_style" command for more details. See the "thermo_style" command for more details.
[Output info:]
The scalar value calculated by this compute is "extensive", meaning it
it scales with the number of atoms in the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -82,6 +82,13 @@ when LAMMPS starts up, as if this command were in the input script:
<P>where "thermo_temp" is the ID of a similarly defined compute of style <P>where "thermo_temp" is the ID of a similarly defined compute of style
"temp". See the "thermo_style" command for more details. "temp". See the "thermo_style" command for more details.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -79,6 +79,13 @@ compute thermo_pressure all pressure thermo_temp :pre
where "thermo_temp" is the ID of a similarly defined compute of style where "thermo_temp" is the ID of a similarly defined compute of style
"temp". See the "thermo_style" command for more details. "temp". See the "thermo_style" command for more details.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -31,6 +31,11 @@ group of atoms with point dipole moments.
the atoms in the group, where I is the moment of inertia of a the atoms in the group, where I is the moment of inertia of a
disk/spherical (2d/3d) particle, and w is its angular velocity. disk/spherical (2d/3d) particle, and w is its angular velocity.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "extensive", meaning it
it scales with the number of atoms in the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> none <P><B>Related commands:</B> none

View File

@ -28,6 +28,11 @@ The rotational energy is calculated as the sum of 1/2 I w^2 over all
the atoms in the group, where I is the moment of inertia of a the atoms in the group, where I is the moment of inertia of a
disk/spherical (2d/3d) particle, and w is its angular velocity. disk/spherical (2d/3d) particle, and w is its angular velocity.
[Output info:]
The scalar value calculated by this compute is "extensive", meaning it
it scales with the number of atoms in the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] none [Related commands:] none

View File

@ -31,6 +31,11 @@ group of granular atoms.
the atoms in the group, where I is the moment of inertia of a the atoms in the group, where I is the moment of inertia of a
disk/spherical (2d/3d) particle, and w is its angular velocity. disk/spherical (2d/3d) particle, and w is its angular velocity.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "extensive", meaning it
it scales with the number of atoms in the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> none <P><B>Related commands:</B> none

View File

@ -28,6 +28,11 @@ The rotational energy is calculated as the sum of 1/2 I w^2 over all
the atoms in the group, where I is the moment of inertia of a the atoms in the group, where I is the moment of inertia of a
disk/spherical (2d/3d) particle, and w is its angular velocity. disk/spherical (2d/3d) particle, and w is its angular velocity.
[Output info:]
The scalar value calculated by this compute is "extensive", meaning it
it scales with the number of atoms in the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] none [Related commands:] none

View File

@ -13,45 +13,85 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>compute ID group-ID sum compute-ID1 compute-ID2 ... <PRE>compute ID group-ID sum value1 value2 ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command <UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>sum/ = style name of this compute command
<LI>compute-ID1, 2, ... = IDs of computes that calculate per-atom quantities <LI>sum = style name of this compute command
<LI>one or more values can be listed
<LI>value = 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)
c_ID = per-atom scalar value calculated by a compute with ID
c_ID[N] = Nth component of per-atom vector calculated by a compute with ID
f_ID = per-atom scalar value calculated by a fix with ID
f_ID[N] = Nth component of per-atom vector calculated by a fix with ID
v_name = per-atom value calculated by an atom-style variable with name
</PRE>
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>compute 1 all sum c_force <PRE>compute 1 all sum c_force
compute 1 all sum atomKE atomEpair atomEbond compute 2 all sum c_press<B>2</B> f_ave v_myKE
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Define a computation that sums the results of one or more per-atom <P>Define a calculation that sums the results of one or more per-atom
computes across all atoms in the group to yield a global scalar or quantities across all atoms in the group to yield a global scalar or
vector quantity. For example, the forces on a group of atoms could be vector quantity. The resulting value(s) can be accessed by any
summed to yield a net force on the group. The resulting value(s) can command that uses global computes, e.g. the <A HREF = "therml_style.html">thermo
be accessed by any command that uses global computes, e.g. the <A HREF = "therml_style.html">thermo
custom</A> command or <A HREF = "fix_ave_time.html">fix ave/time</A> custom</A> command or <A HREF = "fix_ave_time.html">fix ave/time</A>
command or by a <A HREF = "variable.html">variable</A> command. command or by a <A HREF = "variable.html">variable</A> command. See <A HREF = "Section_howto.html#4_15">this
section</A> of the documentation for an overview
of output options.
</P> </P>
<P>Unlike the <A HREF = "compute_sum_atom.html">compute sum/atom</A> command, the <P>Each listed value is summed independently. The group specified with
result of this is not a per-atom quantity, but a global scalar or the command means only atoms within the group contribute to the sum.
vector. If the other computes each generate a scalar value per atom, Note that the value that produces the per-atom quantities may define
this compute will generate a single scalar value. If the other its own group which affects the values it returns. For example, if a
computes each generate a vector of values per atom, this compute will per-atom compute is used as a value, it will generate values of 0.0
generate a vector of values where each value is the sum across atoms for atoms that are not in the group specified for that compute.
of the corresponding value produced by the other computes. In the
latter case, all the other computes must generate per-atom vectors of
the same size.
</P> </P>
<P>Note that all per-atom computes generate values of 0.0 for atoms that <P>Each listed value can be an atom attribute (position, velocity, force
are not in the group specified for that compute. 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 = "variable.html">variable</A>. In the latter cases, the compute, fix, or
variable must produce a per-atom quantity, not a global quantity.
</P>
<P><A HREF = "compute.html">Computes</A> that produce per-atom quantities are those
which have the word <I>atom</I> in their style name. Currently the only
fix that produces per-atom quantities is the <A HREF = "fix_ave_atom.html">fix
ave/atom</A> command. <A HREF = "variable.html">Variables</A> of
style <I>atom</I> are the only ones that can be used with this compute
since all other variable stylse produce global quantities.
</P>
<P>If a single value is specified this compute produces a global scalar
value. If multiple values are specified, this compute produces a
vector of global values, the length of which is equal to the
number of values specified.
</P>
<P>The value(s) produced by this compute are all "extensive", meaning
their value scales linearly with the number of atoms involved. If
normalized values are desired, this compute can be accessed by the
<A HREF = "thermo_style.html">thermo_style custom</A> command with <A HREF = "thermo_modify.html">thermo_modify
norm yes</A> set as an option. Or it can be accessed
by a <A HREF = "variable.html">variable</A> that divides by the appropriate atom
count.
</P>
<P><B>Output info:</B>
</P>
<P>The scalar and vector values calculated by this compute are
"extensive", meaning they scale with the number of atoms in the
simulation.
</P> </P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>
</P> </P>
<P><A HREF = "compute_sum_atom.html">compute sum/atom</A> <P><A HREF = "compute.html">compute</A>, <A HREF = "fix.html">fix</A>, <A HREF = "variable.html">variable</A>
</P> </P>
<P><B>Default:</B> none <P><B>Default:</B> none
</P> </P>

View File

@ -10,44 +10,79 @@ compute sum command :h3
[Syntax:] [Syntax:]
compute ID group-ID sum compute-ID1 compute-ID2 ... :pre compute ID group-ID sum value1 value2 ... :pre
ID, group-ID are documented in "compute"_compute.html command ID, group-ID are documented in "compute"_compute.html command :ulb,l
sum/ = style name of this compute command sum = style name of this compute command :l
compute-ID1, 2, ... = IDs of computes that calculate per-atom quantities :ul one or more values can be listed :l
value = 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)
c_ID = per-atom scalar value calculated by a compute with ID
c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID
f_ID = per-atom scalar value calculated by a fix with ID
f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID
v_name = per-atom value calculated by an atom-style variable with name :pre
:ule
[Examples:] [Examples:]
compute 1 all sum c_force compute 1 all sum c_force
compute 1 all sum atomKE atomEpair atomEbond :pre compute 2 all sum c_press[2] f_ave v_myKE :pre
[Description:] [Description:]
Define a computation that sums the results of one or more per-atom Define a calculation that sums the results of one or more per-atom
computes across all atoms in the group to yield a global scalar or quantities across all atoms in the group to yield a global scalar or
vector quantity. For example, the forces on a group of atoms could be vector quantity. The resulting value(s) can be accessed by any
summed to yield a net force on the group. The resulting value(s) can command that uses global computes, e.g. the "thermo
be accessed by any command that uses global computes, e.g. the "thermo
custom"_therml_style.html command or "fix ave/time"_fix_ave_time.html custom"_therml_style.html command or "fix ave/time"_fix_ave_time.html
command or by a "variable"_variable.html command. command or by a "variable"_variable.html command. See "this
section"_Section_howto.html#4_15 of the documentation for an overview
of output options.
Unlike the "compute sum/atom"_compute_sum_atom.html command, the Each listed value is summed independently. The group specified with
result of this is not a per-atom quantity, but a global scalar or the command means only atoms within the group contribute to the sum.
vector. If the other computes each generate a scalar value per atom, Note that the value that produces the per-atom quantities may define
this compute will generate a single scalar value. If the other its own group which affects the values it returns. For example, if a
computes each generate a vector of values per atom, this compute will per-atom compute is used as a value, it will generate values of 0.0
generate a vector of values where each value is the sum across atoms for atoms that are not in the group specified for that compute.
of the corresponding value produced by the other computes. In the
latter case, all the other computes must generate per-atom vectors of
the same size.
Note that all per-atom computes generate values of 0.0 for atoms that Each listed value can be an atom attribute (position, velocity, force
are not in the group specified for that compute. component) or can be the result of a "compute"_compute.html or
"fix"_fix.html or the evaluation of an atom-style
"variable"_variable.html. In the latter cases, the compute, fix, or
variable must produce a per-atom quantity, not a global quantity.
"Computes"_compute.html that produce per-atom quantities are those
which have the word {atom} in their style name. Currently the only
fix that produces per-atom quantities is the "fix
ave/atom"_fix_ave_atom.html command. "Variables"_variable.html of
style {atom} are the only ones that can be used with this compute
since all other variable stylse produce global quantities.
If a single value is specified this compute produces a global scalar
value. If multiple values are specified, this compute produces a
vector of global values, the length of which is equal to the
number of values specified.
The value(s) produced by this compute are all "extensive", meaning
their value scales linearly with the number of atoms involved. If
normalized values are desired, this compute can be accessed by the
"thermo_style custom"_thermo_style.html command with "thermo_modify
norm yes"_thermo_modify.html set as an option. Or it can be accessed
by a "variable"_variable.html that divides by the appropriate atom
count.
[Output info:]
The scalar and vector values calculated by this compute are
"extensive", meaning they scale with the number of atoms in the
simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]
"compute sum/atom"_compute_sum_atom.html "compute"_compute.html, "fix"_fix.html, "variable"_variable.html
[Default:] none [Default:] none

View File

@ -1,54 +0,0 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute sum/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID sum/atom compute-ID1 compute-ID2 ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>sum/atom = style name of this compute command
<LI>compute-ID1, 2, ... = IDs of computes that calculate per-atom quantities
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all sum/atom atomKE atomEpair atomEbond
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that sums the results of two or more other
computes for each atom in a group. This is useful for summing atom
properties such as pairwise energy, bond energy, kinetic energy, etc.
The resulting values can be accessed by any command that uses per-atom
computes, e.g. the <A HREF = "dump.html">dump custom</A> command or <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> command or <A HREF = "fix_ave_atom.html">fix
ave/atom</A> command.
</P>
<P>The value of the sum will be 0.0 for atoms not in the specified
compute group.
</P>
<P>The result of this compute depends on the results generated by the
other computes that it invokes. E.g. if the other computes each
generate a scalar value per atom, so will this compute. If the other
computes each generate a vector of values per atom, so will this
compute. In the latter case, all the other computes must generate
per-atom vectors of the same size.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_sum.html">compute sum</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>

View File

@ -1,49 +0,0 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute sum/atom command :h3
[Syntax:]
compute ID group-ID sum/atom compute-ID1 compute-ID2 ... :pre
ID, group-ID are documented in "compute"_compute.html command
sum/atom = style name of this compute command
compute-ID1, 2, ... = IDs of computes that calculate per-atom quantities :ul
[Examples:]
compute 1 all sum/atom atomKE atomEpair atomEbond :pre
[Description:]
Define a computation that sums the results of two or more other
computes for each atom in a group. This is useful for summing atom
properties such as pairwise energy, bond energy, kinetic energy, etc.
The resulting values can be accessed by any command that uses per-atom
computes, e.g. the "dump custom"_dump.html command or "fix
ave/spatial"_fix_ave_spatial.html command or "fix
ave/atom"_fix_ave_atom.html command.
The value of the sum will be 0.0 for atoms not in the specified
compute group.
The result of this compute depends on the results generated by the
other computes that it invokes. E.g. if the other computes each
generate a scalar value per atom, so will this compute. If the other
computes each generate a vector of values per atom, so will this
compute. In the latter case, all the other computes must generate
per-atom vectors of the same size.
[Restrictions:] none
[Related commands:]
"compute sum"_compute_sum.html
[Default:] none

View File

@ -58,6 +58,13 @@ LAMMPS starts up, as if this command were in the input script:
</PRE> </PRE>
<P>See the "thermo_style" command for more details. <P>See the "thermo_style" command for more details.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -55,6 +55,13 @@ compute thermo_temp all temp :pre
See the "thermo_style" command for more details. See the "thermo_style" command for more details.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -33,6 +33,13 @@ moments of inertia are unequal. The associated kinetic energy thus
includes a rotational term KE_rotational = 1/2 I w^2, where I is the includes a rotational term KE_rotational = 1/2 I w^2, where I is the
moment of inertia and w is the angular velocity. moment of inertia and w is the angular velocity.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> <P><B>Restrictions:</B>
</P> </P>
<P>Can only be used if LAMMPS was built with the "asphere" package. <P>Can only be used if LAMMPS was built with the "asphere" package.

View File

@ -30,6 +30,13 @@ moments of inertia are unequal. The associated kinetic energy thus
includes a rotational term KE_rotational = 1/2 I w^2, where I is the includes a rotational term KE_rotational = 1/2 I w^2, where I is the
moment of inertia and w is the angular velocity. moment of inertia and w is the angular velocity.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] [Restrictions:]
Can only be used if LAMMPS was built with the "asphere" package. Can only be used if LAMMPS was built with the "asphere" package.

View File

@ -76,6 +76,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees-of-freedom can be altered using the
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command. <I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -73,6 +73,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command. {extra} option of the "compute_modify"_compute_modify.html command.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -33,6 +33,13 @@ particles. The associated kinetic energy includes a rotational term
KE_rotational = 1/2 I w^2, where I is the moment of inertia and w is KE_rotational = 1/2 I w^2, where I is the moment of inertia and w is
the angular velocity. the angular velocity.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> <P><B>Restrictions:</B>
</P> </P>
<P>Can only be used if LAMMPS was built with the "dipole" package. <P>Can only be used if LAMMPS was built with the "dipole" package.

View File

@ -30,6 +30,13 @@ particles. The associated kinetic energy includes a rotational term
KE_rotational = 1/2 I w^2, where I is the moment of inertia and w is KE_rotational = 1/2 I w^2, where I is the moment of inertia and w is
the angular velocity. the angular velocity.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] [Restrictions:]
Can only be used if LAMMPS was built with the "dipole" package. Can only be used if LAMMPS was built with the "dipole" package.

View File

@ -55,6 +55,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees-of-freedom can be altered using the
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command. <I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -52,6 +52,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command. {extra} option of the "compute_modify"_compute_modify.html command.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -67,6 +67,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees-of-freedom can be altered using the
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command. <I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -63,6 +63,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command. {extra} option of the "compute_modify"_compute_modify.html command.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -64,6 +64,13 @@ constrain molecular motion, such as <A HREF = "fix_shake.html">fix shake</A> and
degrees-of-freedom can be altered using the <I>extra</I> option of the degrees-of-freedom can be altered using the <I>extra</I> option of the
<A HREF = "compute_modify.html">compute_modify</A> command. <A HREF = "compute_modify.html">compute_modify</A> command.
</P> </P>
<P><B>Output info:</B>
</P>
<P>The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
</P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>

View File

@ -61,6 +61,13 @@ constrain molecular motion, such as "fix shake"_fix_shake.html and
degrees-of-freedom can be altered using the {extra} option of the degrees-of-freedom can be altered using the {extra} option of the
"compute_modify"_compute_modify.html command. "compute_modify"_compute_modify.html command.
[Output info:]
The scalar value calculated by this compute is "intensive", meaning it
is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in
the simulation.
[Restrictions:] none [Restrictions:] none
[Related commands:] [Related commands:]

View File

@ -1,55 +0,0 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute variable command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID variable name
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>variable/atom = style name of this compute command
<LI>name = variable name to invoke to compute a scalar quantity
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all variable myTemp
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates a formula that returns a scalar
quantity. This quantity can be time averaged and output via the <A HREF = "fix_ave_time.html">fix
ave/time</A> command. It could also be output via the
<A HREF = "thermo_style.html">thermo_style custom</A> command, although it makes
more sense to access the variable directly in this case.
</P>
<P>The formula is defined by the <A HREF = "variable.html">variable equal</A> command.
A variable of style <I>equal</I> can access properties of the system, such
as volume or temperature, and also reference individual atom
attributes, such as its coordinates or velocity.
</P>
<P>For example, these 3 commands would time average the system density
(assuming the volume fluctuates) temperature and output the average
value periodically to the file den.profile:
</P>
<PRE>variable den equal div(atoms,vol)
compute density all variable den
fix 1 all ave/time 1 1000 density 0 den.profile
</PRE>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_ave_time.html">fix ave/time</A>, <A HREF = "variable.html">variable</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>

View File

@ -1,50 +0,0 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute variable command :h3
[Syntax:]
compute ID group-ID variable name :pre
ID, group-ID are documented in "compute"_compute.html command
variable/atom = style name of this compute command
name = variable name to invoke to compute a scalar quantity :ul
[Examples:]
compute 1 all variable myTemp :pre
[Description:]
Define a computation that calculates a formula that returns a scalar
quantity. This quantity can be time averaged and output via the "fix
ave/time"_fix_ave_time.html command. It could also be output via the
"thermo_style custom"_thermo_style.html command, although it makes
more sense to access the variable directly in this case.
The formula is defined by the "variable equal"_variable.html command.
A variable of style {equal} can access properties of the system, such
as volume or temperature, and also reference individual atom
attributes, such as its coordinates or velocity.
For example, these 3 commands would time average the system density
(assuming the volume fluctuates) temperature and output the average
value periodically to the file den.profile:
variable den equal div(atoms,vol)
compute density all variable den
fix 1 all ave/time 1 1000 density 0 den.profile :pre
[Restrictions:] none
[Related commands:]
"fix ave/time"_fix_ave_time.html, "variable"_variable.html
[Default:] none

View File

@ -1,65 +0,0 @@
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute variable/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID variable/atom name
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>variable/atom = style name of this compute command
<LI>name = variable name to invoke for each atom
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 flow variable/atom myVar
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates a formula for each atom in the
group. The resulting values can be accessed by any command that uses
per-atom computes, e.g. the <A HREF = "dump.html">dump custom</A> command or <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> command or <A HREF = "fix_ave_atom.html">fix
ave/atom</A> command.
</P>
<P>The value of the variable evaluation will be 0.0 for atoms not in the
specified compute group.
</P>
<P>The formula is defined by the <A HREF = "variable.html">variable atom</A> command.
A variable of style <I>atom</I> can access properties of the system, such
as volume or temperature, and also reference individual atom
attributes, such as its coordinates or velocity.
</P>
<P>For example, these 3 commands would compute the xy kinectic energy of
atoms in the flow group and include the values in dumped snapshots of
the system.
</P>
<PRE>variable xy atom mult(0.5,add(mult(vx[],vx[]),mult(vy[],vy[])))
compute ke flow variable/atom xy
dump 1 flow custom 1000 dump.flow tag type x y z c_ke
</PRE>
<P>If the dump line were replaced by
</P>
<PRE>fix 1 flow ave/spatial 100 1000 z lower 2.0 ke.profile compute ke
</PRE>
<P>then the xy kinetic energy values would be averaged by z layer and the
layer averages written periodically to the file ke.profile.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump custom</A>, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>

View File

@ -1,60 +0,0 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute variable/atom command :h3
[Syntax:]
compute ID group-ID variable/atom name :pre
ID, group-ID are documented in "compute"_compute.html command
variable/atom = style name of this compute command
name = variable name to invoke for each atom :ul
[Examples:]
compute 1 flow variable/atom myVar :pre
[Description:]
Define a computation that calculates a formula for each atom in the
group. The resulting values can be accessed by any command that uses
per-atom computes, e.g. the "dump custom"_dump.html command or "fix
ave/spatial"_fix_ave_spatial.html command or "fix
ave/atom"_fix_ave_atom.html command.
The value of the variable evaluation will be 0.0 for atoms not in the
specified compute group.
The formula is defined by the "variable atom"_variable.html command.
A variable of style {atom} can access properties of the system, such
as volume or temperature, and also reference individual atom
attributes, such as its coordinates or velocity.
For example, these 3 commands would compute the xy kinectic energy of
atoms in the flow group and include the values in dumped snapshots of
the system.
variable xy atom mult(0.5,add(mult(vx\[\],vx\[\]),mult(vy\[\],vy\[\])))
compute ke flow variable/atom xy
dump 1 flow custom 1000 dump.flow tag type x y z c_ke :pre
If the dump line were replaced by
fix 1 flow ave/spatial 100 1000 z lower 2.0 ke.profile compute ke :pre
then the xy kinetic energy values would be averaged by z layer and the
layer averages written periodically to the file ke.profile.
[Restrictions:] none
[Related commands:]
"dump custom"_dump.html, "fix ave/spatial"_fix_ave_spatial.html
[Default:] none

View File

@ -53,11 +53,11 @@
mux,muy,muz = orientation of dipolar atom mux,muy,muz = orientation of dipolar atom
quatw,quati,quatj,quatk = quaternion components for aspherical particles quatw,quati,quatj,quatk = quaternion components for aspherical particles
tqx,tqy,tqz = torque on aspherical particles tqx,tqy,tqz = torque on aspherical particles
c_ID = scalar per-atom quantity calculated by a compute identified by its ID c_ID = per-atom scalar value calculated by a compute with ID
c_ID[N] = Nth per-atom vector quantity calculated by a compute identified by its ID c_ID[N] = Nth component of per-atom vector calculated by a compute with ID
f_ID = scalar per-atom quantity calculated by a fix identified by its ID f_ID = per-atom scalar value calculated by a fix with ID
f_ID[N] = Nth per-atom vector quantity calculated by a fix identified by its ID f_ID[N] = Nth component of per-atom vector calculated by a fix with ID
v_name = atom-style variable that calculates a per-atom quantity v_name = per-atom value calculated by an atom-style variable with name
</PRE> </PRE>
</UL> </UL>
@ -80,18 +80,19 @@ information for atoms in the specified group is dumped. The
included. Not all styles support all these options; see details included. Not all styles support all these options; see details
below. below.
</P> </P>
<P>Note that because periodic boundary conditions are enforced only on <P>IMPORTANT NOTE: Vecause periodic boundary conditions are enforced only
timesteps when neighbor lists are rebuilt, the coordinates of an atom on timesteps when neighbor lists are rebuilt, the coordinates of an
written to a dump file may be slightly outside the simulation box. atom written to a dump file may be slightly outside the simulation
box.
</P> </P>
<P>Also note that when LAMMPS is running in parallel, the atom <P>When LAMMPS is running in parallel, the atom information written to
information written to dump files (typically one line per atom) may be dump files (typically one line per atom) may be written in an
written in an indeterminate order. This is because data for a single indeterminate order. This is because data for a single snapshot is
snapshot is collected from multiple processors. This is always the collected from multiple processors. This is always the case for the
case for the <I>atom</I>, <I>bond</I>, and <I>custom</I> styles. It is also the case <I>atom</I>, <I>bond</I>, and <I>custom</I> styles. It is also the case for the
for the <I>xyz</I> style if the dump group is not <I>all</I>. It is not the <I>xyz</I> style if the dump group is not <I>all</I>. It is not the case for
case for the <I>dcd</I> and <I>xtc</I> styles which always write atoms in sorted the <I>dcd</I> and <I>xtc</I> styles which always write atoms in sorted order.
order. So does the <I>xyz</I> style if the dump group is <I>all</I>. So does the <I>xyz</I> style if the dump group is <I>all</I>.
</P> </P>
<HR> <HR>
@ -240,9 +241,9 @@ rotational torque on the particle.
quantities calculated by a <A HREF = "compute.html">compute</A> to be output. The quantities calculated by a <A HREF = "compute.html">compute</A> to be output. The
ID in the keyword should be replaced by the actual ID of the compute ID in the keyword should be replaced by the actual ID of the compute
that has been defined previously in the input script. See the that has been defined previously in the input script. See the
<A HREF = "compute.html">compute</A> command for details. There are computes for <A HREF = "compute.html">compute</A> command for details. There are per-atom
calculating the energy, stress, centro-symmetry parameter, and computes for calculating the energy, stress, centro-symmetry
coordination number of individual atoms. parameter, and coordination number of individual atoms.
</P> </P>
<P>Note that computes which calculate global scalar and vector <P>Note that computes which calculate global scalar and vector
quantities, as opposed to per-atom quantities, cannot be output in a quantities, as opposed to per-atom quantities, cannot be output in a
@ -251,8 +252,8 @@ custom</A> command.
</P> </P>
<P>If <I>c_ID</I> is used as a keyword, then the scalar per-atom quantity <P>If <I>c_ID</I> is used as a keyword, then the scalar per-atom quantity
calculated by the compute is printed. If <I>c_ID[N]</I> is used, then N calculated by the compute is printed. If <I>c_ID[N]</I> is used, then N
in the range from 1-M will print the Nth component of the M-length must be in the range from 1-M, which will print the Nth component of
per-atom vector calculated by the compute. the M-length per-atom vector calculated by the compute.
</P> </P>
<P>The <I>f_ID</I> and <I>f_ID[N]</I> keywords allow scalar or vector per-atom <P>The <I>f_ID</I> and <I>f_ID[N]</I> keywords allow scalar or vector per-atom
quantities calculated by a <A HREF = "fix.html">fix</A> to be output. The ID in the quantities calculated by a <A HREF = "fix.html">fix</A> to be output. The ID in the
@ -265,22 +266,22 @@ produced by any <A HREF = "compute.html">compute</A>, <A HREF = "fix.html">fix</
be written to a dump file. be written to a dump file.
</P> </P>
<P>If <I>f_ID</I> is used as a keyword, then the scalar per-atom quantity <P>If <I>f_ID</I> is used as a keyword, then the scalar per-atom quantity
calculated by the fix is printed. If <I>f_ID[N]</I> is used, then N calculated by the fix is printed. If <I>f_ID[N]</I> is used, then N must
in the range from 1-M will print the Nth component of the M-length be in the range from 1-M, which will print the Nth component of the
per-atom vector calculated by the fix. M-length per-atom vector calculated by the fix.
</P> </P>
<P>The <I>v_name</I> keyword allows per-atom quantities calculated by a <P>The <I>v_name</I> keyword allows per-atom quantities calculated by a
<A HREF = "variable.html">variable</A> to be output. The name in the keyword should <A HREF = "variable.html">variable</A> to be output. The name in the keyword should
be replaced by the actual name of the variable that has been defined be replaced by the actual name of the variable that has been defined
previously in the input script. Only an atom-style variable can be previously in the input script. Only an atom-style variable can be
referenced, since it is the only one that generates per-atom values. referenced, since it is the only style that generates per-atom values.
Variables of style <I>atom</I> can reference individual atom attributes, Variables of style <I>atom</I> can reference individual atom attributes,
per-atom atom attributes, thermodynamic keywords, or invoke other per-atom atom attributes, thermodynamic keywords, or invoke other
computes, fixes, or variables when they are evaluated, so this is a computes, fixes, or variables when they are evaluated, so this is a
very general means of generating quantities to output to a dump file. very general means of creating quantities to output to a dump file.
</P> </P>
<P>See <A HREF = "Section_modify.html">this section</A> of the manual for information <P>See <A HREF = "Section_modify.html">this section</A> of the manual for information
on how to add new compute and fix styles to LAMMPS that calculate on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files. per-atom quantities which could then be output into dump files.
</P> </P>
<HR> <HR>

View File

@ -44,11 +44,11 @@ args = list of arguments for a particular style :l
mux,muy,muz = orientation of dipolar atom mux,muy,muz = orientation of dipolar atom
quatw,quati,quatj,quatk = quaternion components for aspherical particles quatw,quati,quatj,quatk = quaternion components for aspherical particles
tqx,tqy,tqz = torque on aspherical particles tqx,tqy,tqz = torque on aspherical particles
c_ID = scalar per-atom quantity calculated by a compute identified by its ID c_ID = per-atom scalar value calculated by a compute with ID
c_ID\[N\] = Nth per-atom vector quantity calculated by a compute identified by its ID c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID
f_ID = scalar per-atom quantity calculated by a fix identified by its ID f_ID = per-atom scalar value calculated by a fix with ID
f_ID\[N\] = Nth per-atom vector quantity calculated by a fix identified by its ID f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID
v_name = atom-style variable that calculates a per-atom quantity :pre v_name = per-atom value calculated by an atom-style variable with name :pre
:ule :ule
[Examples:] [Examples:]
@ -70,18 +70,19 @@ information for atoms in the specified group is dumped. The
included. Not all styles support all these options; see details included. Not all styles support all these options; see details
below. below.
Note that because periodic boundary conditions are enforced only on IMPORTANT NOTE: Vecause periodic boundary conditions are enforced only
timesteps when neighbor lists are rebuilt, the coordinates of an atom on timesteps when neighbor lists are rebuilt, the coordinates of an
written to a dump file may be slightly outside the simulation box. atom written to a dump file may be slightly outside the simulation
box.
Also note that when LAMMPS is running in parallel, the atom When LAMMPS is running in parallel, the atom information written to
information written to dump files (typically one line per atom) may be dump files (typically one line per atom) may be written in an
written in an indeterminate order. This is because data for a single indeterminate order. This is because data for a single snapshot is
snapshot is collected from multiple processors. This is always the collected from multiple processors. This is always the case for the
case for the {atom}, {bond}, and {custom} styles. It is also the case {atom}, {bond}, and {custom} styles. It is also the case for the
for the {xyz} style if the dump group is not {all}. It is not the {xyz} style if the dump group is not {all}. It is not the case for
case for the {dcd} and {xtc} styles which always write atoms in sorted the {dcd} and {xtc} styles which always write atoms in sorted order.
order. So does the {xyz} style if the dump group is {all}. So does the {xyz} style if the dump group is {all}.
:line :line
@ -230,9 +231,9 @@ The {c_ID} and {c_ID\[N\]} keywords allow scalar or vector per-atom
quantities calculated by a "compute"_compute.html to be output. The quantities calculated by a "compute"_compute.html to be output. The
ID in the keyword should be replaced by the actual ID of the compute ID in the keyword should be replaced by the actual ID of the compute
that has been defined previously in the input script. See the that has been defined previously in the input script. See the
"compute"_compute.html command for details. There are computes for "compute"_compute.html command for details. There are per-atom
calculating the energy, stress, centro-symmetry parameter, and computes for calculating the energy, stress, centro-symmetry
coordination number of individual atoms. parameter, and coordination number of individual atoms.
Note that computes which calculate global scalar and vector Note that computes which calculate global scalar and vector
quantities, as opposed to per-atom quantities, cannot be output in a quantities, as opposed to per-atom quantities, cannot be output in a
@ -241,8 +242,8 @@ custom"_thermo_style.html command.
If {c_ID} is used as a keyword, then the scalar per-atom quantity If {c_ID} is used as a keyword, then the scalar per-atom quantity
calculated by the compute is printed. If {c_ID\[N\]} is used, then N calculated by the compute is printed. If {c_ID\[N\]} is used, then N
in the range from 1-M will print the Nth component of the M-length must be in the range from 1-M, which will print the Nth component of
per-atom vector calculated by the compute. the M-length per-atom vector calculated by the compute.
The {f_ID} and {f_ID\[N\]} keywords allow scalar or vector per-atom The {f_ID} and {f_ID\[N\]} keywords allow scalar or vector per-atom
quantities calculated by a "fix"_fix.html to be output. The ID in the quantities calculated by a "fix"_fix.html to be output. The ID in the
@ -255,22 +256,22 @@ produced by any "compute"_compute.html, "fix"_fix.html, or atom-style
be written to a dump file. be written to a dump file.
If {f_ID} is used as a keyword, then the scalar per-atom quantity If {f_ID} is used as a keyword, then the scalar per-atom quantity
calculated by the fix is printed. If {f_ID\[N\]} is used, then N calculated by the fix is printed. If {f_ID\[N\]} is used, then N must
in the range from 1-M will print the Nth component of the M-length be in the range from 1-M, which will print the Nth component of the
per-atom vector calculated by the fix. M-length per-atom vector calculated by the fix.
The {v_name} keyword allows per-atom quantities calculated by a The {v_name} keyword allows per-atom quantities calculated by a
"variable"_variable.html to be output. The name in the keyword should "variable"_variable.html to be output. The name in the keyword should
be replaced by the actual name of the variable that has been defined be replaced by the actual name of the variable that has been defined
previously in the input script. Only an atom-style variable can be previously in the input script. Only an atom-style variable can be
referenced, since it is the only one that generates per-atom values. referenced, since it is the only style that generates per-atom values.
Variables of style {atom} can reference individual atom attributes, Variables of style {atom} can reference individual atom attributes,
per-atom atom attributes, thermodynamic keywords, or invoke other per-atom atom attributes, thermodynamic keywords, or invoke other
computes, fixes, or variables when they are evaluated, so this is a computes, fixes, or variables when they are evaluated, so this is a
very general means of generating quantities to output to a dump file. very general means of creating quantities to output to a dump file.
See "this section"_Section_modify.html of the manual for information See "this section"_Section_modify.html of the manual for information
on how to add new compute and fix styles to LAMMPS that calculate on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files. per-atom quantities which could then be output into dump files.
:line :line

View File

@ -34,23 +34,26 @@ timestepping or minimization. Examples include updating of atom
positions and velocities due to time integration, controlling positions and velocities due to time integration, controlling
temperature, applying constraint forces to atoms, enforcing boundary temperature, applying constraint forces to atoms, enforcing boundary
conditions, computing diagnostics, etc. There are dozens of fixes conditions, computing diagnostics, etc. There are dozens of fixes
defined in LAMMPS and new ones can be added - see <A HREF = "Section_modify.html">this defined in LAMMPS and new ones can be added; see <A HREF = "Section_modify.html">this
section</A> for a discussion. section</A> for a discussion.
</P> </P>
<P>Each fix style has its own documentation page which describes its
arguments and what it does, as listed below.
</P>
<P>Fixes perform their operations at different stages of the timestep. <P>Fixes perform their operations at different stages of the timestep.
If 2 or more fixes both operate at the same stage of the timestep, If 2 or more fixes operate at the same stage of the timestep, they are
they are invoked in the order they were specified in the input script. invoked in the order they were specified in the input script.
</P> </P>
<P>Fixes can be deleted with the <A HREF = "unfix.html">unfix</A> command. Note that <P>The ID of a fix can only contain alphanumeric characters and
this is the only way to turn off a fix; simply specifying a new fix underscores.
with a similar style will not turn off the first one. For example, </P>
using a <A HREF = "fix_nve.html">fix nve</A> command for a second run after using a <P>Fixes can be deleted with the <A HREF = "unfix.html">unfix</A> command.
<A HREF = "fix_nvt.html">fix nvt</A> command for the first run, will not cancel out </P>
the NVT time integration invoked by the "fix nvt" command. Thus two <P>IMPORTANT NOTE: The <A HREF = "unfix.html">unfix</A> command is the only way to turn
time integrators would be in place! off a fix; simply specifying a new fix with a similar style will not
turn off the first one. This is especially important to realize for
integration fixes. For example, using a <A HREF = "fix_nve.html">fix nve</A>
command for a second run after using a <A HREF = "fix_nvt.html">fix nvt</A> command
for the first run, will not cancel out the NVT time integration
invoked by the "fix nvt" command. Thus two time integrators would be
in place!
</P> </P>
<P>If you specify a new fix with the same ID and style as an existing <P>If you specify a new fix with the same ID and style as an existing
fix, the old fix is deleted and the new one is created (presumably fix, the old fix is deleted and the new one is created (presumably
@ -64,12 +67,29 @@ made to the old fix via the <A HREF = "fix_modify.html">fix_modify</A> command.
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 <P>Some fixes calculate a global scalar or vector quantity which can be
accessed by various output commands, including accessed by various commands for output, including <A HREF = "variable.html">equal- and
<A HREF = "variable.html">variables</A>, <A HREF = "thermo_style.html">thermo_style custom</A>, atom-style variables</A>, <A HREF = "thermo_style.html">thermo_style
and <A HREF = "fix_ave_time.html">fix ave/time</A>. See this <A HREF = "Section_howto.html#4_15">howto custom</A>, and <A HREF = "fix_ave_time.html">fix ave/time</A>.
section</A> for a summary of various LAMMPS </P>
output options. See the doc pages for individual fixes for info on <P>Some fixes calculate a per-atom scalar or vector quantity which can be
which ones calculate these quantities. 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>
<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
@ -79,7 +99,9 @@ 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>
<P>Here is an alphabetic list of fix styles available in LAMMPS: <P>Each fix style has its own documentation page which describes its
arguments and what it does, as listed below. Here is an alphabetic
list of fix styles available in LAMMPS:
</P> </P>
<UL><LI><A HREF = "fix_addforce.html">addforce</A> - add a force to each atom <UL><LI><A HREF = "fix_addforce.html">addforce</A> - add a force to each atom
<LI><A HREF = "fix_aveforce.html">aveforce</A> - add an averaged force to each atom <LI><A HREF = "fix_aveforce.html">aveforce</A> - add an averaged force to each atom

View File

@ -31,23 +31,26 @@ timestepping or minimization. Examples include updating of atom
positions and velocities due to time integration, controlling positions and velocities due to time integration, controlling
temperature, applying constraint forces to atoms, enforcing boundary temperature, applying constraint forces to atoms, enforcing boundary
conditions, computing diagnostics, etc. There are dozens of fixes conditions, computing diagnostics, etc. There are dozens of fixes
defined in LAMMPS and new ones can be added - see "this defined in LAMMPS and new ones can be added; see "this
section"_Section_modify.html for a discussion. section"_Section_modify.html for a discussion.
Each fix style has its own documentation page which describes its
arguments and what it does, as listed below.
Fixes perform their operations at different stages of the timestep. Fixes perform their operations at different stages of the timestep.
If 2 or more fixes both operate at the same stage of the timestep, If 2 or more fixes operate at the same stage of the timestep, they are
they are invoked in the order they were specified in the input script. invoked in the order they were specified in the input script.
Fixes can be deleted with the "unfix"_unfix.html command. Note that The ID of a fix can only contain alphanumeric characters and
this is the only way to turn off a fix; simply specifying a new fix underscores.
with a similar style will not turn off the first one. For example,
using a "fix nve"_fix_nve.html command for a second run after using a Fixes can be deleted with the "unfix"_unfix.html command.
"fix nvt"_fix_nvt.html command for the first run, will not cancel out
the NVT time integration invoked by the "fix nvt" command. Thus two IMPORTANT NOTE: The "unfix"_unfix.html command is the only way to turn
time integrators would be in place! off a fix; simply specifying a new fix with a similar style will not
turn off the first one. This is especially important to realize for
integration fixes. For example, using a "fix nve"_fix_nve.html
command for a second run after using a "fix nvt"_fix_nvt.html command
for the first run, will not cancel out the NVT time integration
invoked by the "fix nvt" command. Thus two time integrators would be
in place!
If you specify a new fix with the same ID and style as an existing If you specify a new fix with the same ID and style as an existing
fix, the old fix is deleted and the new one is created (presumably fix, the old fix is deleted and the new one is created (presumably
@ -61,12 +64,29 @@ 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 Some fixes calculate a global scalar or vector quantity which can be
accessed by various output commands, including accessed by various commands for output, including "equal- and
"variables"_variable.html, "thermo_style custom"_thermo_style.html, atom-style variables"_variable.html, "thermo_style
and "fix ave/time"_fix_ave_time.html. See this "howto custom"_thermo_style.html, and "fix ave/time"_fix_ave_time.html.
section"_Section_howto.html#4_15 for a summary of various LAMMPS
output options. See the doc pages for individual fixes for info on Some fixes calculate a per-atom scalar or vector quantity which can be
which ones calculate these quantities. 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
@ -76,7 +96,9 @@ 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.
Here is an alphabetic list of fix styles available in LAMMPS: Each fix style has its own documentation page which describes its
arguments and what it does, as listed below. Here is an alphabetic
list of fix styles available in LAMMPS:
"addforce"_fix_addforce.html - add a force to each atom "addforce"_fix_addforce.html - add a force to each atom
"aveforce"_fix_aveforce.html - add an averaged force to each atom "aveforce"_fix_aveforce.html - add an averaged force to each atom

View File

@ -13,52 +13,106 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>fix ID group-ID ave/atom Nevery Nrepeat Nfreq compute-ID <PRE>fix ID group-ID ave/atom Nevery Nrepeat Nfreq value1 value2 ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command <UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>ave/atom = style name of this fix command
<LI>Nevery = calculate property every this many timesteps <LI>ave/atom = style name of this fix command
<LI>Nrepeat = # of times to repeat the Nevery calculation before averaging
<LI>Nfreq = timestep frequency at which the average value is calculated <LI>Nevery = calculate property every this many timesteps
<LI>compute-ID = ID of per-atom compute that performs the calculation
<LI>Nrepeat = # of times to repeat the Nevery calculation before averaging
<LI>Nfreq = timestep frequency at which the average value is calculated
<LI>one or more values can be listed
<LI>value = 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)
c_ID = per-atom scalar value calculated by a compute with ID
c_ID[N] = Nth component of per-atom vector calculated by a compute with ID
f_ID = per-atom scalar value calculated by a fix with ID
f_ID[N] = Nth component of per-atom vector calculated by a fix with ID
v_name = per-atom value calculated by an atom-style variable with name
</PRE>
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>fix 1 all ave/atom 1 100 100 myVx <PRE>fix 1 all ave/atom 1 100 100 vx vy vz
fix 1 all ave/atom 10 20 1000 my_epair fix 1 all ave/atom 10 20 1000 c_my_stress<B>1</B>
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Calculate one or more time-averaged per-atom quantities every few <P>Calculate one or more instantaneous per-atom quantities every few
timesteps. The results of this calculation can be spatially averaged timesteps, and average them over longer timescales. The resulting
via the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command or output per-atom averages can be used by other <A HREF = "Section_howto.html#4_15">output
to a file via the <A HREF = "dump.html">dump custom</A> command. commands</A> such as the <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> or <A HREF = "dump.html">dump custom</A> commands.
</P> </P>
<P>The <I>compute-ID</I> specifies a <A HREF = "compute.html">compute</A> which calculates <P>Each listed value is averaged independently. The group specified with
the desired property. It must be a per-atom compute (one with the the command means only atoms within the group have their averages
word "atom" in its style name) that calculates one or more values for computed. Atoms not in the group have their result set to 0.0.
each atom, as opposed to a global compute. The compute must be
previously defined in the input script. Users can also write code for
their own compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P> </P>
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify how the <P>Each listed value can be an atom attribute (position, velocity, force
property will be time-averaged. The final averaged value(s) are component) or can be the result of a <A HREF = "compute.html">compute</A> or
computed every <I>Nfreq</I> timesteps. The average is over <I>Nrepeat</I> <A HREF = "fix.html">fix</A> or the evaluation of an atom-style
values, computed in the preceeding portion of the simulation every <A HREF = "variable.html">variable</A>. In the latter cases, the compute, fix, or
<I>Nevery</I> timesteps. Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then variable must produce a per-atom quantity, not a global quantity. If
values on timesteps 90,92,94,96,98,100 will be used to compute the you wish to time-average global quantities from a compute, fix, or
final average at timestep 100. Similary for timesteps variable, then see the <A HREF = "fix_ave_time.html">fix ave/time</A> command.
190,192,194,196,198,200 at timestep 200, etc.
</P> </P>
<P>If this fix is referenced by a <A HREF = "dump.html">dump custom</A> or <A HREF = "fix_ave_spatial.html">fix <P><A HREF = "compute.html">Computes</A> that produce per-atom quantities are those
ave/spatial</A> command, the time-averaged values which have the word <I>atom</I> in their style name. Currently the only
can only be accessed every <I>Nfreq</I> timesteps. fix that produces per-atom quantities is this fix itself, namely fix
ave/atom. Thus this fix could be used to produce output that would be
the input for another fix ave/atom command, though that would be a
strange mode of use. <A HREF = "variable.html">Variables</A> of style <I>atom</I> are
the only ones that can be used with this fix since all other styles of
variable produce global quantities.
</P> </P>
<P>If the compute calculates a single or multiple values per atom, then <HR>
fix ave/atom will also calculate one or multiple time-averaged
quantities per atom. This makes a difference in how the quantities <P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what
are referenced in a <A HREF = "dump.html">dump custom</A> command, e.g. c_ID versus timesteps the values will be generated in order to contribute to the
c_ID[2]. average. The final averaged quantities are generated every <I>Nfreq</I>
timesteps. The average is over <I>Nrepeat</I> quantities, computed in the
preceeding portion of the simulation every <I>Nevery</I> timesteps.
<I>Nfreq</I> must be a multiple of <I>Nevery</I> and <I>Nevery</I> must be non-zero
even if <I>Nrepeat</I> is 1.
</P>
<P>For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
timesteps 90,92,94,96,98,100 will be used to compute the final average
on timestep 100. Similary for timesteps 190,192,194,196,198,200 on
timestep 200, etc.
</P>
<HR>
<P>The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
self-explanatory.
</P>
<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
appended, the per-atom scalar calculated by the compute is used. If a
bracketed term is appended, the Nth vector per-atom value 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. If no bracketed term is
appended, the per-atom scalar calculated by the fix is used. If a
bracketed term is appended, the Nth vector per-atom value calculated
by the fix is used. Note that some fixes only produce their values on
certain timesteps, which must be compatible with <I>Nevery</I>, else an
error will results. Users can also write code for their own fix
styles 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. Variables of style
<I>atom</I> can reference thermodynamic keywords, or invoke other computes,
fixes, or variables when they are evaluated, so this is a very general
means of generating per-atom quantities to time average.
</P> </P>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B> <P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P> </P>
@ -68,10 +122,12 @@ are relevant to this fix. No global scalar or vector quantities are
stored by this fix for access by various <A HREF = "Section_howto.html#4_15">output stored by this fix for access by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>.
</P> </P>
<P>This fix computes a scalar per-atom quantity or a vector of per-atom <P>This fix produces a per-atom scalar or vector which can be accessed by
quantities which can be accessed by the <A HREF = "dump.html">dump custom</A> or various <A HREF = "Section_howto.html#4_15">output commands</A>. A scalar is
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> commands, as discussed in <A HREF = "Section_howto.html#4_15">this produced if only a single quantity is averaged by this fix. If two or
section</A>. more quantities are averaged, then a vector of values is produced.
The per-atom values can only be accessed on timesteps that are
multiples of <I>Nfreq</I> since that is when averaging is performed.
</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

View File

@ -10,52 +10,98 @@ fix ave/atom command :h3
[Syntax:] [Syntax:]
fix ID group-ID ave/atom Nevery Nrepeat Nfreq compute-ID :pre fix ID group-ID ave/atom Nevery Nrepeat Nfreq value1 value2 ... :pre
ID, group-ID are documented in "fix"_fix.html command ID, group-ID are documented in "fix"_fix.html command :ulb,l
ave/atom = style name of this fix command ave/atom = style name of this fix command :l
Nevery = calculate property every this many timesteps Nevery = calculate property every this many timesteps :l
Nrepeat = # of times to repeat the Nevery calculation before averaging Nrepeat = # of times to repeat the Nevery calculation before averaging :l
Nfreq = timestep frequency at which the average value is calculated Nfreq = timestep frequency at which the average value is calculated :l
compute-ID = ID of per-atom compute that performs the calculation :ul one or more values can be listed :l
value = 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)
c_ID = per-atom scalar value calculated by a compute with ID
c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID
f_ID = per-atom scalar value calculated by a fix with ID
f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID
v_name = per-atom value calculated by an atom-style variable with name :pre
:ule
[Examples:] [Examples:]
fix 1 all ave/atom 1 100 100 myVx fix 1 all ave/atom 1 100 100 vx vy vz
fix 1 all ave/atom 10 20 1000 my_epair :pre fix 1 all ave/atom 10 20 1000 c_my_stress[1] :pre
[Description:] [Description:]
Calculate one or more time-averaged per-atom quantities every few Calculate one or more instantaneous per-atom quantities every few
timesteps. The results of this calculation can be spatially averaged timesteps, and average them over longer timescales. The resulting
via the "fix ave/spatial"_fix_ave_spatial.html command or output per-atom averages can be used by other "output
to a file via the "dump custom"_dump.html command. commands"_Section_howto.html#4_15 such as the "fix
ave/spatial"_fix_ave_spatial.html or "dump custom"_dump.html commands.
The {compute-ID} specifies a "compute"_compute.html which calculates Each listed value is averaged independently. The group specified with
the desired property. It must be a per-atom compute (one with the the command means only atoms within the group have their averages
word "atom" in its style name) that calculates one or more values for computed. Atoms not in the group have their result set to 0.0.
each atom, as opposed to a global compute. The compute must be
previously defined in the input script. Users can also write code for
their own compute styles and "add them to LAMMPS"_Section_modify.html.
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify how the Each listed value can be an atom attribute (position, velocity, force
property will be time-averaged. The final averaged value(s) are component) or can be the result of a "compute"_compute.html or
computed every {Nfreq} timesteps. The average is over {Nrepeat} "fix"_fix.html or the evaluation of an atom-style
values, computed in the preceeding portion of the simulation every "variable"_variable.html. In the latter cases, the compute, fix, or
{Nevery} timesteps. Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then variable must produce a per-atom quantity, not a global quantity. If
values on timesteps 90,92,94,96,98,100 will be used to compute the you wish to time-average global quantities from a compute, fix, or
final average at timestep 100. Similary for timesteps variable, then see the "fix ave/time"_fix_ave_time.html command.
190,192,194,196,198,200 at timestep 200, etc.
If this fix is referenced by a "dump custom"_dump.html or "fix "Computes"_compute.html that produce per-atom quantities are those
ave/spatial"_fix_ave_spatial.html command, the time-averaged values which have the word {atom} in their style name. Currently the only
can only be accessed every {Nfreq} timesteps. fix that produces per-atom quantities is this fix itself, namely fix
ave/atom. Thus this fix could be used to produce output that would be
the input for another fix ave/atom command, though that would be a
strange mode of use. "Variables"_variable.html of style {atom} are
the only ones that can be used with this fix since all other styles of
variable produce global quantities.
If the compute calculates a single or multiple values per atom, then :line
fix ave/atom will also calculate one or multiple time-averaged
quantities per atom. This makes a difference in how the quantities The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
are referenced in a "dump custom"_dump.html command, e.g. c_ID versus timesteps the values will be generated in order to contribute to the
c_ID\[2\]. average. The final averaged quantities are generated every {Nfreq}
timesteps. The average is over {Nrepeat} quantities, computed in the
preceeding portion of the simulation every {Nevery} timesteps.
{Nfreq} must be a multiple of {Nevery} and {Nevery} must be non-zero
even if {Nrepeat} is 1.
For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
timesteps 90,92,94,96,98,100 will be used to compute the final average
on timestep 100. Similary for timesteps 190,192,194,196,198,200 on
timestep 200, etc.
:line
The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
self-explanatory.
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
appended, the per-atom scalar calculated by the compute is used. If a
bracketed term is appended, the Nth vector per-atom value 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. If no bracketed term is
appended, the per-atom scalar calculated by the fix is used. If a
bracketed term is appended, the Nth vector per-atom value calculated
by the fix is used. Note that some fixes only produce their values on
certain timesteps, which must be compatible with {Nevery}, else an
error will results. Users can also 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
been previously defined in the input script. Variables of style
{atom} can reference thermodynamic keywords, or invoke other computes,
fixes, or variables when they are evaluated, so this is a very general
means of generating per-atom quantities to time average.
[Restart, fix_modify, output, run start/stop, minimize info:] [Restart, fix_modify, output, run start/stop, minimize info:]
@ -65,10 +111,12 @@ are relevant to this fix. No global scalar or vector quantities are
stored by this fix for access by various "output stored by this fix for access by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15.
This fix computes a scalar per-atom quantity or a vector of per-atom This fix produces a per-atom scalar or vector which can be accessed by
quantities which can be accessed by the "dump custom"_dump.html or various "output commands"_Section_howto.html#4_15. A scalar is
"fix ave/spatial"_fix_ave_spatial.html commands, as discussed in "this produced if only a single quantity is averaged by this fix. If two or
section"_Section_howto.html#4_15. more quantities are averaged, then a vector of values is produced.
The per-atom values can only be accessed on timesteps that are
multiples of {Nfreq} since that is when averaging is performed.
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

View File

@ -13,7 +13,7 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta style arg keyword args ... <PRE>fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta value1 value2 ... keyword args ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command <UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
@ -31,13 +31,17 @@
<LI>delta = thickness of spatial layers in dim (distance units) <LI>delta = thickness of spatial layers in dim (distance units)
<LI>style = <I>density</I> or <I>compute</I> or <I>fix</I> <LI>one or more values can be listed
<PRE> <I>density</I> arg = <I>mass</I> or <I>number</I> <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
<I>mass</I> = calculate mass density
<I>number</I> = calculate number density <PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
<I>compute</I> arg = compute-ID that stores or calculates per-atom quantities density/number, density/mass = number or mass density
<I>fix</I> arg = fix-ID that stores or calculates per-atom quantities c_ID = per-atom scalar value calculated by a compute with ID
c_ID[N] = Nth component of per-atom vector calculated by a compute with ID
f_ID = per-atom scalar value calculated by a fix with ID
f_ID[N] = Nth component of per-atom vector calculated by a fix with ID
v_name = per-atom value 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
@ -56,76 +60,66 @@
</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 compute myCentro units reduced <PRE>fix 1 all ave/spatial 10000 1 10000 z lower 0.02 myCentro units reduced
fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 compute Vx 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>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Calculate one or more instantaneous per-atom quantities every few <P>Calculate one or more instantaneous per-atom quantities every few
timesteps, average them by layer in a chosen dimension and over a timesteps, average them by layer in a chosen dimension, and average
longer timescale. The resulting averages can be used by other <A HREF = "Section_howto.html#4_15">output the layer values over a longer timescale. The resulting averages can
commands</A> such as <A HREF = "thermo_style.html">thermo_style be used by other <A HREF = "Section_howto.html#4_15">output commands</A> such as
custom</A>, and also written to a file. <A HREF = "thermo_style.html">thermo_style custom</A>, and can also be written to a
file.
</P> </P>
<P>This fix can be used to spatially average per-atom properties <P>Each listed value is averaged independently. The group specified with
(velocity, force) or per-atom quantities calculated by a the command means only atoms within the group contribute to the layer
<A HREF = "compute.html">compute</A> (energy, stress) or by another fix (see the averages.
<A HREF = "fix_ave_atom.html">fix ave/atom</A> command) or by a variable via an
equation you define (see the <A HREF = "compute_variable_atom.html">compute
variable/atom</A> command).
</P> </P>
<P>For style <I>density</I>, the number of atoms in each layer is counted, <P>Each listed value can be an atom attribute (position, velocity, force
either by mass or by number. The <I>compute</I> style allows specification component), a mass or number density, or the result of a
of a <A HREF = "compute.html">compute</A> which will be invoked to calculate the <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or the evaluation of an
desired property. The compute can be previously defined in the input atom-style <A HREF = "variable.html">variable</A>. In the latter cases, the
script or it can be a compute defined by a <A HREF = "dump.html">dump custom</A> compute, fix, or variable must produce a per-atom quantity, not a
command. global quantity. If you wish to time-average global quantities from a
compute, fix, or variable, then see the <A HREF = "fix_ave_time.html">fix
ave/time</A> command.
</P> </P>
<P>For style <I>compute</I>, the fix ave/spatial command accesses the <P><A HREF = "compute.html">Computes</A> that produce per-atom quantities are those
per-atom scalar or vector values stored by the compute. Thus it must which have the word <I>atom</I> in their style name. Currently the only
be a "per-atom" compute with the word "atom" in its style name, rather fix that produces per-atom quantities is <A HREF = "fix_ave_atom.html">fix
than a "global" compute. See the <A HREF = "fix_ave_time.html">fix ave/time</A> ave/atom</A>. <A HREF = "variable.html">Variables</A> of style
command if you wish to time-average a global quantity calculated by a <I>atom</I> are the only ones that can be used with this fix since all
compute without the word atom in its style name, e.g. a compute that other styles of variable produce global quantities.
calculates a temperature or pressure.
</P>
<P>See the <A HREF = "compute.html">compute</A> command for a list of pre-defined
per-atom computes. Two special computes of note are as follows. The
<A HREF = "compute_attribute_atom.html">compute attribute/atom</A> command selects
one or more atom attributes like vx or fz. The "compute
variable/atom" style can calculate a value for an atom that can be
specified by a <A HREF = "variable.html">variable atom</A> equation. Users can also
write code for their own per-atom compute styles and <A HREF = "Section_modify.html">add them to
LAMMPS</A>. Note that the <A HREF = "dump.html">dump custom</A>
command can also be used to directly output quantities calculated by a
per-atom compute in a per-atom fashion.
</P>
<P>For style <I>fix</I>, the fix ave/spatial command accesses the per-atom
scalar or vector values stored by another fix. The <A HREF = "fix_ave_atom.html">fix
ave/atom</A> command is an example of such a fix.
</P> </P>
<HR>
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what <P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what
timesteps the per-atom property will be evaluated in order to timesteps the layer values will be generated in order to contribute to
contribute to the average. The final averaged values are computed the average. The final averaged quantities are generated every
every <I>Nfreq</I> timesteps. The average is over <I>Nrepeat</I> values, <I>Nfreq</I> timesteps. The average is over <I>Nrepeat</I> quantities, computed
computed in the preceeding portion of the simulation every <I>Nevery</I> in the preceeding portion of the simulation every <I>Nevery</I> timesteps.
timesteps. <I>Nfreq</I> must be a multiple of <I>Nevery</I> and <I>Nevery</I> must <I>Nfreq</I> must be a multiple of <I>Nevery</I> and <I>Nevery</I> must be non-zero
be non-zero even if <I>Nrepeat</I> is 1. even if <I>Nrepeat</I> is 1.
</P> </P>
<P>For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on <P>For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
timesteps 90,92,94,96,98,100 will be used to compute the final average timesteps 90,92,94,96,98,100 will be used to compute the final average
on timestep 100. Similary for timesteps 190,192,194,196,198,200 on on timestep 100. Similary for timesteps 190,192,194,196,198,200 on
timestep 200, etc. timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time
averaging is done; values are simply generated on timesteps
100,200,etc.
</P> </P>
<P>The per-atom property is also averaged over atoms in each layer, where <HR>
the layers are in a particular <I>dim</I> and have a thickness given by
<I>delta</I>. Every Nfreq steps, when an averaging is being performed and <P>Each per-atom property is also averaged over atoms in each layer,
the per-atom property is calculated for the first time, the number of where the layers are in a particular <I>dim</I> and have a thickness given
layers and the layer boundaries are computed. Thus if the simlation by <I>delta</I>. Every Nfreq steps, when an averaging is being performed
box changes size during a simulation, the number of layers and their and the per-atom property is calculated for the first time, the number
boundaries may also change. Layers are defined relative to a of layers and the layer boundaries are computed. Thus if the
specified <I>origin</I>, which may be the lower/upper edge of the box (in simlation box changes size during a simulation, the number of layers
and their boundaries may also change. Layers are defined relative to
a specified <I>origin</I>, which may be the lower/upper edge of the box (in
<I>dim</I>) or its center point, or a specified coordinate value. Starting <I>dim</I>) or its center point, or a specified coordinate value. Starting
at the origin, sufficient layers are created in both directions to at the origin, sufficient layers are created in both directions to
completely cover the box. On subsequent timesteps every atom is completely cover the box. On subsequent timesteps every atom is
@ -146,14 +140,39 @@ position of these tilted layers in an unambiguous fashion, the <I>units</I>
option must be set to <I>reduced</I> when using a non-orthogonal simulation option must be set to <I>reduced</I> when using a non-orthogonal simulation
box, as discussed below. box, as discussed below.
</P> </P>
<P>For the <I>compute</I> and <I>fix</I> keywords, the per-atom calculation <HR>
performed by the compute or fix is on the group defined by that
command. However, only atoms in the fix group are included in the <P>The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
layer averaging. self-explanatory.
</P> </P>
<P>Note that some computes perform costly calculations, involving the <P>The <I>density/number</I> value means the number density is computed in
creation or use of neighbor lists. If the compute is invoked too each layer, i.e. a weighting of 1 for each atom. The <I>density/mass</I>
often by fix ave/spatial, it can slow down a simulation. value means the mass density is computed in each layer, i.e. each atom
is weighted by its mass. The resulting density is normalized by the
volume of the layer so that units of number/volume or mass/volume are
output.
</P>
<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
appended, the per-atom scalar calculated by the compute is used. If a
bracketed term is appended, the Nth vector per-atom value 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. If no bracketed term is
appended, the per-atom scalar calculated by the fix is used. If a
bracketed term is appended, the Nth vector per-atom value calculated
by the fix is used. Note that some fixes only produce their values on
certain timesteps, which must be compatible with <I>Nevery</I>, else an
error results. Users can also write code for their own fix styles 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. Variables of style
<I>atom</I> can reference thermodynamic keywords, or invoke other computes,
fixes, or variables when they are evaluated, so this is a very general
means of generating per-atom quantities to spatially average.
</P> </P>
<HR> <HR>
@ -182,15 +201,15 @@ the lower "b" cross "c" plane of the simulation box and an <I>origin</I> of
A <I>delta</I> value of 0.1 means there will be 10 layers from 0.0 to 1.0, A <I>delta</I> value of 0.1 means there will be 10 layers from 0.0 to 1.0,
regardless of the current size or shape of the simulation box. regardless of the current size or shape of the simulation box.
</P> </P>
<P>The <I>norm</I> keyword affects how time-averaging is done within for the <P>The <I>norm</I> keyword affects how averaging is done for the output
output produced every <I>Nfreq</I> timesteps. For an <I>all</I> setting, a produced every <I>Nfreq</I> timesteps. For an <I>all</I> setting, a layer
layer quantity is summed over all atoms in all <I>Nrepeat</I> samples, as quantity is summed over all atoms in all <I>Nrepeat</I> samples, as is the
is the count of atoms in the layer. The printed value for the layer count of atoms in the layer. The printed value for the layer is
is Total-quantity / Total-count. In other words it is an average over Total-quantity / Total-count. In other words it is an average over
the entire <I>Nfreq</I> timescale. the entire <I>Nfreq</I> timescale.
</P> </P>
<P>For a <I>sample</I> setting, the quantity is summed over atoms for only a <P>For a <I>sample</I> setting, the layer quantity is summed over atoms for
single sample, as is the count, and a "average sample value" is only a single sample, as is the count, and a "average sample value" is
computed, i.e. Sample-quantity / Sample-count. The printed value for computed, i.e. Sample-quantity / Sample-count. The printed value for
the layer is the average of the <I>Nrepeat</I> "average sample values", In the layer is the average of the <I>Nrepeat</I> "average sample values", In
other words it is an average of an average. other words it is an average of an average.
@ -200,17 +219,13 @@ timesteps, layer info will be written to a text file in the following
format. A line with the timestep and number of layers is written. format. A line with the timestep and number of layers is written.
Then one line per layer is written, containing the layer ID (1-N), the Then one line per layer is written, containing the layer ID (1-N), the
coordinate of the center of the layer, the number of atoms in the coordinate of the center of the layer, the number of atoms in the
layer, and one or more calculated values. The number of atoms and the layer, and one or more calculated values. The number of values in
value(s) are average quantities. If the value of the <I>units</I> keyword each line corresponds to the number of values specified in the fix
is <I>box</I> or <I>lattice</I>, the "coord" is printed in box units. If the ave/spatial command. The number of atoms and the value(s) are average
value of the <I>units</I> keyword is <I>reduced</I>, the "coord" is printed in quantities. If the value of the <I>units</I> keyword is <I>box</I> or
reduced units (0-1). <I>lattice</I>, the "coord" is printed in box units. If the value of the
</P> <I>units</I> keyword is <I>reduced</I>, the "coord" is printed in reduced units
<P>If the style is <I>density</I>, or the style is <I>compute</I> or <I>fix</I> with a (0-1).
compute/fix that calculates a single quantity per atom, then a single
value will be printed for each layer. If the style is <I>compute</I> or
<I>fix</I> with a compute/fix that calculates N quantities per atom, then N
values per line will be written, each of them averaged independently.
</P> </P>
<P>The <I>ave</I> keyword determines how the layer values produced every <P>The <I>ave</I> keyword determines how the layer values produced every
<I>Nfreq</I> steps are averaged with layer values produced on previous <I>Nfreq</I> steps are averaged with layer values produced on previous
@ -246,16 +261,21 @@ 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 vector of quantities which can be accessed by <P>This fix computes a global vector of quantities which can be accessed
various <A HREF = "Section_howto.html#4_15">output commands</A>. The values should by various <A HREF = "Section_howto.html#4_15">output commands</A>. The values can
only be accessed on timesteps that are multiples of <I>Nfreq</I> since that only be accessed on timesteps that are multiples of <I>Nfreq</I> since that
is when averaging is complete. The vector is of length N = is when averaging is performed. The global vector is of length N =
nlayers*nvalues where nvalues is the number of per-atom quantities nlayers*nvalues where nlayers is the number of layers and nvalues is
produced by the compute or fix that fix ave/spatial accesses. Nvalues the number of values per layer that the fix is averaging. When
= 1 if the style is <I>density</I>. If nvalues > 1 and vector value N is accessed by another output command, a single index M is specified
accessed by another output command, then the average quantity for the which is mapped into a layer I as I = M / nvalues + 1 and into value J
Ith layer and Jth value in that layer is accessed, where I = N / as J = M % nvalues + 1. If I exceeds the current number of layers
nvalues + 1 and J = N % nvalues + 1. than a 0.0 is returned by the fix instead of an error, since the
number of layers can vary as a simulation runs, depending on the
simulation box size. The vector values calculated by this fix are
"intensive", meaning they are independent of the number of atoms in
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

View File

@ -10,7 +10,7 @@ fix ave/spatial command :h3
[Syntax:] [Syntax:]
fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta style arg keyword args ... :pre fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta value1 value2 ... keyword args ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l ID, group-ID are documented in "fix"_fix.html command :ulb,l
ave/spatial = style name of this fix command :l ave/spatial = style name of this fix command :l
@ -20,12 +20,16 @@ Nfreq = timestep frequency at which the average value is computed :l
dim = {x} or {y} or {z} :l 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
style = {density} or {compute} or {fix} :l one or more values can be listed :l
{density} arg = {mass} or {number} 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
{mass} = calculate mass density x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
{number} = calculate number density density/number, density/mass = number or mass density
{compute} arg = compute-ID that stores or calculates per-atom quantities c_ID = per-atom scalar value calculated by a compute with ID
{fix} arg = fix-ID that stores or calculates per-atom quantities :pre c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID
f_ID = per-atom scalar value calculated by a fix with ID
f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID
v_name = per-atom value 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} :l
{units} arg = {box} or {lattice} or {reduced} {units} arg = {box} or {lattice} or {reduced}
@ -40,76 +44,66 @@ keyword = {norm} or {units} or {file} or {ave} :l
[Examples:] [Examples:]
fix 1 all ave/spatial 10000 1 10000 z lower 0.02 compute myCentro units reduced fix 1 all ave/spatial 10000 1 10000 z lower 0.02 myCentro units reduced
fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 compute Vx 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
[Description:] [Description:]
Calculate one or more instantaneous per-atom quantities every few Calculate one or more instantaneous per-atom quantities every few
timesteps, average them by layer in a chosen dimension and over a timesteps, average them by layer in a chosen dimension, and average
longer timescale. The resulting averages can be used by other "output the layer values over a longer timescale. The resulting averages can
commands"_Section_howto.html#4_15 such as "thermo_style be used by other "output commands"_Section_howto.html#4_15 such as
custom"_thermo_style.html, and also written to a file. "thermo_style custom"_thermo_style.html, and can also be written to a
file.
This fix can be used to spatially average per-atom properties Each listed value is averaged independently. The group specified with
(velocity, force) or per-atom quantities calculated by a the command means only atoms within the group contribute to the layer
"compute"_compute.html (energy, stress) or by another fix (see the averages.
"fix ave/atom"_fix_ave_atom.html command) or by a variable via an
equation you define (see the "compute
variable/atom"_compute_variable_atom.html command).
For style {density}, the number of atoms in each layer is counted, Each listed value can be an atom attribute (position, velocity, force
either by mass or by number. The {compute} style allows specification component), a mass or number density, or the result of a
of a "compute"_compute.html which will be invoked to calculate the "compute"_compute.html or "fix"_fix.html or the evaluation of an
desired property. The compute can be previously defined in the input atom-style "variable"_variable.html. In the latter cases, the
script or it can be a compute defined by a "dump custom"_dump.html compute, fix, or variable must produce a per-atom quantity, not a
command. global quantity. If you wish to time-average global quantities from a
compute, fix, or variable, then see the "fix
ave/time"_fix_ave_time.html command.
For style {compute}, the fix ave/spatial command accesses the "Computes"_compute.html that produce per-atom quantities are those
per-atom scalar or vector values stored by the compute. Thus it must which have the word {atom} in their style name. Currently the only
be a "per-atom" compute with the word "atom" in its style name, rather fix that produces per-atom quantities is "fix
than a "global" compute. See the "fix ave/time"_fix_ave_time.html ave/atom"_fix_ave_atom.html. "Variables"_variable.html of style
command if you wish to time-average a global quantity calculated by a {atom} are the only ones that can be used with this fix since all
compute without the word atom in its style name, e.g. a compute that other styles of variable produce global quantities.
calculates a temperature or pressure.
See the "compute"_compute.html command for a list of pre-defined :line
per-atom computes. Two special computes of note are as follows. The
"compute attribute/atom"_compute_attribute_atom.html command selects
one or more atom attributes like vx or fz. The "compute
variable/atom" style can calculate a value for an atom that can be
specified by a "variable atom"_variable.html equation. Users can also
write code for their own per-atom compute styles and "add them to
LAMMPS"_Section_modify.html. Note that the "dump custom"_dump.html
command can also be used to directly output quantities calculated by a
per-atom compute in a per-atom fashion.
For style {fix}, the fix ave/spatial command accesses the per-atom
scalar or vector values stored by another fix. The "fix
ave/atom"_fix_ave_atom.html command is an example of such a fix.
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
timesteps the per-atom property will be evaluated in order to timesteps the layer values will be generated in order to contribute to
contribute to the average. The final averaged values are computed the average. The final averaged quantities are generated every
every {Nfreq} timesteps. The average is over {Nrepeat} values, {Nfreq} timesteps. The average is over {Nrepeat} quantities, computed
computed in the preceeding portion of the simulation every {Nevery} in the preceeding portion of the simulation every {Nevery} timesteps.
timesteps. {Nfreq} must be a multiple of {Nevery} and {Nevery} must {Nfreq} must be a multiple of {Nevery} and {Nevery} must be non-zero
be non-zero even if {Nrepeat} is 1. even if {Nrepeat} is 1.
For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
timesteps 90,92,94,96,98,100 will be used to compute the final average timesteps 90,92,94,96,98,100 will be used to compute the final average
on timestep 100. Similary for timesteps 190,192,194,196,198,200 on on timestep 100. Similary for timesteps 190,192,194,196,198,200 on
timestep 200, etc. timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time
averaging is done; values are simply generated on timesteps
100,200,etc.
The per-atom property is also averaged over atoms in each layer, where :line
the layers are in a particular {dim} and have a thickness given by
{delta}. Every Nfreq steps, when an averaging is being performed and Each per-atom property is also averaged over atoms in each layer,
the per-atom property is calculated for the first time, the number of where the layers are in a particular {dim} and have a thickness given
layers and the layer boundaries are computed. Thus if the simlation by {delta}. Every Nfreq steps, when an averaging is being performed
box changes size during a simulation, the number of layers and their and the per-atom property is calculated for the first time, the number
boundaries may also change. Layers are defined relative to a of layers and the layer boundaries are computed. Thus if the
specified {origin}, which may be the lower/upper edge of the box (in simlation box changes size during a simulation, the number of layers
and their boundaries may also change. Layers are defined relative to
a specified {origin}, which may be the lower/upper edge of the box (in
{dim}) or its center point, or a specified coordinate value. Starting {dim}) or its center point, or a specified coordinate value. Starting
at the origin, sufficient layers are created in both directions to at the origin, sufficient layers are created in both directions to
completely cover the box. On subsequent timesteps every atom is completely cover the box. On subsequent timesteps every atom is
@ -130,14 +124,39 @@ position of these tilted layers in an unambiguous fashion, the {units}
option must be set to {reduced} when using a non-orthogonal simulation option must be set to {reduced} when using a non-orthogonal simulation
box, as discussed below. box, as discussed below.
For the {compute} and {fix} keywords, the per-atom calculation :line
performed by the compute or fix is on the group defined by that
command. However, only atoms in the fix group are included in the
layer averaging.
Note that some computes perform costly calculations, involving the The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
creation or use of neighbor lists. If the compute is invoked too self-explanatory.
often by fix ave/spatial, it can slow down a simulation.
The {density/number} value means the number density is computed in
each layer, i.e. a weighting of 1 for each atom. The {density/mass}
value means the mass density is computed in each layer, i.e. each atom
is weighted by its mass. The resulting density is normalized by the
volume of the layer so that units of number/volume or mass/volume are
output.
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
appended, the per-atom scalar calculated by the compute is used. If a
bracketed term is appended, the Nth vector per-atom value 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. If no bracketed term is
appended, the per-atom scalar calculated by the fix is used. If a
bracketed term is appended, the Nth vector per-atom value calculated
by the fix is used. Note that some fixes only produce their values on
certain timesteps, which must be compatible with {Nevery}, else an
error results. Users can also 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
been previously defined in the input script. Variables of style
{atom} can reference thermodynamic keywords, or invoke other computes,
fixes, or variables when they are evaluated, so this is a very general
means of generating per-atom quantities to spatially average.
:line :line
@ -166,15 +185,15 @@ the lower "b" cross "c" plane of the simulation box and an {origin} of
A {delta} value of 0.1 means there will be 10 layers from 0.0 to 1.0, A {delta} value of 0.1 means there will be 10 layers from 0.0 to 1.0,
regardless of the current size or shape of the simulation box. regardless of the current size or shape of the simulation box.
The {norm} keyword affects how time-averaging is done within for the The {norm} keyword affects how averaging is done for the output
output produced every {Nfreq} timesteps. For an {all} setting, a produced every {Nfreq} timesteps. For an {all} setting, a layer
layer quantity is summed over all atoms in all {Nrepeat} samples, as quantity is summed over all atoms in all {Nrepeat} samples, as is the
is the count of atoms in the layer. The printed value for the layer count of atoms in the layer. The printed value for the layer is
is Total-quantity / Total-count. In other words it is an average over Total-quantity / Total-count. In other words it is an average over
the entire {Nfreq} timescale. the entire {Nfreq} timescale.
For a {sample} setting, the quantity is summed over atoms for only a For a {sample} setting, the layer quantity is summed over atoms for
single sample, as is the count, and a "average sample value" is only a single sample, as is the count, and a "average sample value" is
computed, i.e. Sample-quantity / Sample-count. The printed value for computed, i.e. Sample-quantity / Sample-count. The printed value for
the layer is the average of the {Nrepeat} "average sample values", In the layer is the average of the {Nrepeat} "average sample values", In
other words it is an average of an average. other words it is an average of an average.
@ -184,17 +203,13 @@ timesteps, layer info will be written to a text file in the following
format. A line with the timestep and number of layers is written. format. A line with the timestep and number of layers is written.
Then one line per layer is written, containing the layer ID (1-N), the Then one line per layer is written, containing the layer ID (1-N), the
coordinate of the center of the layer, the number of atoms in the coordinate of the center of the layer, the number of atoms in the
layer, and one or more calculated values. The number of atoms and the layer, and one or more calculated values. The number of values in
value(s) are average quantities. If the value of the {units} keyword each line corresponds to the number of values specified in the fix
is {box} or {lattice}, the "coord" is printed in box units. If the ave/spatial command. The number of atoms and the value(s) are average
value of the {units} keyword is {reduced}, the "coord" is printed in quantities. If the value of the {units} keyword is {box} or
reduced units (0-1). {lattice}, the "coord" is printed in box units. If the value of the
{units} keyword is {reduced}, the "coord" is printed in reduced units
If the style is {density}, or the style is {compute} or {fix} with a (0-1).
compute/fix that calculates a single quantity per atom, then a single
value will be printed for each layer. If the style is {compute} or
{fix} with a compute/fix that calculates N quantities per atom, then N
values per line will be written, each of them averaged independently.
The {ave} keyword determines how the layer values produced every The {ave} keyword determines how the layer values produced every
{Nfreq} steps are averaged with layer values produced on previous {Nfreq} steps are averaged with layer values produced on previous
@ -230,16 +245,21 @@ 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 vector of quantities which can be accessed by This fix computes a global vector of quantities which can be accessed
various "output commands"_Section_howto.html#4_15. The values should by 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 complete. The vector is of length N = is when averaging is performed. The global vector is of length N =
nlayers*nvalues where nvalues is the number of per-atom quantities nlayers*nvalues where nlayers is the number of layers and nvalues is
produced by the compute or fix that fix ave/spatial accesses. Nvalues the number of values per layer that the fix is averaging. When
= 1 if the style is {density}. If nvalues > 1 and vector value N is accessed by another output command, a single index M is specified
accessed by another output command, then the average quantity for the which is mapped into a layer I as I = M / nvalues + 1 and into value J
Ith layer and Jth value in that layer is accessed, where I = N / as J = M % nvalues + 1. If I exceeds the current number of layers
nvalues + 1 and J = N % nvalues + 1. than a 0.0 is returned by the fix instead of an error, since the
number of layers can vary as a simulation runs, depending on the
simulation box size. The vector values calculated by this fix are
"intensive", meaning they are independent of the number of atoms in
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

View File

@ -13,34 +13,36 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID keyword args ... <PRE>fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command <UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>ave/time = style name of this fix command <LI>ave/time = style name of this fix command
<LI>Nevery = calculate property every this many timesteps <LI>Nevery = calculate properties every this many timesteps
<LI>Nrepeat = # of times to repeat the Nevery calculation before averaging <LI>Nrepeat = # of times to repeat the Nevery calculation before averaging
<LI>Nfreq = timestep frequency at which the average value is computed <LI>Nfreq = timestep frequency at which averages are computed
<LI>style = <I>compute</I> or <I>fix</I> <LI>one or more values can be listed
<LI>ID = ID of compute or fix that performs the calculation <LI>value = c_ID, c_ID[N], f_ID, f_ID[N], v_name
<PRE> 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
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
v_name = global value calculated by an equal-style variable with name
</PRE>
<LI>zero or more keyword/arg pairs may be appended <LI>zero or more keyword/arg pairs may be appended
<LI>keyword = <I>type</I> or <I>file</I> or <I>ave</I> <LI>keyword = <I>file</I> or <I>ave</I>
<PRE> <I>type</I> arg = <I>scalar</I> or <I>vector</I> or <I>both</I> <PRE> <I>file</I> arg = filename
scalar = single scalar value from fix or compute
vector = vector of values from fix or compute
both = both a single value and vector of values from fix or compute
<I>file</I> arg = filename
filename = name of file to output time averages to filename = name of file to output time averages to
<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 a new average value every Nfreq steps
running = output cummulative average of all previous Nfreq steps running = output cummulative 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
</PRE> </PRE>
@ -48,52 +50,50 @@
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>fix 1 all ave/time 100 5 1000 compute myTemp <PRE>fix 1 all ave/time 100 5 1000 myTemp thermo_temp file temp.profile
fix 1 all ave/time 100 5 1000 compute myTemp ave window 20 fix 1 all ave/time 100 5 1000 thermo_pressure<B>2</B> ave window 20
fix 1 all ave/time 1 100 1000 fix indenter value both file temp.indent fix 1 all ave/time 1 100 1000 f_indent f_indent<B>1</B> file temp.indent
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Calculate one or more instantaneous quantities every few timesteps, <P>Calculate one or more instantaneous global quantities every few
and average them over a longer timescale. The resulting averages can timesteps, and average them over longer timescales. The resulting
be used by other <A HREF = "Section_howto.html#4_15">output commands</A> such as averages can be used by other <A HREF = "Section_howto.html#4_15">output
<A HREF = "thermo_style.html">thermo_style custom</A>, and also written to a file. commands</A> such as <A HREF = "thermo_style.html">thermo_style
custom</A>, and can also be written to a file. If no
averaging is done, this command is a convenient way to simply write
one or more desired quantities to a separate file.
</P> </P>
<P>This fix can be used to time-average a <A HREF = "compute.html">compute</A> which <P>Each listed value is averaged independently. If written to a file,
calculates a global quantity such as a temperature or pressure or a then over time, one column of numbers is produced for each value. The
<A HREF = "fix.html">fix</A> which calculates a global quantity. Note that per-atom group specified with the command is ignored, since calculations are
quantities cannot be averaged with this fix; their values can be performed by computes and fixes which store their own "group"
averaged by the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> or <A HREF = "fix_ave_atom.html">fix definition,
ave/atom</A> commands.
</P> </P>
<P>Since the calculation is performed by the compute or fix which stores <P>Each listed value can be the result of a <A HREF = "compute.html">compute</A> or
its own "group" definition, the group specified as part of the fix <A HREF = "fix.html">fix</A> or the evaluation of an equal-style
ave/time command is ignored. <A HREF = "variable.html">variable</A>. In each case, the compute, fix, or variable
must produce a global quantity, not a per-atom quantity. If you wish
to spatial- or time-average per-atom quantities from a compute, fix,
or variable, then see the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> or
<A HREF = "fix_ave_atom.html">fix ave/atom</A> commands. If you wish to sum a
per-atom quantity into a single global quantity, see the <A HREF = "compute_sum.html">compute
sum</A> command.
</P> </P>
<P>For style <I>compute</I> the <I>ID</I> specifies a <A HREF = "compute.html">compute</A> which <P><A HREF = "compute.html">Computes</A> that produce global quantities are those which
calculates the desired property. The compute must be a "global" do not have the word <I>atom</I> in their style name. Only a few
compute that calculates one or more global properties rather than a <A HREF = "fix.html">fixes</A> produce global quantities. See the doc pages for
"per-atom" compute. However, there is a <A HREF = "compute_sum.html">compute individual fixes for info on which ones produce such values.
sum</A> command which sums per-atom quantities into a <A HREF = "variable.html">Variables</A> of style <I>equal</I> are the only ones that can
global scalar or vector which can be accessed by fix ave/time. be used with this fix. Variables of style <I>atom</I> cannot be used,
</P> since they produce per-atom values.
<P>The compute must be previously defined in the input script. Or it can
be a compute defined by <A HREF = "thermo_style.html">thermodynamic output</A> or
other fixes such as <A HREF = "fix_nvt.html">fix nvt</A> or <A HREF = "fix_temp_rescale.html">fix
temp/rescale</A>. Users can write code for their
own compute styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P>
<P>For style <I>fix</I> the <I>ID</I> specifies a <A HREF = "fix.html">fix</A> which calculates
the desired property. The fix must calculate a global scalar or
vector quantity, which only a few fixes do. See the doc page for
individual fix commands for details. The fix must be previously
defined in the input script. Users can write code for their own fix
styles and <A HREF = "Section_modify.html">add them to LAMMPS</A>.
</P> </P>
<HR>
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what <P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what
timesteps the property will be evaluated in order to contribute to the timesteps the values will be generated in order to contribute to the
average. The final averaged value(s) are computed every <I>Nfreq</I> average. The final averaged quantities are generated every <I>Nfreq</I>
timesteps. The average is over <I>Nrepeat</I> values, computed in the timesteps. The average is over <I>Nrepeat</I> quantities, computed in the
preceeding portion of the simulation every <I>Nevery</I> timesteps. preceeding portion of the simulation every <I>Nevery</I> timesteps.
<I>Nfreq</I> must be a multiple of <I>Nevery</I> and <I>Nevery</I> must be non-zero <I>Nfreq</I> must be a multiple of <I>Nevery</I> and <I>Nevery</I> must be non-zero
even if <I>Nrepeat</I> is 1. even if <I>Nrepeat</I> is 1.
@ -101,23 +101,51 @@ even if <I>Nrepeat</I> is 1.
<P>For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on <P>For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
timesteps 90,92,94,96,98,100 will be used to compute the final average timesteps 90,92,94,96,98,100 will be used to compute the final average
on timestep 100. Similary for timesteps 190,192,194,196,198,200 on on timestep 100. Similary for timesteps 190,192,194,196,198,200 on
timestep 200, etc. timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time
averaging is done; values are simply generated on timesteps
100,200,etc.
</P>
<HR>
<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
appended, the global scalar calculated by the compute is used. If a
bracketed term is appended, the Nth vector value calculated by the
compute is used. Note that there is a <A HREF = "compute_sum.html">compute sum</A>
command which sums per-atom quantities into a global scalar or vector
which can thus be accessed by fix ave/time. Or it can be a compute
defined not in your input script, but by <A HREF = "thermo_style.html">thermodynamic
output</A> or other fixes such as <A HREF = "fix_nvt.html">fix
nvt</A> or <A HREF = "fix_temp_rescale.html">fix temp/rescale</A>. See
the doc pages for these commands which give the IDs of these computes.
Users can also write code for their own compute styles and <A HREF = "Section_modify.html">add them
to LAMMPS</A>.
</P>
<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
appended, the global scalar calculated by the fix is used. If a
bracketed term is appended, the Nth vector value calculated by the fix
is used. Note that some fixes only produce their values on certain
timesteps, which must be compatible with <I>Nevery</I>, else an error will
result. Users can also write code for their own fix styles and <A HREF = "Section_modify.html">add
them to LAMMPS</A>.
</P>
<P>If a value begins with "v_", a variable name must follow which has
been previously defined in the input script. Only equal-style
variables can be referenced. See the <A HREF = "variable.html">variable</A> command
for details. Variables of style <I>equal</I> define a formula which can
reference individual atom properties or thermodynamic keywords, or
they can invoke other computes, fixes, or variables when they are
evaluated, so this is a very general means of generating quantities to
time average.
</P> </P>
<HR> <HR>
<P>Additional optional keywords also affect the operation of this fix. <P>Additional optional keywords also affect the operation of this fix.
</P> </P>
<P>The <I>type</I> keyword chooses whether the scalar and/or vector quantities <P>The <I>file</I> keyword allows a filename to be specified. Each timestamp,
produced by the compute or fix are used. For a setting of <I>scalar</I> a one quantity is written to the file for each value specified in the
single global value is used. For a setting of <I>vector</I> N global fix ave/time command. The file is in a self-explanatory text format.
values are used, where N is defined by the compute or fix, e.g. 6
pressure tensor components. For a setting of <I>both</I>, both a scalar
the vector values are used. When vectors are used, each of the N
values is averaged independently.
</P>
<P>The <I>file</I> keyword allows a filename to be specified. The scalar
and/or N vector quantities are written to the file in a
self-explanatory text format.
</P> </P>
<P>The <I>ave</I> keyword determines how the scalar and/or vector values <P>The <I>ave</I> keyword determines how the scalar and/or vector values
produced every <I>Nfreq</I> steps are averaged with values produced on produced every <I>Nfreq</I> steps are averaged with values produced on
@ -134,7 +162,7 @@ cummulative sense before being output. Each output value is thus the
average of the value produced on that timestep with all preceeding average of the value produced on that timestep with all preceeding
values. This running average begins when the fix is defined; it can values. This running average begins when the fix is defined; it can
only be restarted by deleting the fix via the <A HREF = "unfix.html">unfix</A> only be restarted by deleting the fix via the <A HREF = "unfix.html">unfix</A>
command, or re-defining the fix by re-specifying it. command, or by re-defining the fix by re-specifying it.
</P> </P>
<P>If the <I>ave</I> setting is <I>window</I>, then the values produced on <P>If the <I>ave</I> setting is <I>window</I>, then the values produced on
timesteps that are multiples of <I>Nfreq</I> are summed and averaged within timesteps that are multiples of <I>Nfreq</I> are summed and averaged within
@ -152,34 +180,35 @@ 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>Depending on the setting of the <I>type</I> parameter, this fix computes a <P>This fix produces a global scalar or vector which can be accessed by
scalar and/or a vector of quantities which can be accessed by various various <A HREF = "Section_howto.html#4_15">output commands</A>. A scalar is
<A HREF = "Section_howto.html#4_15">output commands</A>. The values should only be produced if only a single quantity is averaged by this fix. If two or
accessed on timesteps that are multiples of <I>Nfreq</I> since that is when more quantities are averaged, then a vector of values is produced.
averaging is performed. The global values can only be accessed on timesteps that are multiples
of <I>Nfreq</I> since that is when averaging is performed. Each value
(scalar or vector component) calculated by this fix may be either
"intensive" or "extensive". Intensive means the value is independent
of the number of atoms in the simulation. Extensive means the value
scales with the number of atoms in the simulation. If a compute or
fix provides the value being time averaged, then the compute or fix
determines whether the value is intensive or extensive; see the doc
page for that compute or fix for further info. Values produced by a
variable are whatever the variable calculates.
</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
minimization</A>. minimization</A>.
</P> </P>
<P><B>Restrictions:</B> <P><B>Restrictions:</B> none
</P>
<P>If the style is <I>compute</I> and the specified compute calculates
pressure, it will cause the force computations performed by LAMMPS
(pair, bond, angle, etc) to calculate virial terms each Nevery
timesteps. If this is more frequent than thermodynamic output, this
adds extra cost to a simulation. However, if a constant pressure
simulation is being run (<A HREF = "fix_npt.html">fix npt</A> or <A HREF = "fix_nph.html">fix
nph</A>), LAMMPS is already calculating virial terms for the
pressure every timestep.
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>
</P> </P>
<P><A HREF = "compute.html">compute</A>, <A HREF = "fix_ave_atom.html">fix ave/atom</A>, <A HREF = "fix_ave_spatial.html">fix <P><A HREF = "compute.html">compute</A>, <A HREF = "fix_ave_atom.html">fix ave/atom</A>,
ave/spatial</A> <A HREF = "variable.html">variable</A>, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>, <A HREF = "fix_ave_atom.html">fix
ave/atom</A>
</P> </P>
<P><B>Default:</B> none <P><B>Default:</B> none
</P> </P>
<P>The option defaults are type = scalar, no file output, and ave = one. <P>The option defaults no file output and ave = one.
</P> </P>
</HTML> </HTML>

View File

@ -10,78 +10,77 @@ fix ave/time command :h3
[Syntax:] [Syntax:]
fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID keyword args ... :pre fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l ID, group-ID are documented in "fix"_fix.html command :ulb,l
ave/time = style name of this fix command :l ave/time = style name of this fix command :l
Nevery = calculate property every this many timesteps :l Nevery = calculate properties 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 computed :l Nfreq = timestep frequency at which averages are computed :l
style = {compute} or {fix} :l one or more values can be listed :l
ID = ID of compute or fix that performs the calculation :l value = c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l
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
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
v_name = global value calculated by an equal-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 = {type} or {file} or {ave} :l keyword = {file} or {ave} :l
{type} arg = {scalar} or {vector} or {both}
scalar = single scalar value from fix or compute
vector = vector of values from fix or compute
both = both a single value and vector of values from fix or compute
{file} arg = filename {file} arg = filename
filename = name of file to output time averages to filename = name of file to output time averages to
{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 a new average value every Nfreq steps
running = output cummulative average of all previous Nfreq steps running = output cummulative 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 :pre
:ule :ule
[Examples:] [Examples:]
fix 1 all ave/time 100 5 1000 compute myTemp fix 1 all ave/time 100 5 1000 myTemp thermo_temp file temp.profile
fix 1 all ave/time 100 5 1000 compute myTemp ave window 20 fix 1 all ave/time 100 5 1000 thermo_pressure[2] ave window 20
fix 1 all ave/time 1 100 1000 fix indenter value both file temp.indent :pre fix 1 all ave/time 1 100 1000 f_indent f_indent[1] file temp.indent :pre
[Description:] [Description:]
Calculate one or more instantaneous quantities every few timesteps, Calculate one or more instantaneous global quantities every few
and average them over a longer timescale. The resulting averages can timesteps, and average them over longer timescales. The resulting
be used by other "output commands"_Section_howto.html#4_15 such as averages can be used by other "output
"thermo_style custom"_thermo_style.html, and also written to a file. commands"_Section_howto.html#4_15 such as "thermo_style
custom"_thermo_style.html, and can also be written to a file. If no
averaging is done, this command is a convenient way to simply write
one or more desired quantities to a separate file.
This fix can be used to time-average a "compute"_compute.html which Each listed value is averaged independently. If written to a file,
calculates a global quantity such as a temperature or pressure or a then over time, one column of numbers is produced for each value. The
"fix"_fix.html which calculates a global quantity. Note that per-atom group specified with the command is ignored, since calculations are
quantities cannot be averaged with this fix; their values can be performed by computes and fixes which store their own "group"
averaged by the "fix ave/spatial"_fix_ave_spatial.html or "fix definition,
ave/atom"_fix_ave_atom.html commands.
Since the calculation is performed by the compute or fix which stores Each listed value can be the result of a "compute"_compute.html or
its own "group" definition, the group specified as part of the fix "fix"_fix.html or the evaluation of an equal-style
ave/time command is ignored. "variable"_variable.html. In each case, the compute, fix, or variable
must produce a global quantity, not a per-atom quantity. If you wish
to spatial- or time-average per-atom quantities from a compute, fix,
or variable, then see the "fix ave/spatial"_fix_ave_spatial.html or
"fix ave/atom"_fix_ave_atom.html commands. If you wish to sum a
per-atom quantity into a single global quantity, see the "compute
sum"_compute_sum.html command.
For style {compute} the {ID} specifies a "compute"_compute.html which "Computes"_compute.html that produce global quantities are those which
calculates the desired property. The compute must be a "global" do not have the word {atom} in their style name. Only a few
compute that calculates one or more global properties rather than a "fixes"_fix.html produce global quantities. See the doc pages for
"per-atom" compute. However, there is a "compute individual fixes for info on which ones produce such values.
sum"_compute_sum.html command which sums per-atom quantities into a "Variables"_variable.html of style {equal} are the only ones that can
global scalar or vector which can be accessed by fix ave/time. be used with this fix. Variables of style {atom} cannot be used,
since they produce per-atom values.
The compute must be previously defined in the input script. Or it can :line
be a compute defined by "thermodynamic output"_thermo_style.html or
other fixes such as "fix nvt"_fix_nvt.html or "fix
temp/rescale"_fix_temp_rescale.html. Users can write code for their
own compute styles and "add them to LAMMPS"_Section_modify.html.
For style {fix} the {ID} specifies a "fix"_fix.html which calculates
the desired property. The fix must calculate a global scalar or
vector quantity, which only a few fixes do. See the doc page for
individual fix commands for details. The fix must be previously
defined in the input script. Users can write code for their own fix
styles and "add them to LAMMPS"_Section_modify.html.
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
timesteps the property will be evaluated in order to contribute to the timesteps the values will be generated in order to contribute to the
average. The final averaged value(s) are computed every {Nfreq} average. The final averaged quantities are generated every {Nfreq}
timesteps. The average is over {Nrepeat} values, computed in the timesteps. The average is over {Nrepeat} quantities, computed in the
preceeding portion of the simulation every {Nevery} timesteps. preceeding portion of the simulation every {Nevery} timesteps.
{Nfreq} must be a multiple of {Nevery} and {Nevery} must be non-zero {Nfreq} must be a multiple of {Nevery} and {Nevery} must be non-zero
even if {Nrepeat} is 1. even if {Nrepeat} is 1.
@ -89,23 +88,51 @@ even if {Nrepeat} is 1.
For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
timesteps 90,92,94,96,98,100 will be used to compute the final average timesteps 90,92,94,96,98,100 will be used to compute the final average
on timestep 100. Similary for timesteps 190,192,194,196,198,200 on on timestep 100. Similary for timesteps 190,192,194,196,198,200 on
timestep 200, etc. timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time
averaging is done; values are simply generated on timesteps
100,200,etc.
:line
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
appended, the global scalar calculated by the compute is used. If a
bracketed term is appended, the Nth vector value calculated by the
compute is used. Note that there is a "compute sum"_compute_sum.html
command which sums per-atom quantities into a global scalar or vector
which can thus be accessed by fix ave/time. Or it can be a compute
defined not in your input script, but by "thermodynamic
output"_thermo_style.html or other fixes such as "fix
nvt"_fix_nvt.html or "fix temp/rescale"_fix_temp_rescale.html. See
the doc pages for these commands which give the IDs of these computes.
Users can also write code for their own compute styles and "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. If no bracketed term is
appended, the global scalar calculated by the fix is used. If a
bracketed term is appended, the Nth vector value calculated by the fix
is used. Note that some fixes only produce their values on certain
timesteps, which must be compatible with {Nevery}, else an error will
result. Users can also 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
been previously defined in the input script. Only equal-style
variables can be referenced. See the "variable"_variable.html command
for details. Variables of style {equal} define a formula which can
reference individual atom properties or thermodynamic keywords, or
they can invoke other computes, fixes, or variables when they are
evaluated, so this is a very general means of generating quantities to
time average.
:line :line
Additional optional keywords also affect the operation of this fix. Additional optional keywords also affect the operation of this fix.
The {type} keyword chooses whether the scalar and/or vector quantities The {file} keyword allows a filename to be specified. Each timestamp,
produced by the compute or fix are used. For a setting of {scalar} a one quantity is written to the file for each value specified in the
single global value is used. For a setting of {vector} N global fix ave/time command. The file is in a self-explanatory text format.
values are used, where N is defined by the compute or fix, e.g. 6
pressure tensor components. For a setting of {both}, both a scalar
the vector values are used. When vectors are used, each of the N
values is averaged independently.
The {file} keyword allows a filename to be specified. The scalar
and/or N vector quantities are written to the file in a
self-explanatory text format.
The {ave} keyword determines how the scalar and/or vector values The {ave} keyword determines how the scalar and/or vector values
produced every {Nfreq} steps are averaged with values produced on produced every {Nfreq} steps are averaged with values produced on
@ -122,7 +149,7 @@ cummulative sense before being output. Each output value is thus the
average of the value produced on that timestep with all preceeding average of the value produced on that timestep with all preceeding
values. This running average begins when the fix is defined; it can values. This running average begins when the fix is defined; it can
only be restarted by deleting the fix via the "unfix"_unfix.html only be restarted by deleting the fix via the "unfix"_unfix.html
command, or re-defining the fix by re-specifying it. command, or by re-defining the fix by re-specifying it.
If the {ave} setting is {window}, then the values produced on If the {ave} setting is {window}, then the values produced on
timesteps that are multiples of {Nfreq} are summed and averaged within timesteps that are multiples of {Nfreq} are summed and averaged within
@ -140,32 +167,33 @@ 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.
Depending on the setting of the {type} parameter, this fix computes a This fix produces a global scalar or vector which can be accessed by
scalar and/or a vector of quantities which can be accessed by various various "output commands"_Section_howto.html#4_15. A scalar is
"output commands"_Section_howto.html#4_15. The values should only be produced if only a single quantity is averaged by this fix. If two or
accessed on timesteps that are multiples of {Nfreq} since that is when more quantities are averaged, then a vector of values is produced.
averaging is performed. The global values can only be accessed on timesteps that are multiples
of {Nfreq} since that is when averaging is performed. Each value
(scalar or vector component) calculated by this fix may be either
"intensive" or "extensive". Intensive means the value is independent
of the number of atoms in the simulation. Extensive means the value
scales with the number of atoms in the simulation. If a compute or
fix provides the value being time averaged, then the compute or fix
determines whether the value is intensive or extensive; see the doc
page for that compute or fix for further info. Values produced by a
variable are whatever the variable calculates.
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
minimization"_minimize.html. minimization"_minimize.html.
[Restrictions:] [Restrictions:] none
If the style is {compute} and the specified compute calculates
pressure, it will cause the force computations performed by LAMMPS
(pair, bond, angle, etc) to calculate virial terms each Nevery
timesteps. If this is more frequent than thermodynamic output, this
adds extra cost to a simulation. However, if a constant pressure
simulation is being run ("fix npt"_fix_npt.html or "fix
nph"_fix_nph.html), LAMMPS is already calculating virial terms for the
pressure every timestep.
[Related commands:] [Related commands:]
"compute"_compute.html, "fix ave/atom"_fix_ave_atom.html, "fix "compute"_compute.html, "fix ave/atom"_fix_ave_atom.html,
ave/spatial"_fix_ave_spatial.html "variable"_variable.html, "fix ave/spatial"_fix_ave_spatial.html, "fix
ave/atom"_fix_ave_atom.html
[Default:] none [Default:] none
The option defaults are type = scalar, no file output, and ave = one. The option defaults no file output and ave = one.

View File

@ -47,7 +47,9 @@ are relevant to this fix.
</P> </P>
<P>This fix computes a 3-vector of forces, which can be accessed by <P>This fix computes a 3-vector of forces, which can be accessed by
various <A HREF = "Section_howto.html#4_15">output commands</A>. This is the total various <A HREF = "Section_howto.html#4_15">output commands</A>. This is the total
force on the group of atoms by the drag force. force on the group of atoms by the drag force. The vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
</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

View File

@ -45,7 +45,9 @@ are relevant to this fix.
This fix computes a 3-vector of forces, which can be accessed by This fix computes a 3-vector of forces, which can be accessed by
various "output commands"_Section_howto.html#4_15. This is the total various "output commands"_Section_howto.html#4_15. This is the total
force on the group of atoms by the drag force. force on the group of atoms by the drag force. The vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
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

View File

@ -70,7 +70,9 @@ are relevant to this fix.
<P>The current timestep size is stored as a scalar quantity by this fix. <P>The current timestep size is stored as a scalar quantity by this fix.
The cummulative simulation time (in time units) is stored as the first The cummulative simulation time (in time units) is stored as the first
element of a vector. Both these quantities can be accessed by various element of a vector. Both these quantities can be accessed by various
<A HREF = "Section_howto.html#4_15">output commands</A>. <A HREF = "Section_howto.html#4_15">output commands</A>. The scalar and vector
values calculated by this fix are "intensive", meaning they are
independent of the number of atoms in the simulation.
</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

View File

@ -66,7 +66,9 @@ are relevant to this fix.
The current timestep size is stored as a scalar quantity by this fix. The current timestep size is stored as a scalar quantity by this fix.
The cummulative simulation time (in time units) is stored as the first The cummulative simulation time (in time units) is stored as the first
element of a vector. Both these quantities can be accessed by various element of a vector. Both these quantities can be accessed by various
"output commands"_Section_howto.html#4_15. "output commands"_Section_howto.html#4_15. The scalar and vector
values calculated by this fix are "intensive", meaning they are
independent of the number of atoms in the simulation.
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

View File

@ -107,7 +107,9 @@ with the indenter is K/3 (r - R)^3.
</P> </P>
<P>This fix computes a scalar energy and a 3-vector of forces (on the <P>This fix computes a scalar energy and a 3-vector of forces (on the
indenter), which can be accessed by various <A HREF = "Section_howto.html#4_15">output indenter), which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar and vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
</P> </P>
<P>This fix can adjust the indenter position and radius over multiple <P>This fix can adjust the indenter position and radius over multiple
runs, using the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> runs, using the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A>

View File

@ -98,7 +98,9 @@ with the indenter is K/3 (r - R)^3.
This fix computes a scalar energy and a 3-vector of forces (on the This fix computes a scalar energy and a 3-vector of forces (on the
indenter), which can be accessed by various "output indenter), which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar and vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
This fix can adjust the indenter position and radius over multiple This fix can adjust the indenter position and radius over multiple
runs, using the {start} and {stop} keywords of the "run"_run.html runs, using the {start} and {stop} keywords of the "run"_run.html

View File

@ -131,11 +131,11 @@ as if these commands had been issued:
</PRE> </PRE>
<PRE>compute fix-ID_press group-ID pressure fix-ID_temp <PRE>compute fix-ID_press group-ID pressure fix-ID_temp
</PRE> </PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> and <A HREF = "compute_pressure.html">compute <P>See the <A HREF = "compute_temp.html">compute temp</A> and <A HREF = "compute_pressure.html<A HREF = "temp"<A HREF = "press"">>>compute
pressure</A> commands for details. Note that the pressure</A> commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or IDs of the new computes are the fix-ID with </A> or </A>
"press" appended and the group for the new computes is the same as the appended and the group for the new computes is the same as the fix
fix group. group.
</P> </P>
<P>Note that these are NOT the computes used by thermodynamic output (see <P>Note that these are NOT the computes used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I> the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>
@ -171,7 +171,9 @@ output</A>.
</P> </P>
<P>The potential energy change due to this fix is stored as a scalar <P>The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
</P> </P>
<P>This fix can ramp its target pressure over multiple runs, using the <P>This fix can ramp its target pressure over multiple runs, using the
<I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command. See the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command. See the

View File

@ -123,9 +123,9 @@ compute fix-ID_press group-ID pressure fix-ID_temp :pre
See the "compute temp"_compute_temp.html and "compute See the "compute temp"_compute_temp.html and "compute
pressure"_compute_pressure.html commands for details. Note that the pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or IDs of the new computes are the fix-ID with "_temp" or "_press"
"press" appended and the group for the new computes is the same as the appended and the group for the new computes is the same as the fix
fix group. group.
Note that these are NOT the computes used by thermodynamic output (see Note that these are NOT the computes used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}
@ -161,7 +161,9 @@ output"_thermo_style.html.
The potential energy change due to this fix is stored as a scalar The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various "output quantity, which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
This fix can ramp its target pressure over multiple runs, using the This fix can ramp its target pressure over multiple runs, using the
{start} and {stop} keywords of the "run"_run.html command. See the {start} and {stop} keywords of the "run"_run.html command. See the

View File

@ -135,11 +135,11 @@ as if these commands had been issued:
<PRE>compute fix-ID_temp group-ID temp <PRE>compute fix-ID_temp group-ID temp
compute fix-ID_press group-ID pressure fix-ID_temp compute fix-ID_press group-ID pressure fix-ID_temp
</PRE> </PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> and <A HREF = "compute_pressure.html">compute <P>See the <A HREF = "compute_temp.html">compute temp</A> and <A HREF = "compute_pressure.html<A HREF = "temp"<A HREF = "press"">>>compute
pressure</A> commands for details. Note that the pressure</A> commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or IDs of the new computes are the fix-ID with </A> or </A>
"press" appended and the group for the new computes is the same as the appended and the group for the new computes is the same as the fix
fix group. group.
</P> </P>
<P>Note that these are NOT the computes used by thermodynamic output (see <P>Note that these are NOT the computes used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I> the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>
@ -175,7 +175,9 @@ barostatting to the system's potential energy as part of
</P> </P>
<P>The potential energy change due to this fix is stored as a scalar <P>The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
</P> </P>
<P>This fix can ramp its target temperature and pressure over multiple <P>This fix can ramp its target temperature and pressure over multiple
runs, using the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> runs, using the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A>

View File

@ -126,9 +126,9 @@ compute fix-ID_press group-ID pressure fix-ID_temp :pre
See the "compute temp"_compute_temp.html and "compute See the "compute temp"_compute_temp.html and "compute
pressure"_compute_pressure.html commands for details. Note that the pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or IDs of the new computes are the fix-ID with "_temp" or "_press"
"press" appended and the group for the new computes is the same as the appended and the group for the new computes is the same as the fix
fix group. group.
Note that these are NOT the computes used by thermodynamic output (see Note that these are NOT the computes used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}
@ -164,7 +164,9 @@ barostatting to the system's potential energy as part of
The potential energy change due to this fix is stored as a scalar The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various "output quantity, which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
This fix can ramp its target temperature and pressure over multiple This fix can ramp its target temperature and pressure over multiple
runs, using the {start} and {stop} keywords of the "run"_run.html runs, using the {start} and {stop} keywords of the "run"_run.html

View File

@ -134,11 +134,11 @@ this, the fix creates its own computes of style "temp/asphere" and
<PRE>compute fix-ID_temp group-ID temp/asphere <PRE>compute fix-ID_temp group-ID temp/asphere
compute fix-ID_press group-ID pressure fix-ID_temp compute fix-ID_press group-ID pressure fix-ID_temp
</PRE> </PRE>
<P>See the <A HREF = "compute_temp_asphere.html">compute temp/asphere</A> and <A HREF = "compute_pressure.html">compute <P>See the <A HREF = "compute_temp_asphere.html">compute temp/asphere</A> and <A HREF = "compute_pressure.html<A HREF = "temp"<A HREF = "press"">>>compute
pressure</A> commands for details. Note that the pressure</A> commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or IDs of the new computes are the fix-ID with </A> or </A>
"press" appended and the group for the new computes is the same as the appended and the group for the new computes is the same as the fix
fix group. group.
</P> </P>
<P>Note that these are NOT the computes used by thermodynamic output (see <P>Note that these are NOT the computes used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I> the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>

View File

@ -125,9 +125,9 @@ compute fix-ID_press group-ID pressure fix-ID_temp :pre
See the "compute temp/asphere"_compute_temp_asphere.html and "compute See the "compute temp/asphere"_compute_temp_asphere.html and "compute
pressure"_compute_pressure.html commands for details. Note that the pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or IDs of the new computes are the fix-ID with "_temp" or "_press"
"press" appended and the group for the new computes is the same as the appended and the group for the new computes is the same as the fix
fix group. group.
Note that these are NOT the computes used by thermodynamic output (see Note that these are NOT the computes used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}

View File

@ -66,10 +66,9 @@ issued:
</P> </P>
<PRE>compute fix-ID_temp group-ID temp <PRE>compute fix-ID_temp group-ID temp
</PRE> </PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> command for details. Note <P>See the <A HREF = "compute_temp.html<A HREF = "temp"">>compute temp</A> command for details. Note
that the ID of the new compute is the fix-ID with underscore + "temp" that the ID of the new compute is the fix-ID with </A> appended and
appended and the group for the new compute is the same as the fix the group for the new compute is the same as the fix group.
group.
</P> </P>
<P>Note that this is NOT the compute used by thermodynamic output (see <P>Note that this is NOT the compute used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>. the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>.
@ -101,7 +100,9 @@ output</A>.
</P> </P>
<P>The potential energy change due to this fix is stored as a scalar <P>The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
</P> </P>
<P>This fix can ramp its target temperature over multiple runs, using the <P>This fix can ramp its target temperature over multiple runs, using the
<I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command. See the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command. See the

View File

@ -58,9 +58,8 @@ issued:
compute fix-ID_temp group-ID temp :pre compute fix-ID_temp group-ID temp :pre
See the "compute temp"_compute_temp.html command for details. Note See the "compute temp"_compute_temp.html command for details. Note
that the ID of the new compute is the fix-ID with underscore + "temp" that the ID of the new compute is the fix-ID with "_temp" appended and
appended and the group for the new compute is the same as the fix the group for the new compute is the same as the fix group.
group.
Note that this is NOT the compute used by thermodynamic output (see Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.
@ -92,7 +91,9 @@ output"_thermo_style.html.
The potential energy change due to this fix is stored as a scalar The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various "output quantity, which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
This fix can ramp its target temperature over multiple runs, using the This fix can ramp its target temperature over multiple runs, using the
{start} and {stop} keywords of the "run"_run.html command. See the {start} and {stop} keywords of the "run"_run.html command. See the

View File

@ -67,10 +67,10 @@ had been issued:
</P> </P>
<PRE>compute fix-ID_temp group-ID temp/asphere <PRE>compute fix-ID_temp group-ID temp/asphere
</PRE> </PRE>
<P>See the <A HREF = "compute_temp_asphere.html">compute temp/asphere</A> command for <P>See the <A HREF = "compute_temp_asphere.html<A HREF = "temp"">>compute temp/asphere</A> command for
details. Note that the ID of the new compute is the fix-ID with details. Note that the ID of the new compute is the fix-ID with
underscore + "temp" appended and the group for the new compute is </A> appended and the group for the new compute is the same as the
the same as the fix group. fix group.
</P> </P>
<P>Note that this is NOT the compute used by thermodynamic output (see <P>Note that this is NOT the compute used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>. the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>.

View File

@ -58,10 +58,10 @@ had been issued:
compute fix-ID_temp group-ID temp/asphere :pre compute fix-ID_temp group-ID temp/asphere :pre
See the "compute temp/asphere"_compute_temp_asphere.html command for See the "compute temp/asphere"_compute_temp_asphere.html command for
details. Note that the ID of the new compute is the fix-ID with details. Note that the ID of the new compute is the fix-ID with
underscore + "temp" appended and the group for the new compute is "_temp" appended and the group for the new compute is the same as the
the same as the fix group. fix group.
Note that this is NOT the compute used by thermodynamic output (see Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.

View File

@ -93,10 +93,10 @@ been issued:
</P> </P>
<PRE>compute fix-ID_temp group-ID temp/deform <PRE>compute fix-ID_temp group-ID temp/deform
</PRE> </PRE>
<P>See the <A HREF = "compute_temp_deform.html">compute temp/deform</A> command for <P>See the <A HREF = "compute_temp_deform.html<A HREF = "temp"">>compute temp/deform</A> command for
details. Note that the ID of the new compute is the fix-ID with details. Note that the ID of the new compute is the fix-ID with
underscore + "temp" appended and the group for the new compute is the </A> appended and the group for the new compute is the same as the
same as the fix group. fix group.
</P> </P>
<P>Note that this is NOT the compute used by thermodynamic output (see <P>Note that this is NOT the compute used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>. the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>.

View File

@ -86,8 +86,8 @@ compute fix-ID_temp group-ID temp/deform :pre
See the "compute temp/deform"_compute_temp_deform.html command for See the "compute temp/deform"_compute_temp_deform.html command for
details. Note that the ID of the new compute is the fix-ID with details. Note that the ID of the new compute is the fix-ID with
underscore + "temp" appended and the group for the new compute is the "_temp" appended and the group for the new compute is the same as the
same as the fix group. fix group.
Note that this is NOT the compute used by thermodynamic output (see Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.

View File

@ -128,7 +128,9 @@ boundary driving force to the system's potential energy as part of
</P> </P>
<P>The potential energy change due to this fix is stored as a scalar <P>The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
</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

View File

@ -125,7 +125,9 @@ boundary driving force to the system's potential energy as part of
The potential energy change due to this fix is stored as a scalar The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various "output quantity, which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
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

View File

@ -44,15 +44,15 @@ be used for diagnostic purposes or as a debugging tool to monitor some
quantity during a run. The text string must be a single argument, so quantity during a run. The text string must be a single argument, so
it should be enclosed in double quotes if it is more than one word. it should be enclosed in double quotes if it is more than one word.
If it contains variables it must be enclosed in double quotes to If it contains variables it must be enclosed in double quotes to
insure they are not evaluated when the input script is read, but will insure they are not evaluated when the input script line is read, but
instead be evaluated when the string is printed. will instead be evaluated each time the string is printed.
</P> </P>
<P>See the <A HREF = "variable.html">variable</A> command for a description of <I>equal</I> <P>See the <A HREF = "variable.html">variable</A> command for a description of <I>equal</I>
style variables which are the most useful ones to use with the fix style variables which are the most useful ones to use with the fix
print command, since they are evaluated afresh each timestep that the print command, since they are evaluated afresh each timestep that the
fix print line is output. Equal-style variables can calculate fix print line is output. Equal-style variables calculate formulas
formulas involving mathematical operations, atom properties, group involving mathematical operations, atom properties, group properties,
properties, thermodyanimc properties, global values calculated by a thermodyanimc properties, global values calculated by a
<A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A>, or references to other <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A>, or references to other
<A HREF = "variable.html">variables</A>. <A HREF = "variable.html">variables</A>.
</P> </P>

View File

@ -34,15 +34,15 @@ be used for diagnostic purposes or as a debugging tool to monitor some
quantity during a run. The text string must be a single argument, so quantity during a run. The text string must be a single argument, so
it should be enclosed in double quotes if it is more than one word. it should be enclosed in double quotes if it is more than one word.
If it contains variables it must be enclosed in double quotes to If it contains variables it must be enclosed in double quotes to
insure they are not evaluated when the input script is read, but will insure they are not evaluated when the input script line is read, but
instead be evaluated when the string is printed. will instead be evaluated each time the string is printed.
See the "variable"_variable.html command for a description of {equal} See the "variable"_variable.html command for a description of {equal}
style variables which are the most useful ones to use with the fix style variables which are the most useful ones to use with the fix
print command, since they are evaluated afresh each timestep that the print command, since they are evaluated afresh each timestep that the
fix print line is output. Equal-style variables can calculate fix print line is output. Equal-style variables calculate formulas
formulas involving mathematical operations, atom properties, group involving mathematical operations, atom properties, group properties,
properties, thermodyanimc properties, global values calculated by a thermodyanimc properties, global values calculated by a
"compute"_compute.html or "fix"_fix.html, or references to other "compute"_compute.html or "fix"_fix.html, or references to other
"variables"_variable.html. "variables"_variable.html.
@ -71,4 +71,3 @@ This fix is not invoked during "energy minimization"_minimize.html.
[Default:] [Default:]
The option defaults are no file output and screen = yes. The option defaults are no file output and screen = yes.

View File

@ -44,7 +44,9 @@ are relevant to this fix.
<P>This fix computes a 3-vector of forces, which can be accessed by <P>This fix computes a 3-vector of forces, which can be accessed by
various <A HREF = "Section_howto.html#4_15">output commands</A>. This is the total various <A HREF = "Section_howto.html#4_15">output commands</A>. This is the total
force on the group of atoms before the forces on individual atoms are force on the group of atoms before the forces on individual atoms are
reset by the fix. reset by the fix. The vector values calculated by this fix are
"extensive", meaning they scale with the number of atoms in the
simulation.
</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. the <A HREF = "run.html">run</A> command.

View File

@ -41,7 +41,9 @@ are relevant to this fix.
This fix computes a 3-vector of forces, which can be accessed by This fix computes a 3-vector of forces, which can be accessed by
various "output commands"_Section_howto.html#4_15. This is the total various "output commands"_Section_howto.html#4_15. This is the total
force on the group of atoms before the forces on individual atoms are force on the group of atoms before the forces on individual atoms are
reset by the fix. reset by the fix. The vector values calculated by this fix are
"extensive", meaning they scale with the number of atoms in the
simulation.
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. the "run"_run.html command.

View File

@ -101,7 +101,9 @@ are relevant to this fix.
various <A HREF = "Section_howto.html#4_15">output commands</A>. This is the total various <A HREF = "Section_howto.html#4_15">output commands</A>. This is the total
force on the group of atoms by the spring. In the case of the force on the group of atoms by the spring. In the case of the
<I>couple</I> style, it is the force on the fix group (group-ID) or the <I>couple</I> style, it is the force on the fix group (group-ID) or the
negative of the force on the 2nd group (group-ID2). negative of the force on the 2nd group (group-ID2). The vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
</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

View File

@ -94,7 +94,9 @@ This fix computes a 3-vector of forces, which can be accessed by
various "output commands"_Section_howto.html#4_15. This is the total various "output commands"_Section_howto.html#4_15. This is the total
force on the group of atoms by the spring. In the case of the force on the group of atoms by the spring. In the case of the
{couple} style, it is the force on the fix group (group-ID) or the {couple} style, it is the force on the fix group (group-ID) or the
negative of the force on the 2nd group (group-ID2). negative of the force on the 2nd group (group-ID2). The vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
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

View File

@ -78,11 +78,10 @@ compute fix-ID_temp group-ID temp/partial xflag yflag zflag
<P>Which is used depends on whether the <I>region</I> or <I>partial</I> keywords <P>Which is used depends on whether the <I>region</I> or <I>partial</I> keywords
were specified with the fix. See the <A HREF = "compute_temp.html">compute were specified with the fix. See the <A HREF = "compute_temp.html">compute
temp</A>, <A HREF = "compute_temp_region.html">compute temp</A>, <A HREF = "compute_temp_region.html">compute
temp/region</A>, and <A HREF = "compute_temp_partial.html">compute temp/region</A>, and <A HREF = "compute_temp_partial.html<A HREF = "temp"">>compute
temp/partial</A> commands for details. Note temp/partial</A> commands for details. Note
that the ID of the new compute is the fix-ID with underscore + "temp" that the ID of the new compute is the fix-ID with </A> appended and
appended and the group for the new compute is the same as the fix the group for the new compute is the same as the fix group.
group.
</P> </P>
<P>Note that this is NOT the compute used by thermodynamic output (see <P>Note that this is NOT the compute used by thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>. the <A HREF = "thermo_style.html">thermo_style</A> command) with ID = <I>thermo_temp</I>.
@ -115,7 +114,9 @@ unless M is a multiple of N, the energy contribution will be zero.
</P> </P>
<P>The potential energy change due to this fix is stored as a scalar <P>The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output quantity, which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
</P> </P>
<P>The energy change can be printed as part of thermodynamic output via <P>The energy change can be printed as part of thermodynamic output via
the keyword f_ID, where ID is the fix-ID of this fix. See the the keyword f_ID, where ID is the fix-ID of this fix. See the

View File

@ -76,9 +76,8 @@ were specified with the fix. See the "compute
temp"_compute_temp.html, "compute temp"_compute_temp.html, "compute
temp/region"_compute_temp_region.html, and "compute temp/region"_compute_temp_region.html, and "compute
temp/partial"_compute_temp_partial.html commands for details. Note temp/partial"_compute_temp_partial.html commands for details. Note
that the ID of the new compute is the fix-ID with underscore + "temp" that the ID of the new compute is the fix-ID with "_temp" appended and
appended and the group for the new compute is the same as the fix the group for the new compute is the same as the fix group.
group.
Note that this is NOT the compute used by thermodynamic output (see Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.
@ -111,7 +110,9 @@ unless M is a multiple of N, the energy contribution will be zero.
The potential energy change due to this fix is stored as a scalar The potential energy change due to this fix is stored as a scalar
quantity, which can be accessed by various "output quantity, which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar value calculated by
this fix is "extensive", meaning it scales with the number of atoms in
the simulation.
The energy change can be printed as part of thermodynamic output via The energy change can be printed as part of thermodynamic output via
the keyword f_ID, where ID is the fix-ID of this fix. See the the keyword f_ID, where ID is the fix-ID of this fix. See the

View File

@ -91,7 +91,9 @@ quantity by this fix. This quantity is zeroed when the fix is defined
and accumlates thereafter, once every N steps. The units of the and accumlates thereafter, once every N steps. The units of the
quantity are momentum = mass*velocity. This quantity can be accessed quantity are momentum = mass*velocity. This quantity can be accessed
by various <A HREF = "Section_howto.html#4_15">output commands</A>, such as by various <A HREF = "Section_howto.html#4_15">output commands</A>, such as
<A HREF = "thermo_style.html">thermo_style custom</A>. <A HREF = "thermo_style.html">thermo_style custom</A>. The scalar value calculated
by this fix is "intensive", meaning it is independent of the number of
atoms in the simulation.
</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

View File

@ -88,7 +88,9 @@ quantity by this fix. This quantity is zeroed when the fix is defined
and accumlates thereafter, once every N steps. The units of the and accumlates thereafter, once every N steps. The units of the
quantity are momentum = mass*velocity. This quantity can be accessed quantity are momentum = mass*velocity. This quantity can be accessed
by various "output commands"_Section_howto.html#4_15, such as by various "output commands"_Section_howto.html#4_15, such as
"thermo_style custom"_thermo_style.html. "thermo_style custom"_thermo_style.html. The scalar value calculated
by this fix is "intensive", meaning it is independent of the number of
atoms in the simulation.
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

View File

@ -56,7 +56,9 @@ output</A>.
</P> </P>
<P>This fix computes a scalar energy and a 3-vector of forces (on the <P>This fix computes a scalar energy and a 3-vector of forces (on the
wall), which can be accessed by various <A HREF = "Section_howto.html#4_15">output wall), which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar and vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
</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. the <A HREF = "run.html">run</A> command.

View File

@ -53,7 +53,9 @@ output"_thermo_style.html.
This fix computes a scalar energy and a 3-vector of forces (on the This fix computes a scalar energy and a 3-vector of forces (on the
wall), which can be accessed by various "output wall), which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar and vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
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. the "run"_run.html command.

View File

@ -57,7 +57,9 @@ output</A>.
</P> </P>
<P>This fix computes a scalar energy and a 3-vector of forces (on the <P>This fix computes a scalar energy and a 3-vector of forces (on the
wall), which can be accessed by various <A HREF = "Section_howto.html#4_15">output wall), which can be accessed by various <A HREF = "Section_howto.html#4_15">output
commands</A>. commands</A>. The scalar and vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
</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. the <A HREF = "run.html">run</A> command.

View File

@ -54,7 +54,9 @@ output"_thermo_style.html.
This fix computes a scalar energy and a 3-vector of forces (on the This fix computes a scalar energy and a 3-vector of forces (on the
wall), which can be accessed by various "output wall), which can be accessed by various "output
commands"_Section_howto.html#4_15. commands"_Section_howto.html#4_15. The scalar and vector values
calculated by this fix are "extensive", meaning they scale with the
number of atoms in the simulation.
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. the "run"_run.html command.

View File

@ -15,7 +15,7 @@
</P> </P>
<PRE>print string <PRE>print string
</PRE> </PRE>
<UL><LI>string = text string to print with optional variable names <UL><LI>string = text string to print. may contain variables
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
@ -31,11 +31,12 @@ will be evaluated and their current values printed.
</P> </P>
<P>If you want the print command to be executed multiple times (with <P>If you want the print command to be executed multiple times (with
changing variable values), there are 3 options. First, consider using changing variable values), there are 3 options. First, consider using
the <A HREF = "fix_print.html">fix print</A> command, which will invoke a print the <A HREF = "fix_print.html">fix print</A> command, which will print a string
periodically during a simulation. Second, the print command can be periodically during a simulation. Second, the print command can be
used as an argument to the <I>every</I> option of the <A HREF = "run.html">run</A> used as an argument to the <I>every</I> option of the <A HREF = "run.html">run</A>
command. Third, the print command could appear in a section of the command. Third, the print command could appear in a section of the
input script that is looped over (see the <A HREF = "jump.html">jump</A> command). input script that is looped over (see the <A HREF = "jump.html">jump</A> and
<A HREF = "next.html">next</A> commands).
</P> </P>
<P>See the <A HREF = "variable.html">variable</A> command for a description of <I>equal</I> <P>See the <A HREF = "variable.html">variable</A> command for a description of <I>equal</I>
style variables which are typically the most useful ones to use with style variables which are typically the most useful ones to use with

View File

@ -12,7 +12,7 @@ print command :h3
print string :pre print string :pre
string = text string to print with optional variable names :ul string = text string to print. may contain variables :ul
[Examples:] [Examples:]
@ -28,11 +28,12 @@ will be evaluated and their current values printed.
If you want the print command to be executed multiple times (with If you want the print command to be executed multiple times (with
changing variable values), there are 3 options. First, consider using changing variable values), there are 3 options. First, consider using
the "fix print"_fix_print.html command, which will invoke a print the "fix print"_fix_print.html command, which will print a string
periodically during a simulation. Second, the print command can be periodically during a simulation. Second, the print command can be
used as an argument to the {every} option of the "run"_run.html used as an argument to the {every} option of the "run"_run.html
command. Third, the print command could appear in a section of the command. Third, the print command could appear in a section of the
input script that is looped over (see the "jump"_jump.html command). input script that is looped over (see the "jump"_jump.html and
"next"_next.html commands).
See the "variable"_variable.html command for a description of {equal} See the "variable"_variable.html command for a description of {equal}
style variables which are typically the most useful ones to use with style variables which are typically the most useful ones to use with

View File

@ -29,7 +29,7 @@
<I>pre</I> value = <I>no</I> or <I>yes</I> <I>pre</I> value = <I>no</I> or <I>yes</I>
<I>post</I> value = <I>no</I> or <I>yes</I> <I>post</I> value = <I>no</I> or <I>yes</I>
<I>every</I> values = M command <I>every</I> values = M command
M = break the run into M-timestep segments and invoke command between them M = break the run into M-timestep segments and invoke a command between them
command = a single LAMMPS command listed the same as if on a line by itself command = a single LAMMPS command listed the same as if on a line by itself
NULL means no command will be invoked NULL means no command will be invoked
</PRE> </PRE>
@ -99,18 +99,19 @@ just a continuation of a previous run (i.e. no settings are changed),
the initial computation is not necessary; the old neighbor list is the initial computation is not necessary; the old neighbor list is
still valid as are the forces. So if <I>pre</I> is specified as "no" then still valid as are the forces. So if <I>pre</I> is specified as "no" then
the initial setup is skipped, except for printing thermodynamic info. the initial setup is skipped, except for printing thermodynamic info.
Note that if <I>pre</I> is set to "no" for the very 1st run LAMMPS
performs, then it is overridden, since the initial setup computations
must be done.
</P> </P>
<P>IMPORTANT NOTE: If your input script changes settings between 2 runs <P>IMPORTANT NOTE: If your input script changes settings between 2 runs
(e.g. adds a <A HREF = "fix.html">fix</A> or <A HREF = "dump.html">dump</A> or (e.g. adds a <A HREF = "fix.html">fix</A> or <A HREF = "dump.html">dump</A> or
<A HREF = "compute.html">compute</A> or changes a <A HREF = "neigh_modify.html">neighbor</A> list <A HREF = "compute.html">compute</A> or changes a <A HREF = "neigh_modify.html">neighbor</A> list
parameter), then the initial setup must be performed. LAMMPS does not parameter), then the initial setup must be performed. LAMMPS does not
check for this, but it would be an error to use the <I>pre</I> option in check for this, but it would be an error to use the <I>pre no</I> option in
this case. this case.
</P> </P>
<P>If <I>post</I> is specified as "no", the full timing summary is skipped; <P>If <I>post</I> is specified as "no", the full timing summary is skipped;
only a one-line summary timing is printed. Note that if <I>pre</I> is set only a one-line summary timing is printed.
to "no" for the 1st run LAMMPS performs, then it is overridden, since
the initial setup computations must be done.
</P> </P>
<P>The <I>every</I> option provides a means of breaking a LAMMPS run into a <P>The <I>every</I> option provides a means of breaking a LAMMPS run into a
series of shorter runs. Optionally a single LAMMPS command can be series of shorter runs. Optionally a single LAMMPS command can be
@ -118,12 +119,13 @@ executed in between the short runs. This is a means to avoid listing
a long series of runs and commands in your input script. For example, a long series of runs and commands in your input script. For example,
a <A HREF = "print.html">print</A> command could be invoked or a <A HREF = "fix.html">fix</A> a <A HREF = "print.html">print</A> command could be invoked or a <A HREF = "fix.html">fix</A>
could be redefined, e.g. to reset a thermostat temperature. Or it could be redefined, e.g. to reset a thermostat temperature. Or it
could be useful for invoking a command you write that wraps some other could be useful for invoking a command you have added to LAMMPS that
code (e.g. as a library) to perform a computation periodically during wraps some other code (e.g. as a library) to perform a computation
a long LAMMPS run. See <A HREF = "Section_modify.html">this section</A> of the periodically during a long LAMMPS run. See <A HREF = "Section_modify.html">this
documentation for info about how to add new commands to LAMMPS. See section</A> of the documentation for info about how
<A HREF = "Section_howto.html#4_10">this section</A> of the documentation for ideas to add new commands to LAMMPS. See <A HREF = "Section_howto.html#4_10">this
about how to couple LAMMPS to other codes. section</A> of the documentation for ideas about
how to couple LAMMPS to other codes.
</P> </P>
<P>With the <I>every</I> option, N total steps are simulated, in shorter runs <P>With the <I>every</I> option, N total steps are simulated, in shorter runs
of M steps each. After each M-length run, the command is invoked. If of M steps each. After each M-length run, the command is invoked. If
@ -148,17 +150,17 @@ particular atom between runs. Note that, as in this example, the
command can contain <A HREF = "variable.html">variables</A> which will be evaluated command can contain <A HREF = "variable.html">variables</A> which will be evaluated
each time the command is invoked. each time the command is invoked.
</P> </P>
<P>IMPORTANT NOTE: For the <I>every</I> option, all remaining arguments after <P>IMPORTANT NOTE: For the <I>every</I> option, the command should be listed
the M value are considerd part of the LAMMPS command (e.g. print exactly as it would be if it appeared on a line by itself. Thus all
"Protein Rg = $r" as in the example above). This means that, if remaining arguments after the M value are considerd part of the LAMMPS
specified, the <I>every</I> option must be the last keyword used. The command (e.g. print "Protein Rg = $r" as in the example above). This
command should be listed exactly as it would appear if it were on a means that, if specified, the <I>every</I> option must be the last keyword
line by itself in the input script. used.
</P> </P>
<P>If the <I>pre</I> and <I>post</I> options are set to "no" when <I>every</I> is used, <P>If the <I>pre</I> and <I>post</I> options are set to "no" when used with the
then the 1st run will do the full setup and the last run will print <I>every</I> keyword, then the 1st run will do the full setup and the last
the full timing summary, but these operations will be skipped for run will print the full timing summary, but these operations will be
intermediate runs. skipped for intermediate runs.
</P> </P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>

View File

@ -23,7 +23,7 @@ keyword = {upto} or {start} or {stop} or {pre} or {post} or {every} :l
{pre} value = {no} or {yes} {pre} value = {no} or {yes}
{post} value = {no} or {yes} {post} value = {no} or {yes}
{every} values = M command {every} values = M command
M = break the run into M-timestep segments and invoke command between them M = break the run into M-timestep segments and invoke a command between them
command = a single LAMMPS command listed the same as if on a line by itself command = a single LAMMPS command listed the same as if on a line by itself
NULL means no command will be invoked :pre NULL means no command will be invoked :pre
:ule :ule
@ -92,18 +92,19 @@ just a continuation of a previous run (i.e. no settings are changed),
the initial computation is not necessary; the old neighbor list is the initial computation is not necessary; the old neighbor list is
still valid as are the forces. So if {pre} is specified as "no" then still valid as are the forces. So if {pre} is specified as "no" then
the initial setup is skipped, except for printing thermodynamic info. the initial setup is skipped, except for printing thermodynamic info.
Note that if {pre} is set to "no" for the very 1st run LAMMPS
performs, then it is overridden, since the initial setup computations
must be done.
IMPORTANT NOTE: If your input script changes settings between 2 runs IMPORTANT NOTE: If your input script changes settings between 2 runs
(e.g. adds a "fix"_fix.html or "dump"_dump.html or (e.g. adds a "fix"_fix.html or "dump"_dump.html or
"compute"_compute.html or changes a "neighbor"_neigh_modify.html list "compute"_compute.html or changes a "neighbor"_neigh_modify.html list
parameter), then the initial setup must be performed. LAMMPS does not parameter), then the initial setup must be performed. LAMMPS does not
check for this, but it would be an error to use the {pre} option in check for this, but it would be an error to use the {pre no} option in
this case. this case.
If {post} is specified as "no", the full timing summary is skipped; If {post} is specified as "no", the full timing summary is skipped;
only a one-line summary timing is printed. Note that if {pre} is set only a one-line summary timing is printed.
to "no" for the 1st run LAMMPS performs, then it is overridden, since
the initial setup computations must be done.
The {every} option provides a means of breaking a LAMMPS run into a The {every} option provides a means of breaking a LAMMPS run into a
series of shorter runs. Optionally a single LAMMPS command can be series of shorter runs. Optionally a single LAMMPS command can be
@ -111,12 +112,13 @@ executed in between the short runs. This is a means to avoid listing
a long series of runs and commands in your input script. For example, a long series of runs and commands in your input script. For example,
a "print"_print.html command could be invoked or a "fix"_fix.html a "print"_print.html command could be invoked or a "fix"_fix.html
could be redefined, e.g. to reset a thermostat temperature. Or it could be redefined, e.g. to reset a thermostat temperature. Or it
could be useful for invoking a command you write that wraps some other could be useful for invoking a command you have added to LAMMPS that
code (e.g. as a library) to perform a computation periodically during wraps some other code (e.g. as a library) to perform a computation
a long LAMMPS run. See "this section"_Section_modify.html of the periodically during a long LAMMPS run. See "this
documentation for info about how to add new commands to LAMMPS. See section"_Section_modify.html of the documentation for info about how
"this section"_Section_howto.html#4_10 of the documentation for ideas to add new commands to LAMMPS. See "this
about how to couple LAMMPS to other codes. section"_Section_howto.html#4_10 of the documentation for ideas about
how to couple LAMMPS to other codes.
With the {every} option, N total steps are simulated, in shorter runs With the {every} option, N total steps are simulated, in shorter runs
of M steps each. After each M-length run, the command is invoked. If of M steps each. After each M-length run, the command is invoked. If
@ -141,17 +143,17 @@ particular atom between runs. Note that, as in this example, the
command can contain "variables"_variable.html which will be evaluated command can contain "variables"_variable.html which will be evaluated
each time the command is invoked. each time the command is invoked.
IMPORTANT NOTE: For the {every} option, all remaining arguments after IMPORTANT NOTE: For the {every} option, the command should be listed
the M value are considerd part of the LAMMPS command (e.g. print exactly as it would be if it appeared on a line by itself. Thus all
"Protein Rg = $r" as in the example above). This means that, if remaining arguments after the M value are considerd part of the LAMMPS
specified, the {every} option must be the last keyword used. The command (e.g. print "Protein Rg = $r" as in the example above). This
command should be listed exactly as it would appear if it were on a means that, if specified, the {every} option must be the last keyword
line by itself in the input script. used.
If the {pre} and {post} options are set to "no" when {every} is used, If the {pre} and {post} options are set to "no" when used with the
then the 1st run will do the full setup and the last run will print {every} keyword, then the 1st run will do the full setup and the last
the full timing summary, but these operations will be skipped for run will print the full timing summary, but these operations will be
intermediate runs. skipped for intermediate runs.
[Restrictions:] none [Restrictions:] none

View File

@ -56,11 +56,11 @@
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
drot = rotational energy of dipolar atoms drot = rotational energy of dipolar atoms
grot = rotational energy of granular atoms grot = rotational energy of granular atoms
c_ID = scalar quantity calculated by a compute identified by its ID c_ID = global scalar value calculated by a compute with ID
c_ID[N] = Nth vector quantity calculated by a compute identified by its ID c_ID[N] = Nth component of global vector calculated by a compute with ID
f_ID = scalar quantity calculated by a fix identified by its ID f_ID = global scalar value calculated by a fix with ID
f_ID[N] = Nth vector quantity calculated by a fix identified by its ID f_ID[N] = Nth component of global vector calculated by a fix with ID
v_name = current value of a variable identified by the variable name v_name = global value calculated by an equal-style variable with name
</PRE> </PRE>
</UL> </UL>
@ -92,11 +92,12 @@ and prints a one-line numeric summary that is the equivalent of
which of the keywords listed above you want printed on each which of the keywords listed above you want printed on each
thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are
references to <A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, and references to <A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, and
<A HREF = "variable.html"">variables</A> that have been defined elsewhere in the equal-style <A HREF = "variable.html"">variables</A> that have been defined
input script or can even be new styles which users have added to elsewhere in the input script or can even be new styles which users
LAMMPS (see the <A HREF = "Section_modify.html">Section_modify</A> section of the have added to LAMMPS (see the <A HREF = "Section_modify.html">Section_modify</A>
documentation). Thus the <I>custom</I> style provides a flexible means of section of the documentation). Thus the <I>custom</I> style provides a
outputting essentially any desired quantity as a simulation proceeds. flexible means of outputting essentially any desired quantity as a
simulation proceeds.
</P> </P>
<P>All styles except <I>custom</I> have <I>vol</I> appended to their list of <P>All styles except <I>custom</I> have <I>vol</I> appended to their list of
outputs if the simulation box volume changes during the simulation. outputs if the simulation box volume changes during the simulation.
@ -219,27 +220,25 @@ keyword should be replaced by the actual ID of the compute that has
been defined elsewhere in the input script. See the been defined elsewhere in the input script. See the
<A HREF = "compute.html">compute</A> command for details. Note that only global <A HREF = "compute.html">compute</A> command for details. Note that only global
scalar or vector quantities calculated by a compute can be output as scalar or vector quantities calculated by a compute can be output as
thermodynamic data; per-atom quantities calcalated by a compute are thermodynamic data; per-atom quantities calcalated by a compute can be
output by the <A HREF = "dump.html">dump custom</A> command. However, there is a output by the <A HREF = "dump.html">dump custom</A> command. There is a <A HREF = "compute_sum.html">compute
<A HREF = "compute_sum.html">compute sum</A> command which sums per-atom quantities sum</A> command which sums per-atom quantities into a
into a global scalar or vector which can be output by thermo_style global scalar or vector which can be output by thermo_style custom.
custom.
</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 by thermo_style custom. Intensive quantities are printed directly as is by thermo_style
Extensive quantites may be normalized by the total number of atoms in custom. Extensive quantites may be normalized when output by the
the simulation (NOT the number of atoms in the compute group) total number of atoms in the simulation (NOT the number of atoms in
depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A> option being the compute group) depending on the <A HREF = "thermo_modify.html">thermo_modify
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>If <I>c_ID</I> is used as a keyword, then the scalar quantity calculated by
the compute is printed. If <I>c_ID[N]</I> is used, then the compute must the compute is printed. If <I>c_ID[N]</I> is used, then N must be an
calculate a vector quantity and N must be an index from 1 to M where M index from 1-M where M is the length of the vector calculated by the
is the length of the vector calculated by the compute. See the doc compute. See the doc pages for individual compute styles for info on
pages for individual compute styles for info on what these quantities what these quantities are.
are.
</P> </P>
<P>The <I>f_ID</I> and <I>f_ID[N]</I> keywords allow global scalar or vector <P>The <I>f_ID</I> and <I>f_ID[N]</I> keywords allow global scalar or vector
quantities calculated by a fix to be output. The ID in the keyword quantities calculated by a fix to be output. The ID in the keyword
@ -249,38 +248,40 @@ commands</A> for details of which fixes generate global values.
One particularly useful fix to use in this context is the <A HREF = "fix_ave_time.html">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 ave/time</A> command, which calculates time-averages of
global scalar and vector quantities calculated by other global scalar and vector quantities calculated by other
<A HREF = "compute.html">computes</A> and <A HREF = "fix.html">fixes</A>. <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 by thermo_style custom. Extensive quantities are printed directly as is by thermo_style custom.
quantites may be normalized by the total number of atoms in the Extensive quantites may be normalized when output by the total number
simulation (NOT the number of atoms in the fix group) depending on the of atoms in the simulation (NOT the number of atoms in the fix group)
<A HREF = "thermo_modify.html">thermo_modify norm</A> option being used. depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A> option being
used.
</P> </P>
<P>If <I>f_ID</I> is used as a keyword, then the scalar quantity calculated by <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 the fix must the fix is printed. If <I>f_ID[N]</I> is used, then N must be an index
calculate a vector quantity and N must be an index from 1 to M where M from 1-M where M is the length of the vector calculated by the fix.
is the length of the vector calculated by the fix. See the doc pages See the doc pages for individual fix styles for info on which fixes
for individual fix styles for info on which fixes calculate these calculate these global quantities and what they are. For fixes that
global quantities and what they are. For fixes that compute a compute a contribution to the potential energy of the system, the
contribution to the potential energy of the system, the scalar scalar quantity referenced by f_ID is typically that quantity.
quantity 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 namd 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.
See the <A HREF = "variable.html">variable</A> command for details. Equal-style Only equal-style variables can be referenced. See the
variables can calculate complex formulas involving atom and group <A HREF = "variable.html">variable</A> command for details. Variables of style
properties, mathematical operations, other variables, etc. This <I>equal</I> can reference individual atom properties or thermodynamic
keyword enables them to be evaluated and their value printed keywords, or they can invoke other computes, fixes, or variables when
periodically during a simulation. evaluated, so this is a very general means of creating thermodynamic
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 as well as variable options to LAMMPS that new compute and fix styles to LAMMPS to calculate quantities that
calculate quantities that could then be output with these keywords as could then be output with these keywords as part of thermodyanmic
part of thermodyanmic information. information.
</P> </P>
<HR> <HR>

View File

@ -51,11 +51,11 @@ args = list of arguments for a particular style :l
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
drot = rotational energy of dipolar atoms drot = rotational energy of dipolar atoms
grot = rotational energy of granular atoms grot = rotational energy of granular atoms
c_ID = scalar quantity calculated by a compute identified by its ID c_ID = global scalar value calculated by a compute with ID
c_ID\[N\] = Nth vector quantity calculated by a compute identified by its ID c_ID\[N\] = Nth component of global vector calculated by a compute with ID
f_ID = scalar quantity calculated by a fix identified by its ID f_ID = global scalar value calculated by a fix with ID
f_ID\[N\] = Nth vector quantity calculated by a fix identified by its ID f_ID\[N\] = Nth component of global vector calculated by a fix with ID
v_name = current value of a variable identified by the variable name :pre v_name = global value calculated by an equal-style variable with name :pre
:ule :ule
[Examples:] [Examples:]
@ -86,11 +86,12 @@ Style {custom} is the most general setting and allows you to specify
which of the keywords listed above you want printed on each which of the keywords listed above you want printed on each
thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are
references to "computes"_compute.html, "fixes"_fix.html, and references to "computes"_compute.html, "fixes"_fix.html, and
"variables"_variable.html" that have been defined elsewhere in the equal-style "variables"_variable.html" that have been defined
input script or can even be new styles which users have added to elsewhere in the input script or can even be new styles which users
LAMMPS (see the "Section_modify"_Section_modify.html section of the have added to LAMMPS (see the "Section_modify"_Section_modify.html
documentation). Thus the {custom} style provides a flexible means of section of the documentation). Thus the {custom} style provides a
outputting essentially any desired quantity as a simulation proceeds. flexible means of outputting essentially any desired quantity as a
simulation proceeds.
All styles except {custom} have {vol} appended to their list of All styles except {custom} have {vol} appended to their list of
outputs if the simulation box volume changes during the simulation. outputs if the simulation box volume changes during the simulation.
@ -213,27 +214,25 @@ keyword should be replaced by the actual ID of the compute that has
been defined elsewhere in the input script. See the been defined elsewhere in the input script. See the
"compute"_compute.html command for details. Note that only global "compute"_compute.html command for details. Note that only global
scalar or vector quantities calculated by a compute can be output as scalar or vector quantities calculated by a compute can be output as
thermodynamic data; per-atom quantities calcalated by a compute are thermodynamic data; per-atom quantities calcalated by a compute can be
output by the "dump custom"_dump.html command. However, there is a output by the "dump custom"_dump.html command. There is a "compute
"compute sum"_compute_sum.html command which sums per-atom quantities sum"_compute_sum.html command which sums per-atom quantities into a
into a global scalar or vector which can be output by thermo_style global scalar or vector which can be output by thermo_style custom.
custom.
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 by thermo_style custom. Intensive quantities are printed directly as is by thermo_style
Extensive quantites may be normalized by the total number of atoms in custom. Extensive quantites may be normalized when output by the
the simulation (NOT the number of atoms in the compute group) total number of atoms in the simulation (NOT the number of atoms in
depending on the "thermo_modify norm"_thermo_modify.html option being the compute group) depending on the "thermo_modify
used. norm"_thermo_modify.html option being used.
If {c_ID} is used as a keyword, then the scalar quantity calculated by If {c_ID} is used as a keyword, then the scalar quantity calculated by
the compute is printed. If {c_ID\[N\]} is used, then the compute must the compute is printed. If {c_ID\[N\]} is used, then N must be an
calculate a vector quantity and N must be an index from 1 to M where M index from 1-M where M is the length of the vector calculated by the
is the length of the vector calculated by the compute. See the doc compute. See the doc pages for individual compute styles for info on
pages for individual compute styles for info on what these quantities what these quantities are.
are.
The {f_ID} and {f_ID\[N\]} keywords allow global scalar or vector The {f_ID} and {f_ID\[N\]} keywords allow global scalar or vector
quantities calculated by a fix to be output. The ID in the keyword quantities calculated by a fix to be output. The ID in the keyword
@ -243,38 +242,40 @@ commands"_fix.html for details of which fixes generate global values.
One particularly useful fix to use in this context is 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 ave/time"_fix_ave_time.html command, which calculates time-averages of
global scalar and vector quantities calculated by other global scalar and vector quantities calculated by other
"computes"_compute.html and "fixes"_fix.html. "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 by thermo_style custom. Extensive quantities are printed directly as is by thermo_style custom.
quantites may be normalized by the total number of atoms in the Extensive quantites may be normalized when output by the total number
simulation (NOT the number of atoms in the fix group) depending on the of atoms in the simulation (NOT the number of atoms in the fix group)
"thermo_modify norm"_thermo_modify.html option being used. depending on the "thermo_modify norm"_thermo_modify.html option being
used.
If {f_ID} is used as a keyword, then the scalar quantity calculated by 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 the fix must the fix is printed. If {f_ID\[N\]} is used, then N must be an index
calculate a vector quantity and N must be an index from 1 to M where M from 1-M where M is the length of the vector calculated by the fix.
is the length of the vector calculated by the fix. See the doc pages See the doc pages for individual fix styles for info on which fixes
for individual fix styles for info on which fixes calculate these calculate these global quantities and what they are. For fixes that
global quantities and what they are. For fixes that compute a compute a contribution to the potential energy of the system, the
contribution to the potential energy of the system, the scalar scalar quantity referenced by f_ID is typically that quantity.
quantity 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 namd 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.
See the "variable"_variable.html command for details. Equal-style Only equal-style variables can be referenced. See the
variables can calculate complex formulas involving atom and group "variable"_variable.html command for details. Variables of style
properties, mathematical operations, other variables, etc. This {equal} can reference individual atom properties or thermodynamic
keyword enables them to be evaluated and their value printed keywords, or they can invoke other computes, fixes, or variables when
periodically during a simulation. evaluated, so this is a very general means of creating thermodynamic
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 as well as variable options to LAMMPS that new compute and fix styles to LAMMPS to calculate quantities that
calculate quantities that could then be output with these keywords as could then be output with these keywords as part of thermodyanmic
part of thermodyanmic information. information.
:line :line

View File

@ -24,22 +24,19 @@
<I>world</I> args = one string for each partition of processors <I>world</I> args = one string for each partition of processors
<I>universe</I> args = one or more strings <I>universe</I> args = one or more strings
<I>uloop</I> args = N = integer size of loop <I>uloop</I> args = N = integer size of loop
<I>equal</I> or <I>atom</I> args = one equation containing numbers, thermo keywords, math functions, group functions, atom vectors, compute references, other variables <I>equal</I> or <I>atom</I> args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute and fix references, other variables
numbers = 0.0, -5.4, 2.8e-4, etc numbers = 0.0, -5.4, 2.8e-4, etc
thermo keywords = vol, ke, press, etc from <A HREF = "thermo_style.html">thermo_style</A> thermo keywords = vol, ke, press, etc from <A HREF = "thermo_style.html">thermo_style</A>
math functions = add(x,y), sub(x,y), mult(x,y), div(x,y), math operations = (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x)
neg(x), pow(x,y), exp(x), ln(x), sqrt(x) group functions = count(group), mass(group), charge(group),
group functions = mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim), xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group) bound(group,xmin), gyration(group)
atom vectors for <I>equal</I> = mass[N], x[N], y[N], z[N], atom value = mass[N], x[N], y[N], z[N],
vx[N], vy[N], vz[N], vx[N], vy[N], vz[N], fx[N], fy[N], fz[N]
fx[N], fy[N], fz[N] atom vector = mass[], x[], y[], z[],
atom vectors for <I>atom</I> = mass[], x[], y[], z[], vx[], vy[], vz[], fx[], fy[], fz[]
vx[], vy[], vz[], compute references = c_ID, c_ID[N]
fx[], fy[], fz[] fix references = f_ID, f_ID[N]
compute references = c_ID[0], c_ID[N]
fix references = f_ID[0], f_ID[N]
other variables = v_abc, v_x, etc other variables = v_abc, v_x, etc
</PRE> </PRE>
@ -48,37 +45,43 @@
</P> </P>
<PRE>variable x index run1 run2 run3 run4 run5 run6 run7 run8 <PRE>variable x index run1 run2 run3 run4 run5 run6 run7 run8
variable LoopVar loop $n variable LoopVar loop $n
variable beta equal div(temp,3.0) variable beta equal temp/3.0
variable b1 equal add(x[234],mult(0.5,vol)) variable b1 equal "x[234] + 0.5*vol"
variable b equal div(xcm(mol1,x),2.0) variable b equal xcm(mol1,x)/2.0
variable b equal c_myTemp[0] variable b equal c_myTemp
variable b atom div(mult(x<B></B>,y<B></B>),vol) variable b atom x<B></B>*y<B></B>/vol
variable temp world 300.0 310.0 320.0 $<I>Tfinal</I> variable temp world 300.0 310.0 320.0 $<I>Tfinal</I>
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
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>This command assigns one or more strings to a variable name. <P>This command assigns one or more strings to a variable name for
Variables can be used in several ways in LAMMPS. A variable can be evaluation later in the input script or during a simulation.
referenced elsewhere in an input script. For variable styles that </P>
store multiple strings, the <A HREF = "next.html">next</A> command can be used to <P>Variables can be used in several ways in LAMMPS. A variable can be
increment which string is assigned to the variable. Variables can be referenced elsewhere in an input script to become part of a new input
evaluated to produce a numeric value which can be output either command. For variable styles that store multiple strings, the
directly (see the <A HREF = "print.html">print</A>, <A HREF = "fix_print.html">fix print</A>, and <A HREF = "next.html">next</A> command can be used to increment which string is
<A HREF = "run.html">run every</A> commands) or as part of thermodynamic output (see assigned to the variable. Variables of style <I>equal</I> can be evaluated
the <A HREF = "thermo_style.html">thermo_style</A> command), fix output (see the to produce a single numeric value which can be output either directly
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> and <A HREF = "compute_variable_atom.html">compute (see the <A HREF = "print.html">print</A>, <A HREF = "fix_print.html">fix print</A>, and <A HREF = "run.html">run
variable/atom</A> commands), or dump output every</A> commands) or as part of thermodynamic output (see the
(see the <A HREF = "dump.html">dump custom</A> and <A HREF = "compute_variable_atom.html">compute <A HREF = "thermo_style.html">thermo_style</A> command), or used as input to an
variable/atom</A> commands). averaging fix (see the <A HREF = "fix_ave/time">fix ave/time</A> command).
Variables of style <I>atom</I> can be evaluated to produce one numeric
value per atom which can be output to a dump file (see the <A HREF = "dump.html">dump
custom</A> command) or used as input to an averaging fix (see
the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> and <A HREF = "fix_ave_atom.html">fix
ave/atom</A> commands).
</P> </P>
<P>In the discussion that follows, the "name" of the variable is the <P>In the discussion that follows, the "name" of the variable is the
arbitrary string that is the 1st argument in the variable command. arbitrary string that is the 1st argument in the variable command.
This name can only contain alphanumeric characters and underscores.
The "string" is one or more of the subsequent arguments. The "string" The "string" is one or more of the subsequent arguments. The "string"
can be simple text as in the 1st example above, it can contain other can be simple text as in the 1st example above, it can contain other
variables as in the 2nd example, or it can be an equation as in the variables as in the 2nd example, or it can be a formula as in the 3rd
3rd example. The "value" is the numeric quantity resulting from example. The "value" is the numeric quantity resulting from
evaluation of the string. Note that the same string can generate evaluation of the string. Note that the same string can generate
different values when it is evaluated at different times during a different values when it is evaluated at different times during a
simulation. simulation.
@ -89,14 +92,16 @@ is ignored. This means variables can NOT be re-defined in an input
script (with 2 exceptions, read further). This is to allow an input script (with 2 exceptions, read further). This is to allow an input
script to be processed multiple times without resetting the variables; script to be processed multiple times without resetting the variables;
see the <A HREF = "jump.html">jump</A> or <A HREF = "include.html">include</A> commands. It also see the <A HREF = "jump.html">jump</A> or <A HREF = "include.html">include</A> commands. It also
means that using a command-line switch -var will override a means that using the <A HREF = "Section_start.html#2_6">command-line switch</A> -var
corresponding variable setting in the input script. will override a corresponding variable setting in the input script.
</P> </P>
<P>There are two exceptions to this rule. First, variables of style <P>There are two exceptions to this rule. First, variables of style
<I>equal</I> ARE redefined each time the command is encountered. This <I>equal</I> and <I>atom</I> ARE redefined each time the command is encountered.
allow them to be reset, e.g. in a loop. This means an <I>equal</I>-style This allows them to be reset, when their formulas contain a
variable will re-define a command-line swich -var setting, so use an substitution for another variable, e.g. $x. This can be useful in a
<I>index</I>-style variable for these settings instead, as in bench/in.lj. loop. This also means an <I>equal</I>-style variable will re-define a
command-line switch -var setting, so an <I>index</I>-style variable should
be used for such settings instead, as in bench/in.lj.
</P> </P>
<P>Second, as described below, if a variable is iterated on to the end of <P>Second, as described below, if a variable is iterated on to the end of
its list of strings via the <A HREF = "next.html">next</A> command, it is removed its list of strings via the <A HREF = "next.html">next</A> command, it is removed
@ -114,10 +119,10 @@ the name "x" is a single character, or as ${LoopVar} if the name
<P>As described below, for variable styles <I>index</I>, <I>loop</I>, <I>universe</I>, <P>As described below, for variable styles <I>index</I>, <I>loop</I>, <I>universe</I>,
and <I>uloop</I>, which string is assigned to a variable can be incremented and <I>uloop</I>, which string is assigned to a variable can be incremented
via the <A HREF = "next.html">next</A> command. When there are no more strings to via the <A HREF = "next.html">next</A> command. When there are no more strings to
assign, the variable is "exhausted" and a flag is set that causes the assign, the variable is exhausted and a flag is set that causes the
next <A HREF = "jump.html">jump</A> command encountered in the input script to be next <A HREF = "jump.html">jump</A> command encountered in the input script to be
skipped. This enables the construction of simple loops in the input skipped. This enables the construction of simple loops in the input
script that are iterated over and exited from. script that are iterated over and then exited from.
</P> </P>
<HR> <HR>
@ -175,12 +180,13 @@ script.
<HR> <HR>
<P>For the <I>equal</I> and <I>atom</I> styles, a single string is specified which <P>For the <I>equal</I> and <I>atom</I> styles, a single string is specified which
represents an equation that will be evaluated afresh each time the represents a formula that will be evaluated afresh each time the
variable is used. For <I>equal</I> style variables this equation computes variable is used. If you want spaces in the string, enclose it in
a scalar quantity, which becomes the value of the variable whenever it double quotes so the parser will treat it as a single argument. For
is evaluated. For <I>atom</I> style variables it computes a quantity for <I>equal</I> style variables the formula computes a scalar quantity, which
each atom, which is used by the "compute variable/atom" command and becomes the value of the variable whenever it is evaluated. For
its associated output. <I>atom</I> style variables the formula computes one quantity for each
atom whenever it is evaluated.
</P> </P>
<P>Note that <I>equal</I> and <I>atom</I> variables can produce different values at <P>Note that <I>equal</I> and <I>atom</I> variables can produce different values at
different stages of the input script or at different times during a different stages of the input script or at different times during a
@ -191,121 +197,159 @@ timestep it was invoked.
<P>The next command cannot be used with <I>equal</I> or <I>atom</I> style <P>The next command cannot be used with <I>equal</I> or <I>atom</I> style
variables, since there is only one string. variables, since there is only one string.
</P> </P>
<P>The equation for an <I>equal</I> or <I>atom</I> variable can contain a variety <P>The formula for an <I>equal</I> or <I>atom</I> variable can contain a variety
of quantities. The syntax for each kind of quantity is simple, but of quantities. The syntax for each kind of quantity is simple, but
multiple quantities can be nested and combined in various ways to multiple quantities can be nested and combined in various ways to
build up formulas of arbitrary complexity. For example, this is a build up formulas of arbitrary complexity. For example, this is a
valid (though strange) variable equation: valid (though strange) variable formula:
</P> </P>
<PRE>variable x equal div(add(pe,c_MyTemp[0]),pow(vol,div(1,3))) <PRE>variable x equal "pe + c_MyTemp / vol^(1/3)"
</PRE> </PRE>
<P>Specifically, an equation can contain numbers, thermo keywords, math <P>Specifically, an formula can contain numbers, thermo keywords, math
functions, group functions, atom vectors, compute references, and operations, group functions, atom values, atom vectors, compute
other variables. There is one difference between <I>equal</I> and <I>atom</I> references, fix references, and references to other variables.
variables; the syntax of Atom vector references is different.
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >Number</TD><TD > 0.2, 1.0e20, -15.4, etc</TD></TR> <TR><TD >Number</TD><TD > 0.2, 1.0e20, -15.4, etc</TD></TR>
<TR><TD >Thermo keywords</TD><TD > vol, pe, ebond, etc</TD></TR> <TR><TD >Thermo keywords</TD><TD > vol, pe, ebond, etc</TD></TR>
<TR><TD >Math functions</TD><TD > add(x,y), sub(x,y), mult(x,y), div(x,y), neg(x), pow(x,y), exp(x), ln(x), sqrt(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)</TD></TR>
<TR><TD >Group functions</TD><TD > mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim) bound(ID,dir), gyration(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)</TD></TR>
<TR><TD >Atom vectors for <I>equal</I></TD><TD > mass[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[N], x[N], y[N], z[N], vx[N], vy[N], vz[N], fx[N], fy[N], fz[N]</TD></TR>
<TR><TD >Atom vectors for <I>atom</I></TD><TD > mass[], x[], y[], z[], vx[], vy[], vz[], fx[], fy[], fz[]</TD></TR> <TR><TD >Atom vectors</TD><TD > mass[], x[], y[], z[], vx[], vy[], vz[], fx[], fy[], fz[]</TD></TR>
<TR><TD >Compute references</TD><TD > c_ID[0], c_ID[N]</TD></TR> <TR><TD >Compute references</TD><TD > c_ID, c_ID[N]</TD></TR>
<TR><TD >Fix references</TD><TD > f_ID[0], f_ID[N]</TD></TR> <TR><TD >Fix references</TD><TD > f_ID, f_ID[N]</TD></TR>
<TR><TD >Other variables</TD><TD > v_abc, v_x, etc <TR><TD >Other variables</TD><TD > v_abc, v_x, etc
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<P>The thermo keywords allowed in the equation are those defined by the <P>Note that the formula for equal-style variables cannot use any formula
"thermo_style custom" command. Note that many thermodyanmic element that produces per-atom values, namely atom vectors, a compute
quantities are only computable after the first simulation has begun. that produces per-atom values, a fix that produces per-atoms values,
Likewise, many thermodynamic quantities (such as energies) are only or an atom-style variable. The formula for atom-style variables can
computed on timesteps when thermodyanmic output is being performed. use these quantities, as well as quantities that produce a global
If the variable equation these quantities at other times, out-of-date scalar or vector, e.g. a compute or fix that produces global
or invalid values may be used. quantities.
</P> </P>
<P>Math functions take one or two arguments, each of which may be an <P>The thermo keywords allowed in a formula are those defined by the
equation containing any of the quantities defined above. This allows "thermo_style custom" command. Since many thermodyanmic quantities
equations to be nested, as in the examples above. are only computable after the a simulation has begun, these keywords
cannot be used if a variable is evaluated before the first simulation
begins.
</P> </P>
<P>Group functions take one or two arguments. The first argument is the <P>Math operations are written in the usual way, where the "x" and "y" in
group-ID. The <I>dim</I> argument is <I>x</I> or <I>y</I> or <I>z</I>. The <I>dir</I> the examples above can be another section of the formula. Operators
argument is <I>xmin</I>, <I>xmax</I>, <I>ymin</I>, <I>ymax</I>, <I>zmin</I>, or <I>zmax</I>. The are evaluated left to right and have the usual precedence: unary minus
group functions mass() and charge() are the total mass and charge of before exponentiation, exponentiation before multiplication and
the group of atoms. Xcm() and vcm() return components of the position division, and multiplication and division before addition and
and velocity of the center of mass of the group. Fcm() returns a subtraction. Parenthesis can be used to group one or more portions of
component of the total force on the group of atoms. Bound() returns a formula and enforce a desired order of operations. Additional math
the min/max of a particular coordinate for all atoms in the group. operations can be specified as keywords followed by a parenthesized
Gyration() computes the radius-of-gyration of the group of atoms. See argument, e.g. sqrt(v_ke).
the <A HREF = "fix_gyration.html">fix gyration</A> command for the formula.
</P> </P>
<P>For <I>equal</I> style variables, atom vectors take a single integer <P>Group functions take one or two arguments in a specific format. The
argument from 1-N, which is the desired atom-ID, e.g. x[243]. For first argument is the group-ID. The <I>dim</I> argument, if it exists, is
<I>atom</I> style variables, atom vectors take no argument. Since <I>atom</I> <I>x</I> or <I>y</I> or <I>z</I>. The <I>dir</I> argument, if it exists, is <I>xmin</I>,
style variables compute one value per atom, a reference like x[] <I>xmax</I>, <I>ymin</I>, <I>ymax</I>, <I>zmin</I>, or <I>zmax</I>. The group function count()
means the x-coord of each atom will be used when evaluating the is the number of atoms in the group. The group functions mass() and
variable. charge() are the total mass and charge of the group. Xcm() and vcm()
return components of the position and velocity of the center of mass
of the group. Fcm() returns a component of the total force on the
group of atoms. Bound() returns the min/max of a particular
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
gyration</A> command for a definition of the formula.
</P> </P>
<P>Compute references access scalar or vector quantities calculated by a <P>Atom values take a single integer argument from 1-N, which is the
desired atom-ID, e.g. x[243]., which means use the x coordinate of
the atom with ID=243.
</P>
<P>Atom vectors take no argument. They generate one value per atom, so
that a reference like x[] means the x-coord of each atom will be
used when evaluating the variable.
</P>
<P>Compute references access global scalar or vector quantities or
per-atom scalar or vector 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 actual ID of the compute defined elsewhere in the input script.
See the <A HREF = "compute.html">compute</A> command for details. Note that See the <A HREF = "compute.html">compute</A> command for details. Any specific
per-atom quantities calculated by a compute cannot be accessed this compute will either generate global or per-atom values, so there
way, but only global scalar or vector quantities. However, there is a is no amiguity as to which is used.
<A HREF = "compute_sum.html">compute sum</A> command which sums per-atom quantities
into a global scalar or vector which can be accessed by a variable.
</P> </P>
<P>If <I>c_ID[0]</I> is used as a keyword, then the scalar quantity <P>If <I>c_ID</I> is used as a keyword, then the scalar quantity calculated by
calculated by the compute is used. If <I>c_ID[N]</I> is used, then one the compute is used (global or per-atom). If <I>c_ID[N]</I> is used,
component of the vector quantity calculated by the compute is used. N then one component of the vector quantity calculated by the compute is
should be an integer from 1-M, where M is the length of the vector used (global or per-atom). N should be an integer from 1-M, where M
calculated by the compute. is the length of the vector calculated by the compute.
</P> </P>
<P>Fix references access scalar or vector quantities calculated by a <P>Fix references access global scalar or vector quantities or per-atom
<A HREF = "fix.html">fix</A>. See the doc pages for individual fixes to see which scalar or vector quantities calculated by a <A HREF = "fix.html">fix</A>. The ID in
ones compute a scalar or vector quantity. Since the fix may not be
invoked every timestep and compute its quantities, you should insure
the variable is only evaluated on appropriate timesteps. The ID in
the reference should be replaced by the actual ID of the fix defined the reference should be replaced by the actual ID of the fix defined
elsewhere in the input script. See the <A HREF = "fix.html">fix</A> command for elsewhere in the input script. See the doc pages for individual fixes
details. Note that per-atom quantities calculated by a fix cannot be to see which ones compute what kind of quantities. Any specific fix
accessed this way, but only global scalar or vector quantities. compute will either generate global or per-atom values, so there is no
amiguity as to which is used. Some fixes only generate quantities on
certain timesteps. 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> command may only generate averaged
quantities every 100 steps. See the <A HREF = "fix.html">fix</A> command for
details.
</P> </P>
<P>If <I>f_ID[0]</I> is used as a keyword, then the scalar quantity <P>If <I>f_ID</I> is used as a keyword, then the scalar quantity calculated by
calculated by the fix is used. If <I>f_ID[N]</I> is used, then one the fix is used (global or per-atom). If <I>f_ID[N]</I> is used, then
component of the vector quantity calculated by the fix is used. N one component of the vector quantity calculated by the fix is used
should be an integer from 1-M, where M is the length of the vector (global or per-atom). N should be an integer from 1-M, where M is the
calculated by the fix. length of the vector calculated by the fix.
</P> </P>
<P>The current values of other variables can be accessed by prepending a <P>The current values of other variables can be accessed by prepending a
"v_" to the variable name. This will cause the other variable to be "v_" to the variable name. This will cause that variable to be
evaulated. Note that if you do something circular like this: evaulated. Note that <I>equal</I> style variables generate single values
and <I>atom</I> style variables generate one value per atom. Thus an
atom-style variable cannot be referenced by the formula for an
equal-style variable, but the converse is allowed.
</P>
<P>IMPORTANT NOTE: If you define variables in circular manner like this:
</P> </P>
<PRE>variable a equal v_b <PRE>variable a equal v_b
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 will run for a while when the print statement is invoked!
</P> </P>
<P>Note that there is a subtle difference between using a variable in a <P>Another way to reference a variable in a formula is using the $x form
<I>equal</I> or <I>atom</I> style equation in the form $x versus v_x. instead of v_x. There is a subtle difference between the two
references that has to do with when the evaluation of the included
variable is done.
</P> </P>
<P>In the former case, as with any other input script command, the <P>Using a $x, the value of the include variable is substituted for
variable's value is substituted for immediately when the line is read immediately when the line is read from the input script, just as it
from the input script. Thus if the current simulation box volume was would be in other input script command. This could be the desired
1000.0, then these lines: behavior if a static value is desired. Or it could be the desired
behavior for an equal-style variable if the variable command appears
in a loop (see the <A HREF = "jump.html">jump</A> and <A HREF = "next.html">next</A> commmands),
since the substitution will be performed anew each time thru the loop
as the command is re-read. Note that if the variable formula is
enclosed in double quotes, this prevents variable substitution and
thus an error will be generated when the variable formula is
evaluated.
</P>
<P>Using a v_x, the value of the included variable will not be accessed
until the variable formula is evaluated. Thus the value may change
each time the evaluation is performed. This may also be desired
behavior.
</P>
<P>As an example, if the current simulation box volume is 1000.0, then
these lines:
</P> </P>
<PRE>variable x equal vol <PRE>variable x equal vol
variable y equal mult($x,2) variable y equal 2*$x
</PRE> </PRE>
<P>would associate the equation string "mult(1000.0,2)" with variable y. <P>will associate the equation string "2*1000.0" with variable y.
</P> </P>
<P>By contrast, these lines: <P>By contrast, these lines:
</P> </P>
<PRE>variable x equal vol <PRE>variable x equal vol
variable y equal mult(v_x,2) variable y equal 2*v_x
</PRE> </PRE>
<P>would associate the equation string "mult(v_x,2)" with variable y. <P>wlll associate the equation string "2*v_x" with variable y.
</P> </P>
<P>Thus if the variable y were evaluated periodically during a run where <P>Thus if the variable y were evaluated periodically during a run where
the box volume changed, the resulting value would always be 2000.0 for the box volume changed, the resulting value would always be 2000.0 for
@ -315,13 +359,14 @@ the first case, but would change dynamically for the second case.
<P><B>Restrictions:</B> <P><B>Restrictions:</B>
</P> </P>
<P>The use of atom vectors in <I>equal</I> style variables requires the atom <P>The use of atom values in <I>equal</I> or <I>atom</I> style variables requires
style to use a global mapping in order to look up the vector indices. the atom style to use a global mapping in order to look up the vector
Only atom styles with molecular information create global maps unless indices. By default, only atom styles with molecular information
the <A HREF = "atom_modify.html">atom_modify map</A> command is used. create global maps. The <A HREF = "atom_modify.html">atom_modify map</A> command
can override the default.
</P> </P>
<P>All <I>universe</I>- and <I>uloop</I>-style variables must have the same number <P>All <I>universe</I>- and <I>uloop</I>-style variables defined in an input script
of values. must have the same number of values.
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>
</P> </P>

View File

@ -19,22 +19,19 @@ style = {index} or {loop} or {world} or {universe} or {uloop} or {equal} or {ato
{world} args = one string for each partition of processors {world} args = one string for each partition of processors
{universe} args = one or more strings {universe} args = one or more strings
{uloop} args = N = integer size of loop {uloop} args = N = integer size of loop
{equal} or {atom} args = one equation containing numbers, thermo keywords, math functions, group functions, atom vectors, compute references, other variables {equal} or {atom} args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute and fix references, other variables
numbers = 0.0, -5.4, 2.8e-4, etc numbers = 0.0, -5.4, 2.8e-4, etc
thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html
math functions = add(x,y), sub(x,y), mult(x,y), div(x,y), math operations = (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x)
neg(x), pow(x,y), exp(x), ln(x), sqrt(x) group functions = count(group), mass(group), charge(group),
group functions = mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim), xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group) bound(group,xmin), gyration(group)
atom vectors for {equal} = mass\[N\], x\[N\], y\[N\], z\[N\], atom value = mass\[N\], x\[N\], y\[N\], z\[N\],
vx\[N\], vy\[N\], vz\[N\], vx\[N\], vy\[N\], vz\[N\], fx\[N\], fy\[N\], fz\[N\]
fx\[N\], fy\[N\], fz\[N\] atom vector = mass\[\], x\[\], y\[\], z\[\],
atom vectors for {atom} = mass\[\], x\[\], y\[\], z\[\], vx\[\], vy\[\], vz\[\], fx\[\], fy\[\], fz\[\]
vx\[\], vy\[\], vz\[\], compute references = c_ID, c_ID\[N\]
fx\[\], fy\[\], fz\[\] fix references = f_ID, f_ID\[N\]
compute references = c_ID\[0\], c_ID\[N\]
fix references = f_ID\[0\], f_ID\[N\]
other variables = v_abc, v_x, etc :pre other variables = v_abc, v_x, etc :pre
:ule :ule
@ -42,37 +39,43 @@ style = {index} or {loop} or {world} or {universe} or {uloop} or {equal} or {ato
variable x index run1 run2 run3 run4 run5 run6 run7 run8 variable x index run1 run2 run3 run4 run5 run6 run7 run8
variable LoopVar loop $n variable LoopVar loop $n
variable beta equal div(temp,3.0) variable beta equal temp/3.0
variable b1 equal add(x\[234\],mult(0.5,vol)) variable b1 equal "x\[234\] + 0.5*vol"
variable b equal div(xcm(mol1,x),2.0) variable b equal xcm(mol1,x)/2.0
variable b equal c_myTemp\[0\] variable b equal c_myTemp
variable b atom div(mult(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 :pre variable x uloop 15 :pre
[Description:] [Description:]
This command assigns one or more strings to a variable name. This command assigns one or more strings to a variable name for
evaluation later in the input script or during a simulation.
Variables can be used in several ways in LAMMPS. A variable can be Variables can be used in several ways in LAMMPS. A variable can be
referenced elsewhere in an input script. For variable styles that referenced elsewhere in an input script to become part of a new input
store multiple strings, the "next"_next.html command can be used to command. For variable styles that store multiple strings, the
increment which string is assigned to the variable. Variables can be "next"_next.html command can be used to increment which string is
evaluated to produce a numeric value which can be output either assigned to the variable. Variables of style {equal} can be evaluated
directly (see the "print"_print.html, "fix print"_fix_print.html, and to produce a single numeric value which can be output either directly
"run every"_run.html commands) or as part of thermodynamic output (see (see the "print"_print.html, "fix print"_fix_print.html, and "run
the "thermo_style"_thermo_style.html command), fix output (see the every"_run.html commands) or as part of thermodynamic output (see the
"fix ave/spatial"_fix_ave_spatial.html and "compute "thermo_style"_thermo_style.html command), or used as input to an
variable/atom"_compute_variable_atom.html commands), or dump output averaging fix (see the "fix ave/time"_fix_ave/time command).
(see the "dump custom"_dump.html and "compute Variables of style {atom} can be evaluated to produce one numeric
variable/atom"_compute_variable_atom.html commands). value per atom which can be output to a dump file (see the "dump
custom"_dump.html command) or used as input to an averaging fix (see
the "fix ave/spatial"_fix_ave_spatial.html and "fix
ave/atom"_fix_ave_atom.html commands).
In the discussion that follows, the "name" of the variable is the In the discussion that follows, the "name" of the variable is the
arbitrary string that is the 1st argument in the variable command. arbitrary string that is the 1st argument in the variable command.
This name can only contain alphanumeric characters and underscores.
The "string" is one or more of the subsequent arguments. The "string" The "string" is one or more of the subsequent arguments. The "string"
can be simple text as in the 1st example above, it can contain other can be simple text as in the 1st example above, it can contain other
variables as in the 2nd example, or it can be an equation as in the variables as in the 2nd example, or it can be a formula as in the 3rd
3rd example. The "value" is the numeric quantity resulting from example. The "value" is the numeric quantity resulting from
evaluation of the string. Note that the same string can generate evaluation of the string. Note that the same string can generate
different values when it is evaluated at different times during a different values when it is evaluated at different times during a
simulation. simulation.
@ -83,14 +86,16 @@ is ignored. This means variables can NOT be re-defined in an input
script (with 2 exceptions, read further). This is to allow an input script (with 2 exceptions, read further). This is to allow an input
script to be processed multiple times without resetting the variables; script to be processed multiple times without resetting the variables;
see the "jump"_jump.html or "include"_include.html commands. It also see the "jump"_jump.html or "include"_include.html commands. It also
means that using a command-line switch -var will override a means that using the "command-line switch"_Section_start.html#2_6 -var
corresponding variable setting in the input script. will override a corresponding variable setting in the input script.
There are two exceptions to this rule. First, variables of style There are two exceptions to this rule. First, variables of style
{equal} ARE redefined each time the command is encountered. This {equal} and {atom} ARE redefined each time the command is encountered.
allow them to be reset, e.g. in a loop. This means an {equal}-style This allows them to be reset, when their formulas contain a
variable will re-define a command-line swich -var setting, so use an substitution for another variable, e.g. $x. This can be useful in a
{index}-style variable for these settings instead, as in bench/in.lj. loop. This also means an {equal}-style variable will re-define a
command-line switch -var setting, so an {index}-style variable should
be used for such settings instead, as in bench/in.lj.
Second, as described below, if a variable is iterated on to the end of Second, as described below, if a variable is iterated on to the end of
its list of strings via the "next"_next.html command, it is removed its list of strings via the "next"_next.html command, it is removed
@ -108,10 +113,10 @@ the name "x" is a single character, or as $\{LoopVar\} if the name
As described below, for variable styles {index}, {loop}, {universe}, As described below, for variable styles {index}, {loop}, {universe},
and {uloop}, which string is assigned to a variable can be incremented and {uloop}, which string is assigned to a variable can be incremented
via the "next"_next.html command. When there are no more strings to via the "next"_next.html command. When there are no more strings to
assign, the variable is "exhausted" and a flag is set that causes the assign, the variable is exhausted and a flag is set that causes the
next "jump"_jump.html command encountered in the input script to be next "jump"_jump.html command encountered in the input script to be
skipped. This enables the construction of simple loops in the input skipped. This enables the construction of simple loops in the input
script that are iterated over and exited from. script that are iterated over and then exited from.
:line :line
@ -169,12 +174,13 @@ script.
:line :line
For the {equal} and {atom} styles, a single string is specified which For the {equal} and {atom} styles, a single string is specified which
represents an equation that will be evaluated afresh each time the represents a formula that will be evaluated afresh each time the
variable is used. For {equal} style variables this equation computes variable is used. If you want spaces in the string, enclose it in
a scalar quantity, which becomes the value of the variable whenever it double quotes so the parser will treat it as a single argument. For
is evaluated. For {atom} style variables it computes a quantity for {equal} style variables the formula computes a scalar quantity, which
each atom, which is used by the "compute variable/atom" command and becomes the value of the variable whenever it is evaluated. For
its associated output. {atom} style variables the formula computes one quantity for each
atom whenever it is evaluated.
Note that {equal} and {atom} variables can produce different values at Note that {equal} and {atom} variables can produce different values at
different stages of the input script or at different times during a different stages of the input script or at different times during a
@ -185,125 +191,160 @@ timestep it was invoked.
The next command cannot be used with {equal} or {atom} style The next command cannot be used with {equal} or {atom} style
variables, since there is only one string. variables, since there is only one string.
The equation for an {equal} or {atom} variable can contain a variety The formula for an {equal} or {atom} variable can contain a variety
of quantities. The syntax for each kind of quantity is simple, but of quantities. The syntax for each kind of quantity is simple, but
multiple quantities can be nested and combined in various ways to multiple quantities can be nested and combined in various ways to
build up formulas of arbitrary complexity. For example, this is a build up formulas of arbitrary complexity. For example, this is a
valid (though strange) variable equation: valid (though strange) variable formula:
variable x equal div(add(pe,c_MyTemp\[0\]),pow(vol,div(1,3))) :pre variable x equal "pe + c_MyTemp / vol^(1/3)" :pre
Specifically, an equation can contain numbers, thermo keywords, math Specifically, an formula can contain numbers, thermo keywords, math
functions, group functions, atom vectors, compute references, and operations, group functions, atom values, atom vectors, compute
other variables. There is one difference between {equal} and {atom} references, fix references, and references to other variables.
variables; the syntax of Atom vector references is different.
Number: 0.2, 1.0e20, -15.4, etc Number: 0.2, 1.0e20, -15.4, etc
Thermo keywords: vol, pe, ebond, etc Thermo keywords: vol, pe, ebond, etc
Math functions: add(x,y), sub(x,y), mult(x,y), div(x,y), \ Math operations: (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x)
neg(x), pow(x,y), exp(x), ln(x), sqrt(x) Group functions: count(ID), mass(ID), charge(ID), xcm(ID,dim), \
Group functions: mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim) \ vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID)
bound(ID,dir), gyration(ID) Atom values: mass\[N\], x\[N\], y\[N\], z\[N\], \
Atom vectors for {equal}: mass\[N\], x\[N\], y\[N\], z\[N\], \ vx\[N\], vy\[N\], vz\[N\], fx\[N\], fy\[N\], fz\[N\]
vx\[N\], vy\[N\], vz\[N\], \ Atom vectors: mass\[\], x\[\], y\[\], z\[\], \
fx\[N\], fy\[N\], fz\[N\] vx\[\], vy\[\], vz\[\], fx\[\], fy\[\], fz\[\]
Atom vectors for {atom}: mass\[\], x\[\], y\[\], z\[\], \ Compute references: c_ID, c_ID\[N\]
vx\[\], vy\[\], vz\[\], \ Fix references: f_ID, f_ID\[N\]
fx\[\], fy\[\], fz\[\]
Compute references: c_ID\[0\], c_ID\[N\]
Fix references: f_ID\[0\], f_ID\[N\]
Other variables: v_abc, v_x, etc :tb(s=:) Other variables: v_abc, v_x, etc :tb(s=:)
The thermo keywords allowed in the equation are those defined by the Note that the formula for equal-style variables cannot use any formula
"thermo_style custom" command. Note that many thermodyanmic element that produces per-atom values, namely atom vectors, a compute
quantities are only computable after the first simulation has begun. that produces per-atom values, a fix that produces per-atoms values,
Likewise, many thermodynamic quantities (such as energies) are only or an atom-style variable. The formula for atom-style variables can
computed on timesteps when thermodyanmic output is being performed. use these quantities, as well as quantities that produce a global
If the variable equation these quantities at other times, out-of-date scalar or vector, e.g. a compute or fix that produces global
or invalid values may be used. quantities.
Math functions take one or two arguments, each of which may be an The thermo keywords allowed in a formula are those defined by the
equation containing any of the quantities defined above. This allows "thermo_style custom" command. Since many thermodyanmic quantities
equations to be nested, as in the examples above. are only computable after the a simulation has begun, these keywords
cannot be used if a variable is evaluated before the first simulation
begins.
Group functions take one or two arguments. The first argument is the Math operations are written in the usual way, where the "x" and "y" in
group-ID. The {dim} argument is {x} or {y} or {z}. The {dir} the examples above can be another section of the formula. Operators
argument is {xmin}, {xmax}, {ymin}, {ymax}, {zmin}, or {zmax}. The are evaluated left to right and have the usual precedence: unary minus
group functions mass() and charge() are the total mass and charge of before exponentiation, exponentiation before multiplication and
the group of atoms. Xcm() and vcm() return components of the position division, and multiplication and division before addition and
and velocity of the center of mass of the group. Fcm() returns a subtraction. Parenthesis can be used to group one or more portions of
component of the total force on the group of atoms. Bound() returns a formula and enforce a desired order of operations. Additional math
the min/max of a particular coordinate for all atoms in the group. operations can be specified as keywords followed by a parenthesized
Gyration() computes the radius-of-gyration of the group of atoms. See argument, e.g. sqrt(v_ke).
the "fix gyration"_fix_gyration.html command for the formula.
For {equal} style variables, atom vectors take a single integer Group functions take one or two arguments in a specific format. The
argument from 1-N, which is the desired atom-ID, e.g. x\[243\]. For first argument is the group-ID. The {dim} argument, if it exists, is
{atom} style variables, atom vectors take no argument. Since {atom} {x} or {y} or {z}. The {dir} argument, if it exists, is {xmin},
style variables compute one value per atom, a reference like x\[\] {xmax}, {ymin}, {ymax}, {zmin}, or {zmax}. The group function count()
means the x-coord of each atom will be used when evaluating the is the number of atoms in the group. The group functions mass() and
variable. charge() are the total mass and charge of the group. Xcm() and vcm()
return components of the position and velocity of the center of mass
of the group. Fcm() returns a component of the total force on the
group of atoms. Bound() returns the min/max of a particular
coordinate for all atoms in the group. Gyration() computes the
radius-of-gyration of the group of atoms. See the "fix
gyration"_fix_gyration.html command for a definition of the formula.
Compute references access scalar or vector quantities calculated by a Atom values take a single integer argument from 1-N, which is the
desired atom-ID, e.g. x\[243\]., which means use the x coordinate of
the atom with ID=243.
Atom vectors take no argument. They generate one value per atom, so
that a reference like x\[\] means the x-coord of each atom will be
used when evaluating the variable.
Compute references access global scalar or vector quantities or
per-atom scalar or vector 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 actual ID of the compute defined elsewhere in the input script.
See the "compute"_compute.html command for details. Note that See the "compute"_compute.html command for details. Any specific
per-atom quantities calculated by a compute cannot be accessed this compute will either generate global or per-atom values, so there
way, but only global scalar or vector quantities. However, there is a is no amiguity as to which is used.
"compute sum"_compute_sum.html command which sums per-atom quantities
into a global scalar or vector which can be accessed by a variable.
If {c_ID\[0\]} is used as a keyword, then the scalar quantity If {c_ID} is used as a keyword, then the scalar quantity calculated by
calculated by the compute is used. If {c_ID\[N\]} is used, then one the compute is used (global or per-atom). If {c_ID\[N\]} is used,
component of the vector quantity calculated by the compute is used. N then one component of the vector quantity calculated by the compute is
should be an integer from 1-M, where M is the length of the vector used (global or per-atom). N should be an integer from 1-M, where M
calculated by the compute. is the length of the vector calculated by the compute.
Fix references access scalar or vector quantities calculated by a Fix references access global scalar or vector quantities or per-atom
"fix"_fix.html. See the doc pages for individual fixes to see which scalar or vector quantities calculated by a "fix"_fix.html. The ID in
ones compute a scalar or vector quantity. Since the fix may not be
invoked every timestep and compute its quantities, you should insure
the variable is only evaluated on appropriate timesteps. The ID in
the reference should be replaced by the actual ID of the fix defined the reference should be replaced by the actual ID of the fix defined
elsewhere in the input script. See the "fix"_fix.html command for elsewhere in the input script. See the doc pages for individual fixes
details. Note that per-atom quantities calculated by a fix cannot be to see which ones compute what kind of quantities. Any specific fix
accessed this way, but only global scalar or vector quantities. compute will either generate global or per-atom values, so there is no
amiguity as to which is used. Some fixes only generate quantities on
certain timesteps. 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 command may only generate averaged
quantities every 100 steps. See the "fix"_fix.html command for
details.
If {f_ID\[0\]} is used as a keyword, then the scalar quantity If {f_ID} is used as a keyword, then the scalar quantity calculated by
calculated by the fix is used. If {f_ID\[N\]} is used, then one the fix is used (global or per-atom). If {f_ID\[N\]} is used, then
component of the vector quantity calculated by the fix is used. N one component of the vector quantity calculated by the fix is used
should be an integer from 1-M, where M is the length of the vector (global or per-atom). N should be an integer from 1-M, where M is the
calculated by the fix. length of the vector calculated by the fix.
The current values of other variables can be accessed by prepending a The current values of other variables can be accessed by prepending a
"v_" to the variable name. This will cause the other variable to be "v_" to the variable name. This will cause that variable to be
evaulated. Note that if you do something circular like this: evaulated. Note that {equal} style variables generate single values
and {atom} style variables generate one value per atom. Thus an
atom-style variable cannot be referenced by the formula for an
equal-style variable, but the converse is allowed.
IMPORTANT NOTE: If you define variables in circular manner like this:
variable a equal v_b 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 will run for a while when the print statement is invoked!
Note that there is a subtle difference between using a variable in a Another way to reference a variable in a formula is using the $x form
{equal} or {atom} style equation in the form $x versus v_x. instead of v_x. There is a subtle difference between the two
references that has to do with when the evaluation of the included
variable is done.
In the former case, as with any other input script command, the Using a $x, the value of the include variable is substituted for
variable's value is substituted for immediately when the line is read immediately when the line is read from the input script, just as it
from the input script. Thus if the current simulation box volume was would be in other input script command. This could be the desired
1000.0, then these lines: behavior if a static value is desired. Or it could be the desired
behavior for an equal-style variable if the variable command appears
in a loop (see the "jump"_jump.html and "next"_next.html commmands),
since the substitution will be performed anew each time thru the loop
as the command is re-read. Note that if the variable formula is
enclosed in double quotes, this prevents variable substitution and
thus an error will be generated when the variable formula is
evaluated.
Using a v_x, the value of the included variable will not be accessed
until the variable formula is evaluated. Thus the value may change
each time the evaluation is performed. This may also be desired
behavior.
As an example, if the current simulation box volume is 1000.0, then
these lines:
variable x equal vol variable x equal vol
variable y equal mult($x,2) :pre variable y equal 2*$x :pre
would associate the equation string "mult(1000.0,2)" with variable y. will associate the equation string "2*1000.0" with variable y.
By contrast, these lines: By contrast, these lines:
variable x equal vol variable x equal vol
variable y equal mult(v_x,2) :pre variable y equal 2*v_x :pre
would associate the equation string "mult(v_x,2)" with variable y. wlll associate the equation string "2*v_x" with variable y.
Thus if the variable y were evaluated periodically during a run where Thus if the variable y were evaluated periodically during a run where
the box volume changed, the resulting value would always be 2000.0 for the box volume changed, the resulting value would always be 2000.0 for
@ -313,13 +354,14 @@ the first case, but would change dynamically for the second case.
[Restrictions:] [Restrictions:]
The use of atom vectors in {equal} style variables requires the atom The use of atom values in {equal} or {atom} style variables requires
style to use a global mapping in order to look up the vector indices. the atom style to use a global mapping in order to look up the vector
Only atom styles with molecular information create global maps unless indices. By default, only atom styles with molecular information
the "atom_modify map"_atom_modify.html command is used. create global maps. The "atom_modify map"_atom_modify.html command
can override the default.
All {universe}- and {uloop}-style variables must have the same number All {universe}- and {uloop}-style variables defined in an input script
of values. must have the same number of values.
[Related commands:] [Related commands:]