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:
</P>
<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_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_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_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>
<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_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_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>
</TD></TR></TABLE></DIV>
<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
description:
"attribute/atom"_compute_attribute_atom.html,
"centro/atom"_compute_centro_atom.html,
"coord/atom"_compute_coord_atom.html,
"ke/atom"_compute_ke_atom.html,
@ -448,16 +447,13 @@ description:
"rotate/gran"_compute_rotate_gran.html,
"stress/atom"_compute_stress_atom.html,
"sum"_compute_sum.html,
"sum/atom"_compute_sum_atom.html,
"temp"_compute_temp.html,
"temp/asphere"_compute_temp_asphere.html,
"temp/deform"_compute_temp_deform.html,
"temp/dipole"_compute_temp_dipole.html,
"temp/partial"_compute_temp_partial.html,
"temp/ramp"_compute_temp_ramp.html,
"temp/region"_compute_temp_region.html,
"variable"_compute_variable.html,
"variable/atom"_compute_variable_atom.html :tb(c=6,ea=c)
"temp/region"_compute_temp_region.html :tb(c=6,ea=c)
These are compute styles contributed by users, which can be used if
"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
contain snapshots of atoms and various per-atom values and are written
at a specified frequency. A simulation prints one set of
thermodynamic output; it may generate zero, or one, or multiple dump
files. LAMMPS gives you a variety of ways to determine what
thermodynamic output; it may generate any number of dump files. As
discussed below, LAMMPS gives you a variety of ways to determine what
quantities are computed and printed when thermodynamic info or dump
files are output. There are also three fixes which can do their own
output of user-defined quantities: <A HREF = "fix_ave_time.html">fix ave/time</A>
for time averaging, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> for spatial
averaging, and <A HREF = "fix_print.html">fix print</A>. These are described below.
output of user-chosen quantities: <A HREF = "fix_ave_time.html">fix ave/time</A> for
time averaging, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> for spatial
averaging, and <A HREF = "fix_print.html">fix print</A>. These are 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>
<H5>Thermodynamic output
</H5>
<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_modify.html">thermo_modify</A> commands. The
<A HREF = "themo_style.html">thermo_style</A> command also specifies what values are
calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc) which include time-averaged versions of
temperature, pressure, and a few other variables (tave, pave, etc).
Three addtional kinds of keywords can also be specified (c_ID, f_ID,
v_name), where a <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> or
<A HREF = "variable.html">variable</A> provides the value(s) to be output. Each of
these are described in turn.
(e.g. press, etotal, etc). Three addtional kinds of keywords can also
be specified (c_ID, f_ID, v_name), where a <A HREF = "compute.html">compute</A> or
<A HREF = "fix.html">fix</A> or <A HREF = "variable.html">variable</A> provides the value to be
output. Each of these are described in turn.
</P>
<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
tensor) and ones that compute one or more per-atom values. There is a
<A HREF = "compute_sum.html">compute sum</A> command which sums per-atom quantities
into a global scalar or vector.
compute global values (e.g. temperature, pressure tensor) and ones
that compute per-atom values. Only global quantities from a compute
can be used for thermodynamic output. The user-defined ID of the
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>Only global quantities from a compute can be used for thermodynamic
output. The user-defined ID of the 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] would output the 2nd vector value.
<P><A HREF = "fix.html">Fixes</A> can generate global scalar or vector values which can
be output with thermodynamic output, e.g. the energy of an indenter's
interaction with the simulation atoms. These values are 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, e.g. a
time-averaged pressure.
</P>
<P><A HREF = "fix.html">Fixes</A> can also generate global scalar or vector values
which can be output with thermodynamic output, e.g. the energy of an
indenter's interaction with the simulation atoms. These values are
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
<P><A HREF = "variable.html">Variables</A> can be defined in the input script. All
styles except the atom-style variable can be used for thermodynamic
output, since it generates per-atom values. A variable with the name
"abc" is referenced in a thermo_style command as v_abc.
</P>
<P>The variable formula defined in the input script can contain math
functions (add, exp, etc), atom values (x[N], fx[N]), groups
quantities (mass(), vcm(), etc), references to thermodynamic
quantities (e.g. temp, volume, etc), or references to other variables
or <A HREF = "compute.html">computes</A> or <A HREF = "fix.html">fixes</A>. Thus a variable is
the most general way to define some quantity you want calculated and
output with thermodynamic info.
<P>The formula associated with equal-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 other
<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>
<H5>Dump file output
</H5>
<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
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
each atom. Pre-defined keywords can be specified (e.g. tag, type, x,
etc). Two additional kinds of keywords can also be specified (c_ID,
f_ID), where a <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A> provides the
values to be output.
custom</A> format where the user specifies what values are
output with each atom. Pre-defined keywords can be specified (tag, x,
fx, etc). Three additional kinds of keywords can also be specified
(c_ID, f_ID, v_name), where a <A HREF = "compute.html">compute</A> or <A HREF = "fix.html">fix</A>
or <A HREF = "variable.html">variable</A> provides the value to be output. Each of
these are described in turn.
</P>
<P><A HREF = "compute.html">Computes</A> that generate per-atom values can be accessed
by the dump custom command. These are computes that have the word
"atom" in their style name, e.g. ke/atom, stress/atom, etc. 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
<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><A HREF = "compute.html">Computes</A> that generate one or more per-atom values can
be accessed by the dump custom command. These are computes that have
the word "atom" in their style name, e.g. ke/atom, stress/atom, etc.
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.
</P>
<P><A HREF = "fix.html">Fixes</A> can also generate per-atom values to output to dump
files. For example, the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command
calculates time-averages of compute quantities. As indicated in the
preceeding paragraph, a <A HREF = "compute.html">compute quantity</A> can be 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.
<P><A HREF = "fix.html">Fixes</A> can generate per-atom values to output to dump files.
For example, the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command calculates
time-averages of per-atom quantities, such as per-atom
<A HREF = "compute.html">computes</A> and atom-style <A HREF = "variable.html">variables</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]
for a component of a vector per-atom quantity.
command via the same format as a compute's values, as f_myKE or
f_myStress[2].
</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
ave/time</A>, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>,
and <A HREF = "fix_print.html">fix print</A>.
</P>
<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
are calculated by a <A HREF = "compute.html">compute</A> or a <A HREF = "fix.html">fix</A>. The
compute or fix must generate global scalar or vector quantities. Note
that this includes the "compute sum" command which computes global
values by summing per-atom quantities. The time-averaged values
generated by <A HREF = "fix_ave_time.html">fix ave/time</A> can be written directly
to a file and/or accessed by any output command that uses fixes as a
source of input, e.g. the <A HREF = "thermo_style.html">thermo_style custom</A>
command. Fix ave/time options allow for running cummulative averages
or moving time-windowed averages to be output.
any global quantity, like those output with thermodynamic info. The
user specifies one or more quantities to time average. These can be
global <A HREF = "compute.html">compute</A> values, global <A HREF = "fix.html">fix</A> values, or
<A HREF = "variable.html">variables</A> of any style except the atom style which
produces per-atom values. Since a variable can refer to keywords used
by the <A HREF = "thermo_style.html">thermo_style custom</A> command (like temp or
press), any thermodynamic quantity can be time averaged in this way.
</P>
<P>The <A HREF = "fix_ave_time.html">fix ave/time</A> command offers several options
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>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command enables
spatial-averaging of per-atom quantities like per-atom energy or
stress. The per-atom quantities can be atom density (mass or number)
or be calculated by a <A HREF = "compute.html">compute</A> or a <A HREF = "fix.html">fix</A>. The
compute or fix must generate per-atom scalar or vector quantities.
Note that if you use the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command with
fix ave/spatial, it means you are effectively calculating a time
average of a spatial average of a time-averaged per-atom quantity.
The time-averaged values generated by <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> can be written directly to a file
and/or accessed by any output command that uses fixes as a source of
input, e.g. the <A HREF = "thermo_style.html">thermo_style custom</A> command. Fix
ave/spatial options allow for running cummulative averages or moving
time-windowed averages to be output.
spatial-averaging of per-atom quantities like those output in dump
files, within 1d layers of the simulation box. The per-atom
quantities can be atom density (mass or number) or atom attributes
such as position, velocity, force. They can also be per-atom
quantities calculated by a <A HREF = "compute.html">compute</A>, by a
<A HREF = "fix.html">fix</A>, or by an atom-style <A HREF = "variable.html">variable</A>.
</P>
<P>The <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command offers several
options for how it performs time averaging. The per-layer values it
produces can be used in two ways. First, they can be written directly
to a file. Note that the averaging parameters can be specified in
such a way that time averaging is not done, in which case this is a
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>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
simulation. Since the line can contain one or more
<A HREF = "variable.html">variable</A> quantities, this command is a means to output
desired calculated quantities that are not part of thermodynamic or
dump file output.
written to the screen and log file or to a separate file, periodically
during a running simulation. The line can contain one or more
<A HREF = "variable.html">variable</A> values (for any style variable except the
atom style), and as explained above, variables themselves can contain
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>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>
<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
contain snapshots of atoms and various per-atom values and are written
at a specified frequency. A simulation prints one set of
thermodynamic output; it may generate zero, or one, or multiple dump
files. LAMMPS gives you a variety of ways to determine what
thermodynamic output; it may generate any number of dump files. As
discussed below, LAMMPS gives you a variety of ways to determine what
quantities are computed and printed when thermodynamic info or dump
files are output. There are also three fixes which can do their own
output of user-defined quantities: "fix ave/time"_fix_ave_time.html
for time averaging, "fix ave/spatial"_fix_ave_spatial.html for spatial
averaging, and "fix print"_fix_print.html. These are described below.
output of user-chosen quantities: "fix ave/time"_fix_ave_time.html for
time averaging, "fix ave/spatial"_fix_ave_spatial.html for spatial
averaging, and "fix print"_fix_print.html. These are 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
"thermo"_thermo.html, "thermo_style"_thermo_style.html, and
"thermo_modify"_thermo_modify.html commands. The
"thermo_style"_themo_style.html command also specifies what values are
calculated and written out. Pre-defined keywords can be specified
(e.g. press, etotal, etc) which include time-averaged versions of
temperature, pressure, and a few other variables (tave, pave, etc).
Three addtional kinds of keywords can also be specified (c_ID, f_ID,
v_name), where a "compute"_compute.html or "fix"_fix.html or
"variable"_variable.html provides the value(s) to be output. Each of
these are described in turn.
(e.g. press, etotal, etc). Three addtional kinds of keywords can also
be specified (c_ID, f_ID, v_name), where a "compute"_compute.html or
"fix"_fix.html or "variable"_variable.html provides the value to be
output. Each of these are described in turn.
In LAMMPS, a "compute"_compute.html comes in two flavors: ones that
compute one or more global values (e.g. temperature, kinetic energy
tensor) and ones that compute one or more per-atom values. There is a
"compute sum"_compute_sum.html command which sums per-atom quantities
into a global scalar or vector.
compute global values (e.g. temperature, pressure tensor) and ones
that compute per-atom values. Only global quantities from a compute
can be used for thermodynamic output. The user-defined ID of the
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
output. The user-defined ID of the 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\] would output the 2nd vector value.
"Fixes"_fix.html can generate global scalar or vector values which can
be output with thermodynamic output, e.g. the energy of an indenter's
interaction with the simulation atoms. These values are 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, e.g. a
time-averaged pressure.
"Fixes"_fix.html can also generate global scalar or vector values
which can be output with thermodynamic output, e.g. the energy of an
indenter's interaction with the simulation atoms. These values are
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
"Variables"_variable.html can be defined in the input script. All
styles except the atom-style variable can be used for thermodynamic
output, since it generates per-atom values. A variable with the name
"abc" is referenced in a thermo_style command as v_abc.
The variable formula defined in the input script can contain math
functions (add, exp, etc), atom values (x\[N\], fx\[N\]), groups
quantities (mass(), vcm(), etc), references to thermodynamic
quantities (e.g. temp, volume, etc), or references to other variables
or "computes"_compute.html or "fixes"_fix.html. Thus a variable is
the most general way to define some quantity you want calculated and
output with thermodynamic info.
The formula associated with equal-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 other
"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_modify"_dump_modify.html commands. There are several
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
each atom. Pre-defined keywords can be specified (e.g. tag, type, x,
etc). Two additional kinds of keywords can also be specified (c_ID,
f_ID), where a "compute"_compute.html or "fix"_fix.html provides the
values to be output.
custom"_dump.html format where the user specifies what values are
output with each atom. Pre-defined keywords can be specified (tag, x,
fx, etc). Three additional kinds of keywords can also be specified
(c_ID, f_ID, v_name), where a "compute"_compute.html or "fix"_fix.html
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
by the dump custom command. These are computes that have the word
"atom" in their style name, e.g. ke/atom, stress/atom, etc. 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
"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.
"Computes"_compute.html that generate one or more per-atom values can
be accessed by the dump custom command. These are computes that have
the word "atom" in their style name, e.g. ke/atom, stress/atom, etc.
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.
"Fixes"_fix.html can also generate per-atom values to output to dump
files. For example, the "fix ave/atom"_fix_ave_atom.html command
calculates time-averages of compute quantities. As indicated in the
preceeding paragraph, a "compute quantity"_compute.html can be a
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.
"Fixes"_fix.html can generate per-atom values to output to dump files.
For example, the "fix ave/atom"_fix_ave_atom.html command calculates
time-averages of per-atom quantities, such as per-atom
"computes"_compute.html and atom-style "variables"_variable.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\]
for a component of a vector per-atom quantity.
command via the same format as a compute's values, as f_myKE or
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
ave/time"_fix_ave_time.html, "fix ave/spatial"_fix_ave_spatial.html,
and "fix print"_fix_print.html.
The "fix ave/time"_fix_ave_time.html command enables time-averaging of
global quantities like temperature or pressure. The global quantities
are calculated by a "compute"_compute.html or a "fix"_fix.html. The
compute or fix must generate global scalar or vector quantities. Note
that this includes the "compute sum" command which computes global
values by summing per-atom quantities. The time-averaged values
generated by "fix ave/time"_fix_ave_time.html can be written directly
to a file and/or accessed by any output command that uses fixes as a
source of input, e.g. the "thermo_style custom"_thermo_style.html
command. Fix ave/time options allow for running cummulative averages
or moving time-windowed averages to be output.
any global quantity, like those output with thermodynamic info. The
user specifies one or more quantities to time average. These can be
global "compute"_compute.html values, global "fix"_fix.html values, or
"variables"_variable.html of any style except the atom style which
produces per-atom values. Since a variable can refer to keywords used
by the "thermo_style custom"_thermo_style.html command (like temp or
press), any thermodynamic quantity can be time averaged in this way.
The "fix ave/time"_fix_ave_time.html command offers several options
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
spatial-averaging of per-atom quantities like per-atom energy or
stress. The per-atom quantities can be atom density (mass or number)
or be calculated by a "compute"_compute.html or a "fix"_fix.html. The
compute or fix must generate per-atom scalar or vector quantities.
Note that if you use the "fix ave/atom"_fix_ave_atom.html command with
fix ave/spatial, it means you are effectively calculating a time
average of a spatial average of a time-averaged per-atom quantity.
The time-averaged values generated by "fix
ave/spatial"_fix_ave_spatial.html can be written directly to a file
and/or accessed by any output command that uses fixes as a source of
input, e.g. the "thermo_style custom"_thermo_style.html command. Fix
ave/spatial options allow for running cummulative averages or moving
time-windowed averages to be output.
spatial-averaging of per-atom quantities like those output in dump
files, within 1d layers of the simulation box. The per-atom
quantities can be atom density (mass or number) or atom attributes
such as position, velocity, force. They can also be per-atom
quantities calculated by a "compute"_compute.html, by a
"fix"_fix.html, or by an atom-style "variable"_variable.html.
The "fix ave/spatial"_fix_ave_spatial.html command offers several
options for how it performs time averaging. The per-layer values it
produces can be used in two ways. First, they can be written directly
to a file. Note that the averaging parameters can be specified in
such a way that time averaging is not done, in which case this is a
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
written to the screen and log file periodically during a running
simulation. Since the line can contain one or more
"variable"_variable.html quantities, this command is a means to output
desired calculated quantities that are not part of thermodynamic or
dump file output.
written to the screen and log file or to a separate file, periodically
during a running simulation. The line can contain one or more
"variable"_variable.html values (for any style variable except the
atom style), and as explained above, variables themselves can contain
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
:link(Cornell)

View File

@ -29,31 +29,50 @@ compute 3 all ke/atom
<P><B>Description:</B>
</P>
<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>In LAMMPS, a "compute" is used in several ways. 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>The results of global computes can be output via the <A HREF = "thermo_style.html">thermo_style
<P>In LAMMPS, a "compute" can be used in several ways. The results of
global computes can be output via the <A HREF = "thermo_style.html">thermo_style
custom</A> or <A HREF = "fix_ave_time.html">fix ave/time</A> command.
Or the values can be referenced in a <A HREF = "variable.html">variable equal</A>
command. The results of computes that calculate a global temperature
or pressure can be used by fixes that do thermostatting or
barostatting and when atom velocities are created.
Or the values can be referenced in a <A HREF = "variable.html">variable equal</A> or
<A HREF = "variable.html">variable atom</A> command. The results of computes that
calculate a global temperature or pressure can be used by fixes that
do thermostatting or barostatting and when atom velocities are
created.
</P>
<P>The results of per-atom computes can be output via the <A HREF = "dump.html">dump
custom</A> command or the <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> command. Or the per-atom values can
be time-averaged via the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command and
then output via the <A HREF = "dump.html">dump custom</A> or <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> commands. Note that the value of
per-atom computes will be 0.0 for atoms not in the specified compute
group.
ave/spatial</A> commands. Or the per-atom values
can be referenced in a <A HREF = "variable.html">variable atom</A> command. Note
that the value of per-atom computes will be 0.0 for atoms not in the
specified compute group.
</P>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options.
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>LAMMPS creates its own global computes for thermodynamic output.
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_pe all pe
</PRE>
<P>Additional computes are created if the thermo style requires it. See
the documentation for the <A HREF = "thermo_style.html">thermo_style</A> command.
<P>Additional computes for other quantities are created if the thermo
style requires it. See the documentation for the
<A HREF = "thermo_style.html">thermo_style</A> command.
</P>
<P>The dumping of atom snapshots and fixes that compute temperature or
pressure also create computes as required. These are discussed in the
documentation for the <A HREF = "dump.html">dump custom</A> and specific
<A HREF = "fix.html">fix</A> commands.
<P>Fixes that calculate temperature or pressure, i.e. for thermostatting
or barostatting, may also create computes. These are discussed in the
documentation for specific <A HREF = "fix.html">fix</A> commands.
</P>
<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
<A HREF = "thermo_modify.html">thermo_modify</A>, <A HREF = "fix_modify.html">fix modify</A>, and
<A HREF = "dump.html">dump</A> commands.
<A HREF = "thermo_modify.html">thermo_modify</A> and <A HREF = "fix_modify.html">fix modify</A>
commands.
</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.
</P>
<P>Computes can be deleted with the <A HREF = "uncompute.html">uncompute</A> command.
@ -88,20 +107,18 @@ calculations accessed in the various ways described above.
</P>
<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
defined in LAMMPS:
available in LAMMPS:
</P>
<UL><LI><A HREF = "compute_attribute_atom.html">attribute/atom</A> - attribute (x,v,f,etc) of each atom
<LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom
<UL><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_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 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_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_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_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_asphere.html">temp/asphere</A> - temperature of aspherical particles
<LI><A HREF = "compute_temp_deform.html">temp/deform</A> - temperature excluding box deformation velocity
@ -109,8 +126,6 @@ defined in LAMMPS:
<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_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>
<P>There are also additional compute styles submitted by users which are
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:]
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
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.
The results of global computes can be output via the "thermo_style
In LAMMPS, a "compute" can be used in several ways. The results of
global computes can be output via the "thermo_style
custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command.
Or the values can be referenced in a "variable equal"_variable.html
command. The results of computes that calculate a global temperature
or pressure can be used by fixes that do thermostatting or
barostatting and when atom velocities are created.
Or the values can be referenced in a "variable equal"_variable.html or
"variable atom"_variable.html command. The results of computes that
calculate a global temperature or pressure can be used by fixes that
do thermostatting or barostatting and when atom velocities are
created.
The results of per-atom computes can be output via the "dump
custom"_dump.html command or the "fix
ave/spatial"_fix_ave_spatial.html command. Or the per-atom values can
be time-averaged via the "fix ave/atom"_fix_ave_atom.html command and
then output via the "dump custom"_dump.html or "fix
ave/spatial"_fix_ave_spatial.html commands. Note that the value of
per-atom computes will be 0.0 for atoms not in the specified compute
group.
ave/spatial"_fix_ave_spatial.html commands. Or the per-atom values
can be referenced in a "variable atom"_variable.html command. Note
that the value of per-atom computes will be 0.0 for atoms not in the
specified compute group.
See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options.
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.
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_pe all pe :pre
Additional computes are created if the thermo style requires it. See
the documentation for the "thermo_style"_thermo_style.html command.
Additional computes for other quantities are created if the thermo
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
pressure also create computes as required. These are discussed in the
documentation for the "dump custom"_dump.html and specific
"fix"_fix.html commands.
Fixes that calculate temperature or pressure, i.e. for thermostatting
or barostatting, may also create computes. These are discussed in the
documentation for specific "fix"_fix.html commands.
In all these cases, the default computes can be replaced by computes
defined by the user in the input script, as described by the
"thermo_modify"_thermo_modify.html, "fix modify"_fix_modify.html, and
"dump"_dump.html commands.
"thermo_modify"_thermo_modify.html and "fix modify"_fix_modify.html
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.
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
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
"coord/atom"_compute_coord_atom.html - coordination number 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 for each atom
"pe/atom"_compute_pe_atom.html - potential energy for each atom
"pressure"_compute_pressure.html - total pressure and pressure tensor
"rotate/dipole"_compute_rotate_dipole.html - rotational energy of dipolar atoms
"rotate/gran"_compute_rotate_gran.html - rotational energy of granular atoms
"stress/atom"_compute_stress_atom.html - stress tensor for each atom
"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/asphere"_compute_temp_asphere.html - temperature of aspherical particles
"temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity
"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/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component
"temp/region"_compute_temp_region.html - temperature of a region of atoms
"variable"_compute_variable.html - calculate a scalar value from a variable
"variable/atom"_compute_variable_atom.html - calculate a formula for each atom :ul
"temp/region"_compute_temp_region.html - temperature of a region of atoms :ul
There are also additional compute styles submitted by users which are
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>
<P>See the "thermo_style" command for more details.
</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>
<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.
[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
[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
"temp". See the "thermo_style" command for more details.
</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>
<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
"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
[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
disk/spherical (2d/3d) particle, and w is its angular velocity.
</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>
<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
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
[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
disk/spherical (2d/3d) particle, and w is its angular velocity.
</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>
<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
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
[Related commands:] none

View File

@ -13,45 +13,85 @@
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID sum compute-ID1 compute-ID2 ...
<PRE>compute ID group-ID sum value1 value2 ...
</PRE>
<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>
<P><B>Examples:</B>
</P>
<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>
<P><B>Description:</B>
</P>
<P>Define a computation that sums the results of one or more per-atom
computes 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
summed to yield a net force on the group. The resulting value(s) can
be accessed by any command that uses global computes, e.g. the <A HREF = "therml_style.html">thermo
<P>Define a calculation that sums the results of one or more per-atom
quantities across all atoms in the group to yield a global scalar or
vector quantity. The resulting value(s) can 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>
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>Unlike the <A HREF = "compute_sum_atom.html">compute sum/atom</A> command, the
result of this is not a per-atom quantity, but a global scalar or
vector. If the other computes each generate a scalar value per atom,
this compute will generate a single scalar value. If the other
computes each generate a vector of values per atom, this compute will
generate a vector of values where each value is the sum across atoms
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>Each listed value is summed independently. The group specified with
the command means only atoms within the group contribute to the sum.
Note that the value that produces the per-atom quantities may define
its own group which affects the values it returns. For example, if a
per-atom compute is used as a value, it will generate values of 0.0
for atoms that are not in the group specified for that compute.
</P>
<P>Note that all per-atom computes generate values of 0.0 for atoms that
are not in the group specified for that compute.
<P>Each listed value can be an atom attribute (position, velocity, force
component) or can be the result of a <A HREF = "compute.html">compute</A> or
<A HREF = "fix.html">fix</A> or the evaluation of an 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><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</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><B>Default:</B> none
</P>

View File

@ -10,44 +10,79 @@ compute sum command :h3
[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
sum/ = style name of this compute command
compute-ID1, 2, ... = IDs of computes that calculate per-atom quantities :ul
ID, group-ID are documented in "compute"_compute.html command :ulb,l
sum = style name of this compute command :l
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:]
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:]
Define a computation that sums the results of one or more per-atom
computes 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
summed to yield a net force on the group. The resulting value(s) can
be accessed by any command that uses global computes, e.g. the "thermo
Define a calculation that sums the results of one or more per-atom
quantities across all atoms in the group to yield a global scalar or
vector quantity. The resulting value(s) can 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
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
result of this is not a per-atom quantity, but a global scalar or
vector. If the other computes each generate a scalar value per atom,
this compute will generate a single scalar value. If the other
computes each generate a vector of values per atom, this compute will
generate a vector of values where each value is the sum across atoms
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.
Each listed value is summed independently. The group specified with
the command means only atoms within the group contribute to the sum.
Note that the value that produces the per-atom quantities may define
its own group which affects the values it returns. For example, if a
per-atom compute is used as a value, it will generate values of 0.0
for atoms that are not in the group specified for that compute.
Note that all per-atom computes generate values of 0.0 for atoms that
are not in the group specified for that compute.
Each listed value can be an atom attribute (position, velocity, force
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
[Related commands:]
"compute sum/atom"_compute_sum_atom.html
"compute"_compute.html, "fix"_fix.html, "variable"_variable.html
[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>
<P>See the "thermo_style" command for more details.
</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>
<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.
[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
[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
moment of inertia and w is the angular velocity.
</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>
<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
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:]
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
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</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>
<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
{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
[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
the angular velocity.
</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>
<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
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:]
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
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</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>
<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
{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
[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
<I>extra</I> option of the <A HREF = "compute_modify.html">compute_modify</A> command.
</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>
<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
{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
[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
<A HREF = "compute_modify.html">compute_modify</A> command.
</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>
<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
"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
[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
quatw,quati,quatj,quatk = quaternion components for 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[N] = Nth per-atom vector quantity calculated by a compute identified by its ID
f_ID = scalar per-atom quantity calculated by a fix identified by its ID
f_ID[N] = Nth per-atom vector quantity calculated by a fix identified by its ID
v_name = atom-style variable that calculates a per-atom quantity
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>
@ -80,18 +80,19 @@ information for atoms in the specified group is dumped. The
included. Not all styles support all these options; see details
below.
</P>
<P>Note that because periodic boundary conditions are enforced only on
timesteps when neighbor lists are rebuilt, the coordinates of an atom
written to a dump file may be slightly outside the simulation box.
<P>IMPORTANT NOTE: Vecause periodic boundary conditions are enforced only
on timesteps when neighbor lists are rebuilt, the coordinates of an
atom written to a dump file may be slightly outside the simulation
box.
</P>
<P>Also note that when LAMMPS is running in parallel, the atom
information written to dump files (typically one line per atom) may be
written in an indeterminate order. This is because data for a single
snapshot is collected from multiple processors. This is always the
case for the <I>atom</I>, <I>bond</I>, and <I>custom</I> styles. It is also the case
for the <I>xyz</I> style if the dump group is not <I>all</I>. It is not the
case for the <I>dcd</I> and <I>xtc</I> styles which always write atoms in sorted
order. So does the <I>xyz</I> style if the dump group is <I>all</I>.
<P>When LAMMPS is running in parallel, the atom information written to
dump files (typically one line per atom) may be written in an
indeterminate order. This is because data for a single snapshot is
collected from multiple processors. This is always the case for the
<I>atom</I>, <I>bond</I>, and <I>custom</I> styles. It is also the case for the
<I>xyz</I> style if the dump group is not <I>all</I>. It is not the case for
the <I>dcd</I> and <I>xtc</I> styles which always write atoms in sorted order.
So does the <I>xyz</I> style if the dump group is <I>all</I>.
</P>
<HR>
@ -240,9 +241,9 @@ rotational torque on the particle.
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
that has been defined previously in the input script. See the
<A HREF = "compute.html">compute</A> command for details. There are computes for
calculating the energy, stress, centro-symmetry parameter, and
coordination number of individual atoms.
<A HREF = "compute.html">compute</A> command for details. There are per-atom
computes for calculating the energy, stress, centro-symmetry
parameter, and coordination number of individual atoms.
</P>
<P>Note that computes which calculate global scalar and vector
quantities, as opposed to per-atom quantities, cannot be output in a
@ -251,8 +252,8 @@ custom</A> command.
</P>
<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
in the range from 1-M will print the Nth component of the M-length
per-atom vector calculated by the compute.
must be in the range from 1-M, which will print the Nth component of
the M-length per-atom vector calculated by the compute.
</P>
<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
@ -265,22 +266,22 @@ produced by any <A HREF = "compute.html">compute</A>, <A HREF = "fix.html">fix</
be written to a dump file.
</P>
<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
in the range from 1-M will print the Nth component of the M-length
per-atom vector calculated by the fix.
calculated by the fix is printed. If <I>f_ID[N]</I> is used, then N must
be in the range from 1-M, which will print the Nth component of the
M-length per-atom vector calculated by the fix.
</P>
<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
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
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,
per-atom atom attributes, thermodynamic keywords, or invoke other
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>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.
</P>
<HR>

View File

@ -44,11 +44,11 @@ args = list of arguments for a particular style :l
mux,muy,muz = orientation of dipolar atom
quatw,quati,quatj,quatk = quaternion components for 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\[N\] = Nth per-atom vector quantity calculated by a compute identified by its ID
f_ID = scalar per-atom quantity calculated by a fix identified by its ID
f_ID\[N\] = Nth per-atom vector quantity calculated by a fix identified by its ID
v_name = atom-style variable that calculates a per-atom quantity :pre
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:]
@ -70,18 +70,19 @@ information for atoms in the specified group is dumped. The
included. Not all styles support all these options; see details
below.
Note that because periodic boundary conditions are enforced only on
timesteps when neighbor lists are rebuilt, the coordinates of an atom
written to a dump file may be slightly outside the simulation box.
IMPORTANT NOTE: Vecause periodic boundary conditions are enforced only
on timesteps when neighbor lists are rebuilt, the coordinates of an
atom written to a dump file may be slightly outside the simulation
box.
Also note that when LAMMPS is running in parallel, the atom
information written to dump files (typically one line per atom) may be
written in an indeterminate order. This is because data for a single
snapshot is collected from multiple processors. This is always the
case for the {atom}, {bond}, and {custom} styles. It is also the case
for the {xyz} style if the dump group is not {all}. It is not the
case for the {dcd} and {xtc} styles which always write atoms in sorted
order. So does the {xyz} style if the dump group is {all}.
When LAMMPS is running in parallel, the atom information written to
dump files (typically one line per atom) may be written in an
indeterminate order. This is because data for a single snapshot is
collected from multiple processors. This is always the case for the
{atom}, {bond}, and {custom} styles. It is also the case for the
{xyz} style if the dump group is not {all}. It is not the case for
the {dcd} and {xtc} styles which always write atoms in sorted order.
So does the {xyz} style if the dump group is {all}.
: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
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
"compute"_compute.html command for details. There are computes for
calculating the energy, stress, centro-symmetry parameter, and
coordination number of individual atoms.
"compute"_compute.html command for details. There are per-atom
computes for calculating the energy, stress, centro-symmetry
parameter, and coordination number of individual atoms.
Note that computes which calculate global scalar and vector
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
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
per-atom vector calculated by the compute.
must be in the range from 1-M, which will print the Nth component of
the M-length per-atom vector calculated by the compute.
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
@ -255,22 +256,22 @@ produced by any "compute"_compute.html, "fix"_fix.html, or atom-style
be written to a dump file.
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
in the range from 1-M will print the Nth component of the M-length
per-atom vector calculated by the fix.
calculated by the fix is printed. If {f_ID\[N\]} is used, then N must
be in the range from 1-M, which will print the Nth component of the
M-length per-atom vector calculated by the fix.
The {v_name} keyword allows per-atom quantities calculated by a
"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
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,
per-atom atom attributes, thermodynamic keywords, or invoke other
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
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.
:line

View File

@ -34,23 +34,26 @@ timestepping or minimization. Examples include updating of atom
positions and velocities due to time integration, controlling
temperature, applying constraint forces to atoms, enforcing boundary
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.
</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.
If 2 or more fixes both operate at the same stage of the timestep,
they are invoked in the order they were specified in the input script.
If 2 or more fixes operate at the same stage of the timestep, they are
invoked in the order they were specified in the input script.
</P>
<P>Fixes can be deleted with the <A HREF = "unfix.html">unfix</A> command. Note that
this is the only way to turn off a fix; simply specifying a new fix
with a similar style will not turn off the first one. 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>The ID of a fix can only contain alphanumeric characters and
underscores.
</P>
<P>Fixes can be deleted with the <A HREF = "unfix.html">unfix</A> command.
</P>
<P>IMPORTANT NOTE: The <A HREF = "unfix.html">unfix</A> command is the only way to turn
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>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
@ -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.
</P>
<P>Some fixes calculate a global scalar or vector quantity which can be
accessed by various output commands, including
<A HREF = "variable.html">variables</A>, <A HREF = "thermo_style.html">thermo_style custom</A>,
and <A HREF = "fix_ave_time.html">fix ave/time</A>. 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.
accessed by various commands for output, including <A HREF = "variable.html">equal- and
atom-style variables</A>, <A HREF = "thermo_style.html">thermo_style
custom</A>, and <A HREF = "fix_ave_time.html">fix ave/time</A>.
</P>
<P>Some fixes calculate a per-atom scalar or vector quantity which can be
accessed by various commands for output, including <A HREF = "variable.html">atom-style
variables</A>, <A HREF = "dump.html">dump_style custom</A>, and <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A>.
</P>
<P>The results of fixes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, e.g. timestep
size. Extensive means the value scales with the number of atoms in
the simulation, e.g. total force applied by the fix. <A HREF = "thermo_style.html">Thermodynamic
output</A> will normalize extensive values depending on
the "thermo_modify norm" setting. But if a fix value is accessed in
another way, e.g. by a <A HREF = "variable.html">variable</A>, you may need to know
whether it is an intensive or extensive value. See the doc page for
individual fixes for further info.
</P>
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
various LAMMPS output options. See the doc pages for individual fixes
for info on which ones calculate these quantities.
</P>
<P>Some fixes store an internal "state" which is written to binary
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
for individual fixes for info on which ones can be restarted.
</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>
<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

View File

@ -31,23 +31,26 @@ timestepping or minimization. Examples include updating of atom
positions and velocities due to time integration, controlling
temperature, applying constraint forces to atoms, enforcing boundary
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.
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.
If 2 or more fixes both operate at the same stage of the timestep,
they are invoked in the order they were specified in the input script.
If 2 or more fixes operate at the same stage of the timestep, they are
invoked in the order they were specified in the input script.
Fixes can be deleted with the "unfix"_unfix.html command. Note that
this is the only way to turn off a fix; simply specifying a new fix
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
"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!
The ID of a fix can only contain alphanumeric characters and
underscores.
Fixes can be deleted with the "unfix"_unfix.html command.
IMPORTANT NOTE: The "unfix"_unfix.html command is the only way to turn
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
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.
Some fixes calculate a global scalar or vector quantity which can be
accessed by various output commands, including
"variables"_variable.html, "thermo_style custom"_thermo_style.html,
and "fix ave/time"_fix_ave_time.html. 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.
accessed by various commands for output, including "equal- and
atom-style variables"_variable.html, "thermo_style
custom"_thermo_style.html, and "fix ave/time"_fix_ave_time.html.
Some fixes calculate a per-atom scalar or vector quantity which can be
accessed by various commands for output, including "atom-style
variables"_variable.html, "dump_style custom"_dump.html, and "fix
ave/spatial"_fix_ave_spatial.html.
The results of fixes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, e.g. timestep
size. Extensive means the value scales with the number of atoms in
the simulation, e.g. total force applied by the fix. "Thermodynamic
output"_thermo_style.html will normalize extensive values depending on
the "thermo_modify norm" setting. But if a fix value is accessed in
another way, e.g. by a "variable"_variable.html, you may need to know
whether it is an intensive or extensive value. See the doc page for
individual fixes for further info.
See this "howto section"_Section_howto.html#4_15 for a summary of
various LAMMPS output options. See the doc pages for individual fixes
for info on which ones calculate these quantities.
Some fixes store an internal "state" which is written to binary
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
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
"aveforce"_fix_aveforce.html - add an averaged force to each atom

View File

@ -13,52 +13,106 @@
</H3>
<P><B>Syntax:</B>
</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>
<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>Nrepeat = # of times to repeat the Nevery calculation before averaging
<LI>Nfreq = timestep frequency at which the average value is calculated
<LI>compute-ID = ID of per-atom compute that performs the calculation
<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>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all ave/atom 1 100 100 myVx
fix 1 all ave/atom 10 20 1000 my_epair
<PRE>fix 1 all ave/atom 1 100 100 vx vy vz
fix 1 all ave/atom 10 20 1000 c_my_stress<B>1</B>
</PRE>
<P><B>Description:</B>
</P>
<P>Calculate one or more time-averaged per-atom quantities every few
timesteps. The results of this calculation can be spatially averaged
via the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command or output
to a file via the <A HREF = "dump.html">dump custom</A> command.
<P>Calculate one or more instantaneous per-atom quantities every few
timesteps, and average them over longer timescales. The resulting
per-atom averages can be used by other <A HREF = "Section_howto.html#4_15">output
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>The <I>compute-ID</I> specifies a <A HREF = "compute.html">compute</A> which calculates
the desired property. It must be a per-atom compute (one with the
word "atom" in its style name) that calculates one or more values for
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>Each listed value is averaged independently. The group specified with
the command means only atoms within the group have their averages
computed. Atoms not in the group have their result set to 0.0.
</P>
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify how the
property will be time-averaged. The final averaged value(s) are
computed every <I>Nfreq</I> timesteps. The average is over <I>Nrepeat</I>
values, computed in the preceeding portion of the simulation every
<I>Nevery</I> timesteps. Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then
values on timesteps 90,92,94,96,98,100 will be used to compute the
final average at timestep 100. Similary for timesteps
190,192,194,196,198,200 at timestep 200, etc.
<P>Each listed value can be an atom attribute (position, velocity, force
component) or can be the result of a <A HREF = "compute.html">compute</A> or
<A HREF = "fix.html">fix</A> or the evaluation of an 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. 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>If this fix is referenced by a <A HREF = "dump.html">dump custom</A> or <A HREF = "fix_ave_spatial.html">fix
ave/spatial</A> command, the time-averaged values
can only be accessed every <I>Nfreq</I> timesteps.
<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 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>If the compute calculates a single or multiple values per atom, then
fix ave/atom will also calculate one or multiple time-averaged
quantities per atom. This makes a difference in how the quantities
are referenced in a <A HREF = "dump.html">dump custom</A> command, e.g. c_ID versus
c_ID[2].
<HR>
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what
timesteps the values will be generated in order to contribute to the
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><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</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
commands</A>.
</P>
<P>This fix computes a scalar per-atom quantity or a vector of per-atom
quantities which can be accessed by the <A HREF = "dump.html">dump custom</A> or
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> commands, as discussed in <A HREF = "Section_howto.html#4_15">this
section</A>.
<P>This fix produces a per-atom scalar or vector which can be accessed by
various <A HREF = "Section_howto.html#4_15">output commands</A>. A scalar is
produced if only a single quantity is averaged by this fix. If two or
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>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

View File

@ -10,52 +10,98 @@ fix ave/atom command :h3
[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
ave/atom = style name of this fix command
Nevery = calculate property every this many timesteps
Nrepeat = # of times to repeat the Nevery calculation before averaging
Nfreq = timestep frequency at which the average value is calculated
compute-ID = ID of per-atom compute that performs the calculation :ul
ID, group-ID are documented in "fix"_fix.html command :ulb,l
ave/atom = style name of this fix command :l
Nevery = calculate property every this many timesteps :l
Nrepeat = # of times to repeat the Nevery calculation before averaging :l
Nfreq = timestep frequency at which the average value is calculated :l
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:]
fix 1 all ave/atom 1 100 100 myVx
fix 1 all ave/atom 10 20 1000 my_epair :pre
fix 1 all ave/atom 1 100 100 vx vy vz
fix 1 all ave/atom 10 20 1000 c_my_stress[1] :pre
[Description:]
Calculate one or more time-averaged per-atom quantities every few
timesteps. The results of this calculation can be spatially averaged
via the "fix ave/spatial"_fix_ave_spatial.html command or output
to a file via the "dump custom"_dump.html command.
Calculate one or more instantaneous per-atom quantities every few
timesteps, and average them over longer timescales. The resulting
per-atom averages can be used by other "output
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
the desired property. It must be a per-atom compute (one with the
word "atom" in its style name) that calculates one or more values for
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.
Each listed value is averaged independently. The group specified with
the command means only atoms within the group have their averages
computed. Atoms not in the group have their result set to 0.0.
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify how the
property will be time-averaged. The final averaged value(s) are
computed every {Nfreq} timesteps. The average is over {Nrepeat}
values, computed in the preceeding portion of the simulation every
{Nevery} timesteps. Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then
values on timesteps 90,92,94,96,98,100 will be used to compute the
final average at timestep 100. Similary for timesteps
190,192,194,196,198,200 at timestep 200, etc.
Each listed value can be an atom attribute (position, velocity, force
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. 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.
If this fix is referenced by a "dump custom"_dump.html or "fix
ave/spatial"_fix_ave_spatial.html command, the time-averaged values
can only be accessed every {Nfreq} timesteps.
"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 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
fix ave/atom will also calculate one or multiple time-averaged
quantities per atom. This makes a difference in how the quantities
are referenced in a "dump custom"_dump.html command, e.g. c_ID versus
c_ID\[2\].
:line
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
timesteps the values will be generated in order to contribute to the
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:]
@ -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
commands"_Section_howto.html#4_15.
This fix computes a scalar per-atom quantity or a vector of per-atom
quantities which can be accessed by the "dump custom"_dump.html or
"fix ave/spatial"_fix_ave_spatial.html commands, as discussed in "this
section"_Section_howto.html#4_15.
This fix produces a per-atom scalar or vector which can be accessed by
various "output commands"_Section_howto.html#4_15. A scalar is
produced if only a single quantity is averaged by this fix. If two or
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
the "run"_run.html command. This fix is not invoked during "energy

View File

@ -13,7 +13,7 @@
</H3>
<P><B>Syntax:</B>
</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>
<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>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>
<I>mass</I> = calculate mass density
<I>number</I> = calculate number density
<I>compute</I> arg = compute-ID that stores or calculates per-atom quantities
<I>fix</I> arg = fix-ID that stores or calculates per-atom quantities
<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
<PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
density/number, density/mass = number or mass density
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>
<LI>zero or more keyword/arg pairs may be appended
@ -56,76 +60,66 @@
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all ave/spatial 10000 1 10000 z lower 0.02 compute 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 5 1000 y 0.0 2.5 density mass ave running
<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 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>
<P><B>Description:</B>
</P>
<P>Calculate one or more instantaneous per-atom quantities every few
timesteps, average them by layer in a chosen dimension and over a
longer timescale. The resulting averages can be used by other <A HREF = "Section_howto.html#4_15">output
commands</A> such as <A HREF = "thermo_style.html">thermo_style
custom</A>, and also written to a file.
timesteps, average them by layer in a chosen dimension, and average
the layer values over a longer timescale. The resulting averages can
be used by other <A HREF = "Section_howto.html#4_15">output commands</A> such as
<A HREF = "thermo_style.html">thermo_style custom</A>, and can also be written to a
file.
</P>
<P>This fix can be used to spatially average per-atom properties
(velocity, force) or per-atom quantities calculated by a
<A HREF = "compute.html">compute</A> (energy, stress) or by another fix (see the
<A HREF = "fix_ave_atom.html">fix ave/atom</A> command) or by a variable via an
equation you define (see the <A HREF = "compute_variable_atom.html">compute
variable/atom</A> command).
<P>Each listed value is averaged independently. The group specified with
the command means only atoms within the group contribute to the layer
averages.
</P>
<P>For style <I>density</I>, the number of atoms in each layer is counted,
either by mass or by number. The <I>compute</I> style allows specification
of a <A HREF = "compute.html">compute</A> which will be invoked to calculate the
desired property. The compute can be previously defined in the input
script or it can be a compute defined by a <A HREF = "dump.html">dump custom</A>
command.
<P>Each listed value can be an atom attribute (position, velocity, force
component), a mass or number density, or 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. 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>For style <I>compute</I>, the fix ave/spatial command accesses the
per-atom scalar or vector values stored by the compute. Thus it must
be a "per-atom" compute with the word "atom" in its style name, rather
than a "global" compute. See the <A HREF = "fix_ave_time.html">fix ave/time</A>
command if you wish to time-average a global quantity calculated by a
compute without the word atom in its style name, e.g. a compute that
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><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 <A HREF = "fix_ave_atom.html">fix
ave/atom</A>. <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>
<HR>
<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
contribute to the average. The final averaged values are computed
every <I>Nfreq</I> timesteps. The average is over <I>Nrepeat</I> values,
computed in the preceeding portion of the simulation every <I>Nevery</I>
timesteps. <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.
timesteps the layer values will be generated in order to contribute to
the 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.
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>The per-atom property is also averaged over atoms in each layer, where
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
the per-atom property is calculated for the first time, the number of
layers and the layer boundaries are computed. Thus if the 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
<HR>
<P>Each per-atom property is also averaged over atoms in each layer,
where 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 the per-atom property is calculated for the first time, the number
of layers and the layer boundaries are computed. Thus if the
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
at the origin, sufficient layers are created in both directions to
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
box, as discussed below.
</P>
<P>For the <I>compute</I> and <I>fix</I> keywords, the per-atom calculation
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.
<HR>
<P>The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
self-explanatory.
</P>
<P>Note that some computes perform costly calculations, involving the
creation or use of neighbor lists. If the compute is invoked too
often by fix ave/spatial, it can slow down a simulation.
<P>The <I>density/number</I> value means the number density is computed in
each layer, i.e. a weighting of 1 for each atom. The <I>density/mass</I>
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>
<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,
regardless of the current size or shape of the simulation box.
</P>
<P>The <I>norm</I> keyword affects how time-averaging is done within for the
output produced every <I>Nfreq</I> timesteps. For an <I>all</I> setting, a
layer quantity is summed over all atoms in all <I>Nrepeat</I> samples, as
is the count of atoms in the layer. The printed value for the layer
is Total-quantity / Total-count. In other words it is an average over
<P>The <I>norm</I> keyword affects how averaging is done for the output
produced every <I>Nfreq</I> timesteps. For an <I>all</I> setting, a layer
quantity is summed over all atoms in all <I>Nrepeat</I> samples, as is the
count of atoms in the layer. The printed value for the layer is
Total-quantity / Total-count. In other words it is an average over
the entire <I>Nfreq</I> timescale.
</P>
<P>For a <I>sample</I> setting, the quantity is summed over atoms for only a
single sample, as is the count, and a "average sample value" is
<P>For a <I>sample</I> setting, the layer quantity is summed over atoms for
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
the layer is the average of the <I>Nrepeat</I> "average sample values", In
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.
Then one line per layer is written, containing the layer ID (1-N), the
coordinate of the center of the layer, the number of atoms in the
layer, and one or more calculated values. The number of atoms and the
value(s) are average quantities. If the value of the <I>units</I> keyword
is <I>box</I> or <I>lattice</I>, the "coord" is printed in box units. If the
value of the <I>units</I> keyword is <I>reduced</I>, the "coord" is printed in
reduced units (0-1).
</P>
<P>If the style is <I>density</I>, or the style is <I>compute</I> or <I>fix</I> with a
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.
layer, and one or more calculated values. The number of values in
each line corresponds to the number of values specified in the fix
ave/spatial command. The number of atoms and the value(s) are average
quantities. If the value of the <I>units</I> keyword is <I>box</I> or
<I>lattice</I>, the "coord" is printed in box units. If the value of the
<I>units</I> keyword is <I>reduced</I>, the "coord" is printed in reduced units
(0-1).
</P>
<P>The <I>ave</I> keyword determines how the layer values produced every
<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
are relevant to this fix.
</P>
<P>This fix computes a vector of quantities which can be accessed by
various <A HREF = "Section_howto.html#4_15">output commands</A>. The values should
<P>This fix computes a global vector of quantities which can be accessed
by various <A HREF = "Section_howto.html#4_15">output commands</A>. The values can
only be accessed on timesteps that are multiples of <I>Nfreq</I> since that
is when averaging is complete. The vector is of length N =
nlayers*nvalues where nvalues is the number of per-atom quantities
produced by the compute or fix that fix ave/spatial accesses. Nvalues
= 1 if the style is <I>density</I>. If nvalues > 1 and vector value N is
accessed by another output command, then the average quantity for the
Ith layer and Jth value in that layer is accessed, where I = N /
nvalues + 1 and J = N % nvalues + 1.
is when averaging is performed. The global vector is of length N =
nlayers*nvalues where nlayers is the number of layers and nvalues is
the number of values per layer that the fix is averaging. When
accessed by another output command, a single index M is specified
which is mapped into a layer I as I = M / nvalues + 1 and into value J
as J = M % nvalues + 1. If I exceeds the current number of layers
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>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

View File

@ -10,7 +10,7 @@ fix ave/spatial command :h3
[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
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
origin = {lower} or {center} or {upper} or coordinate value (distance units) :l
delta = thickness of spatial layers in dim (distance units) :l
style = {density} or {compute} or {fix} :l
{density} arg = {mass} or {number}
{mass} = calculate mass density
{number} = calculate number density
{compute} arg = compute-ID that stores or calculates per-atom quantities
{fix} arg = fix-ID that stores or calculates per-atom quantities :pre
one or more values can be listed :l
value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
density/number, density/mass = number or mass density
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
zero or more keyword/arg pairs may be appended :l
keyword = {norm} or {units} or {file} or {ave} :l
{units} arg = {box} or {lattice} or {reduced}
@ -40,76 +44,66 @@ keyword = {norm} or {units} or {file} or {ave} :l
[Examples:]
fix 1 all ave/spatial 10000 1 10000 z lower 0.02 compute 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 5 1000 y 0.0 2.5 density mass ave running :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 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
[Description:]
Calculate one or more instantaneous per-atom quantities every few
timesteps, average them by layer in a chosen dimension and over a
longer timescale. The resulting averages can be used by other "output
commands"_Section_howto.html#4_15 such as "thermo_style
custom"_thermo_style.html, and also written to a file.
timesteps, average them by layer in a chosen dimension, and average
the layer values over a longer timescale. The resulting averages can
be used by other "output commands"_Section_howto.html#4_15 such as
"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
(velocity, force) or per-atom quantities calculated by a
"compute"_compute.html (energy, stress) or by another fix (see the
"fix ave/atom"_fix_ave_atom.html command) or by a variable via an
equation you define (see the "compute
variable/atom"_compute_variable_atom.html command).
Each listed value is averaged independently. The group specified with
the command means only atoms within the group contribute to the layer
averages.
For style {density}, the number of atoms in each layer is counted,
either by mass or by number. The {compute} style allows specification
of a "compute"_compute.html which will be invoked to calculate the
desired property. The compute can be previously defined in the input
script or it can be a compute defined by a "dump custom"_dump.html
command.
Each listed value can be an atom attribute (position, velocity, force
component), a mass or number density, or 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. 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
per-atom scalar or vector values stored by the compute. Thus it must
be a "per-atom" compute with the word "atom" in its style name, rather
than a "global" compute. See the "fix ave/time"_fix_ave_time.html
command if you wish to time-average a global quantity calculated by a
compute without the word atom in its style name, e.g. a compute that
calculates a temperature or pressure.
"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 "fix
ave/atom"_fix_ave_atom.html. "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.
See the "compute"_compute.html command for a list of pre-defined
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.
:line
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
timesteps the per-atom property will be evaluated in order to
contribute to the average. The final averaged values are computed
every {Nfreq} timesteps. The average is over {Nrepeat} values,
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.
timesteps the layer values will be generated in order to contribute to
the 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.
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
the layers are in a particular {dim} and have a thickness given by
{delta}. Every Nfreq steps, when an averaging is being performed and
the per-atom property is calculated for the first time, the number of
layers and the layer boundaries are computed. Thus if the 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
:line
Each per-atom property is also averaged over atoms in each layer,
where the layers are in a particular {dim} and have a thickness given
by {delta}. Every Nfreq steps, when an averaging is being performed
and the per-atom property is calculated for the first time, the number
of layers and the layer boundaries are computed. Thus if the
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
at the origin, sufficient layers are created in both directions to
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
box, as discussed below.
For the {compute} and {fix} keywords, the per-atom calculation
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.
:line
Note that some computes perform costly calculations, involving the
creation or use of neighbor lists. If the compute is invoked too
often by fix ave/spatial, it can slow down a simulation.
The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
self-explanatory.
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
@ -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,
regardless of the current size or shape of the simulation box.
The {norm} keyword affects how time-averaging is done within for the
output produced every {Nfreq} timesteps. For an {all} setting, a
layer quantity is summed over all atoms in all {Nrepeat} samples, as
is the count of atoms in the layer. The printed value for the layer
is Total-quantity / Total-count. In other words it is an average over
The {norm} keyword affects how averaging is done for the output
produced every {Nfreq} timesteps. For an {all} setting, a layer
quantity is summed over all atoms in all {Nrepeat} samples, as is the
count of atoms in the layer. The printed value for the layer is
Total-quantity / Total-count. In other words it is an average over
the entire {Nfreq} timescale.
For a {sample} setting, the quantity is summed over atoms for only a
single sample, as is the count, and a "average sample value" is
For a {sample} setting, the layer quantity is summed over atoms for
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
the layer is the average of the {Nrepeat} "average sample values", In
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.
Then one line per layer is written, containing the layer ID (1-N), the
coordinate of the center of the layer, the number of atoms in the
layer, and one or more calculated values. The number of atoms and the
value(s) are average quantities. If the value of the {units} keyword
is {box} or {lattice}, the "coord" is printed in box units. If the
value of the {units} keyword is {reduced}, the "coord" is printed in
reduced units (0-1).
If the style is {density}, or the style is {compute} or {fix} with a
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.
layer, and one or more calculated values. The number of values in
each line corresponds to the number of values specified in the fix
ave/spatial command. The number of atoms and the value(s) are average
quantities. If the value of the {units} keyword is {box} or
{lattice}, the "coord" is printed in box units. If the value of the
{units} keyword is {reduced}, the "coord" is printed in reduced units
(0-1).
The {ave} keyword determines how the layer values produced every
{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
are relevant to this fix.
This fix computes a vector of quantities which can be accessed by
various "output commands"_Section_howto.html#4_15. The values should
This fix computes a global vector of quantities which can be accessed
by various "output commands"_Section_howto.html#4_15. The values can
only be accessed on timesteps that are multiples of {Nfreq} since that
is when averaging is complete. The vector is of length N =
nlayers*nvalues where nvalues is the number of per-atom quantities
produced by the compute or fix that fix ave/spatial accesses. Nvalues
= 1 if the style is {density}. If nvalues > 1 and vector value N is
accessed by another output command, then the average quantity for the
Ith layer and Jth value in that layer is accessed, where I = N /
nvalues + 1 and J = N % nvalues + 1.
is when averaging is performed. The global vector is of length N =
nlayers*nvalues where nlayers is the number of layers and nvalues is
the number of values per layer that the fix is averaging. When
accessed by another output command, a single index M is specified
which is mapped into a layer I as I = M / nvalues + 1 and into value J
as J = M % nvalues + 1. If I exceeds the current number of layers
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
the "run"_run.html command. This fix is not invoked during "energy

View File

@ -13,34 +13,36 @@
</H3>
<P><B>Syntax:</B>
</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>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>ave/time = style name of this fix command
<LI>Nevery = calculate property every this many timesteps
<LI>Nevery = calculate properties every this many timesteps
<LI>Nrepeat = # of times to repeat the Nevery calculation before averaging
<LI>Nfreq = timestep frequency at which the average value is 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>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>
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
<PRE> <I>file</I> arg = filename
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>
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
window M = output average of M most recent Nfreq steps
</PRE>
@ -48,52 +50,50 @@
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all ave/time 100 5 1000 compute myTemp
fix 1 all ave/time 100 5 1000 compute myTemp ave window 20
fix 1 all ave/time 1 100 1000 fix indenter value both file temp.indent
<PRE>fix 1 all ave/time 100 5 1000 myTemp thermo_temp file temp.profile
fix 1 all ave/time 100 5 1000 thermo_pressure<B>2</B> ave window 20
fix 1 all ave/time 1 100 1000 f_indent f_indent<B>1</B> file temp.indent
</PRE>
<P><B>Description:</B>
</P>
<P>Calculate one or more instantaneous quantities every few timesteps,
and average them over a longer timescale. The resulting averages can
be used by other <A HREF = "Section_howto.html#4_15">output commands</A> such as
<A HREF = "thermo_style.html">thermo_style custom</A>, and also written to a file.
<P>Calculate one or more instantaneous global quantities every few
timesteps, and average them over longer timescales. The resulting
averages can be used by other <A HREF = "Section_howto.html#4_15">output
commands</A> such as <A HREF = "thermo_style.html">thermo_style
custom</A>, and can also be written to a file. 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>This fix can be used to time-average a <A HREF = "compute.html">compute</A> which
calculates a global quantity such as a temperature or pressure or a
<A HREF = "fix.html">fix</A> which calculates a global quantity. Note that per-atom
quantities cannot be averaged with this fix; their values can be
averaged by the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> or <A HREF = "fix_ave_atom.html">fix
ave/atom</A> commands.
<P>Each listed value is averaged independently. If written to a file,
then over time, one column of numbers is produced for each value. The
group specified with the command is ignored, since calculations are
performed by computes and fixes which store their own "group"
definition,
</P>
<P>Since the calculation is performed by the compute or fix which stores
its own "group" definition, the group specified as part of the fix
ave/time command is ignored.
<P>Each listed value can be the result of a <A HREF = "compute.html">compute</A> or
<A HREF = "fix.html">fix</A> or the evaluation of an equal-style
<A HREF = "variable.html">variable</A>. In each case, the compute, fix, or variable
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>For style <I>compute</I> the <I>ID</I> specifies a <A HREF = "compute.html">compute</A> which
calculates the desired property. The compute must be a "global"
compute that calculates one or more global properties rather than a
"per-atom" compute. However, 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 be accessed by fix ave/time.
</P>
<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><A HREF = "compute.html">Computes</A> that produce global quantities are those which
do not have the word <I>atom</I> in their style name. Only a few
<A HREF = "fix.html">fixes</A> produce global quantities. See the doc pages for
individual fixes for info on which ones produce such values.
<A HREF = "variable.html">Variables</A> of style <I>equal</I> are the only ones that can
be used with this fix. Variables of style <I>atom</I> cannot be used,
since they produce per-atom values.
</P>
<HR>
<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
average. The final averaged value(s) are computed every <I>Nfreq</I>
timesteps. The average is over <I>Nrepeat</I> values, computed in the
timesteps the values will be generated in order to contribute to the
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.
@ -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
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.
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>
<HR>
<P>Additional optional keywords also affect the operation of this fix.
</P>
<P>The <I>type</I> keyword chooses whether the scalar and/or vector quantities
produced by the compute or fix are used. For a setting of <I>scalar</I> a
single global value is used. For a setting of <I>vector</I> N global
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>The <I>file</I> keyword allows a filename to be specified. Each timestamp,
one quantity is written to the file for each value specified in the
fix ave/time command. The file is in a self-explanatory text format.
</P>
<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
@ -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
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>
command, or re-defining the fix by re-specifying it.
command, or by re-defining the fix by re-specifying it.
</P>
<P>If the <I>ave</I> setting is <I>window</I>, then the values produced on
timesteps that are multiples of <I>Nfreq</I> are summed and averaged within
@ -152,34 +180,35 @@ values if they are not available.
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
are relevant to this fix.
</P>
<P>Depending on the setting of the <I>type</I> parameter, this fix computes a
scalar and/or a vector of quantities which can be accessed by various
<A HREF = "Section_howto.html#4_15">output commands</A>. The values should only be
accessed on timesteps that are multiples of <I>Nfreq</I> since that is when
averaging is performed.
<P>This fix produces a global scalar or vector which can be accessed by
various <A HREF = "Section_howto.html#4_15">output commands</A>. A scalar is
produced if only a single quantity is averaged by this fix. If two or
more quantities are averaged, then a vector of values is produced.
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>No parameter of this fix can be used with the <I>start/stop</I> keywords of
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
minimization</A>.
</P>
<P><B>Restrictions:</B>
</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><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</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
ave/spatial</A>
<P><A HREF = "compute.html">compute</A>, <A HREF = "fix_ave_atom.html">fix ave/atom</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><B>Default:</B> none
</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>
</HTML>

View File

@ -10,78 +10,77 @@ fix ave/time command :h3
[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
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
Nfreq = timestep frequency at which the average value is computed :l
style = {compute} or {fix} :l
ID = ID of compute or fix that performs the calculation :l
Nfreq = timestep frequency at which averages are computed :l
one or more values can be listed :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
keyword = {type} or {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
keyword = {file} or {ave} :l
{file} arg = filename
filename = name of file to output time averages to
{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
window M = output average of M most recent Nfreq steps :pre
:ule
[Examples:]
fix 1 all ave/time 100 5 1000 compute myTemp
fix 1 all ave/time 100 5 1000 compute myTemp ave window 20
fix 1 all ave/time 1 100 1000 fix indenter value both file temp.indent :pre
fix 1 all ave/time 100 5 1000 myTemp thermo_temp file temp.profile
fix 1 all ave/time 100 5 1000 thermo_pressure[2] ave window 20
fix 1 all ave/time 1 100 1000 f_indent f_indent[1] file temp.indent :pre
[Description:]
Calculate one or more instantaneous quantities every few timesteps,
and average them over a longer timescale. The resulting averages can
be used by other "output commands"_Section_howto.html#4_15 such as
"thermo_style custom"_thermo_style.html, and also written to a file.
Calculate one or more instantaneous global quantities every few
timesteps, and average them over longer timescales. The resulting
averages can be used by other "output
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
calculates a global quantity such as a temperature or pressure or a
"fix"_fix.html which calculates a global quantity. Note that per-atom
quantities cannot be averaged with this fix; their values can be
averaged by the "fix ave/spatial"_fix_ave_spatial.html or "fix
ave/atom"_fix_ave_atom.html commands.
Each listed value is averaged independently. If written to a file,
then over time, one column of numbers is produced for each value. The
group specified with the command is ignored, since calculations are
performed by computes and fixes which store their own "group"
definition,
Since the calculation is performed by the compute or fix which stores
its own "group" definition, the group specified as part of the fix
ave/time command is ignored.
Each listed value can be the result of a "compute"_compute.html or
"fix"_fix.html or the evaluation of an equal-style
"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
calculates the desired property. The compute must be a "global"
compute that calculates one or more global properties rather than a
"per-atom" compute. However, there is a "compute
sum"_compute_sum.html command which sums per-atom quantities into a
global scalar or vector which can be accessed by fix ave/time.
"Computes"_compute.html that produce global quantities are those which
do not have the word {atom} in their style name. Only a few
"fixes"_fix.html produce global quantities. See the doc pages for
individual fixes for info on which ones produce such values.
"Variables"_variable.html of style {equal} are the only ones that can
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
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.
:line
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
timesteps the property will be evaluated in order to contribute to the
average. The final averaged value(s) are computed every {Nfreq}
timesteps. The average is over {Nrepeat} values, computed in the
timesteps the values will be generated in order to contribute to the
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.
@ -89,23 +88,51 @@ 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.
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
Additional optional keywords also affect the operation of this fix.
The {type} keyword chooses whether the scalar and/or vector quantities
produced by the compute or fix are used. For a setting of {scalar} a
single global value is used. For a setting of {vector} N global
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 {file} keyword allows a filename to be specified. Each timestamp,
one quantity is written to the file for each value specified in the
fix ave/time command. The file is in a self-explanatory text format.
The {ave} keyword determines how the scalar and/or vector values
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
values. This running average begins when the fix is defined; it can
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
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
are relevant to this fix.
Depending on the setting of the {type} parameter, this fix computes a
scalar and/or a vector of quantities which can be accessed by various
"output commands"_Section_howto.html#4_15. The values should only be
accessed on timesteps that are multiples of {Nfreq} since that is when
averaging is performed.
This fix produces a global scalar or vector which can be accessed by
various "output commands"_Section_howto.html#4_15. A scalar is
produced if only a single quantity is averaged by this fix. If two or
more quantities are averaged, then a vector of values is produced.
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
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
[Restrictions:]
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.
[Restrictions:] none
[Related commands:]
"compute"_compute.html, "fix ave/atom"_fix_ave_atom.html, "fix
ave/spatial"_fix_ave_spatial.html
"compute"_compute.html, "fix ave/atom"_fix_ave_atom.html,
"variable"_variable.html, "fix ave/spatial"_fix_ave_spatial.html, "fix
ave/atom"_fix_ave_atom.html
[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>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
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>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

View File

@ -45,7 +45,9 @@ are relevant to this fix.
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
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
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.
The cummulative simulation time (in time units) is stored as the first
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>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

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 cummulative simulation time (in time units) is stored as the first
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
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>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
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>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>

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
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
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>compute fix-ID_press group-ID pressure fix-ID_temp
</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
IDs of the new computes are the fix-ID with underscore + "temp" or
"press" appended and the group for the new computes is the same as the
fix group.
IDs of the new computes are the fix-ID with </A> or </A>
appended and the group for the new computes is the same as the fix
group.
</P>
<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>
@ -171,7 +171,9 @@ output</A>.
</P>
<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
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>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

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
pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or
"press" appended and the group for the new computes is the same as the
fix group.
IDs of the new computes are the fix-ID with "_temp" or "_press"
appended and the group for the new computes is the same as the fix
group.
Note that these are NOT the computes used by thermodynamic output (see
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
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
{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
compute fix-ID_press group-ID pressure fix-ID_temp
</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
IDs of the new computes are the fix-ID with underscore + "temp" or
"press" appended and the group for the new computes is the same as the
fix group.
IDs of the new computes are the fix-ID with </A> or </A>
appended and the group for the new computes is the same as the fix
group.
</P>
<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>
@ -175,7 +175,9 @@ barostatting to the system's potential energy as part of
</P>
<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
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>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>

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
pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or
"press" appended and the group for the new computes is the same as the
fix group.
IDs of the new computes are the fix-ID with "_temp" or "_press"
appended and the group for the new computes is the same as the fix
group.
Note that these are NOT the computes used by thermodynamic output (see
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
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
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
compute fix-ID_press group-ID pressure fix-ID_temp
</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
IDs of the new computes are the fix-ID with underscore + "temp" or
"press" appended and the group for the new computes is the same as the
fix group.
IDs of the new computes are the fix-ID with </A> or </A>
appended and the group for the new computes is the same as the fix
group.
</P>
<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>

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
pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID with underscore + "temp" or
"press" appended and the group for the new computes is the same as the
fix group.
IDs of the new computes are the fix-ID with "_temp" or "_press"
appended and the group for the new computes is the same as the fix
group.
Note that these are NOT the computes used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}

View File

@ -66,10 +66,9 @@ issued:
</P>
<PRE>compute fix-ID_temp group-ID temp
</PRE>
<P>See the <A HREF = "compute_temp.html">compute temp</A> command for 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 same as the fix
group.
<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 </A> appended and
the group for the new compute is the same as the fix group.
</P>
<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>.
@ -101,7 +100,9 @@ output</A>.
</P>
<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
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>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

View File

@ -58,9 +58,8 @@ issued:
compute fix-ID_temp group-ID temp :pre
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"
appended and the group for the new compute is the same as the fix
group.
that the ID of the new compute is the fix-ID with "_temp" appended and
the group for the new compute is the same as the fix group.
Note that this is NOT the compute used by thermodynamic output (see
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
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
{start} and {stop} keywords of the "run"_run.html command. See the

View File

@ -67,10 +67,10 @@ had been issued:
</P>
<PRE>compute fix-ID_temp group-ID temp/asphere
</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
underscore + "temp" appended and the group for the new compute is
the same as the fix group.
</A> appended and the group for the new compute is the same as the
fix group.
</P>
<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>.

View File

@ -60,8 +60,8 @@ compute fix-ID_temp group-ID temp/asphere :pre
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
underscore + "temp" appended and the group for the new compute is
the same as the fix group.
"_temp" appended and the group for the new compute is the same as the
fix group.
Note that this is NOT the compute used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.

View File

@ -93,10 +93,10 @@ been issued:
</P>
<PRE>compute fix-ID_temp group-ID temp/deform
</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
underscore + "temp" appended and the group for the new compute is the
same as the fix group.
</A> appended and the group for the new compute is the same as the
fix group.
</P>
<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>.

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
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
same as the fix group.
"_temp" appended and the group for the new compute is the same as the
fix group.
Note that this is NOT the compute used by thermodynamic output (see
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>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
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>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

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
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
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
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
insure they are not evaluated when the input script is read, but will
instead be evaluated when the string is printed.
insure they are not evaluated when the input script line is read, but
will instead be evaluated each time the string is printed.
</P>
<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
print command, since they are evaluated afresh each timestep that the
fix print line is output. Equal-style variables can calculate
formulas involving mathematical operations, atom properties, group
properties, thermodyanimc properties, global values calculated by a
fix print line is output. Equal-style variables calculate formulas
involving mathematical operations, atom properties, group properties,
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 = "variable.html">variables</A>.
</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
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
insure they are not evaluated when the input script is read, but will
instead be evaluated when the string is printed.
insure they are not evaluated when the input script line is read, but
will instead be evaluated each time the string is printed.
See the "variable"_variable.html command for a description of {equal}
style variables which are the most useful ones to use with the fix
print command, since they are evaluated afresh each timestep that the
fix print line is output. Equal-style variables can calculate
formulas involving mathematical operations, atom properties, group
properties, thermodyanimc properties, global values calculated by a
fix print line is output. Equal-style variables calculate formulas
involving mathematical operations, atom properties, group properties,
thermodyanimc properties, global values calculated by a
"compute"_compute.html or "fix"_fix.html, or references to other
"variables"_variable.html.
@ -71,4 +71,3 @@ This fix is not invoked during "energy minimization"_minimize.html.
[Default:]
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
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
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>No parameter of this fix can be used with the <I>start/stop</I> keywords of
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
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
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
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
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
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>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

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
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
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
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
were specified with the fix. See the <A HREF = "compute_temp.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
that the ID of the new compute is the fix-ID with underscore + "temp"
appended and the group for the new compute is the same as the fix
group.
that the ID of the new compute is the fix-ID with </A> appended and
the group for the new compute is the same as the fix group.
</P>
<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>.
@ -115,7 +114,9 @@ unless M is a multiple of N, the energy contribution will be zero.
</P>
<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
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>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

View File

@ -76,9 +76,8 @@ were specified with the fix. See the "compute
temp"_compute_temp.html, "compute
temp/region"_compute_temp_region.html, and "compute
temp/partial"_compute_temp_partial.html commands for 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 same as the fix
group.
that the ID of the new compute is the fix-ID with "_temp" appended and
the group for the new compute is the same as the fix group.
Note that this is NOT the compute used by thermodynamic output (see
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
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 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
quantity are momentum = mass*velocity. This quantity can be accessed
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>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

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
quantity are momentum = mass*velocity. This quantity can be accessed
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
the "run"_run.html command. This fix is not invoked during "energy

View File

@ -56,7 +56,9 @@ output</A>.
</P>
<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
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>No parameter of this fix can be used with the <I>start/stop</I> keywords of
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
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
the "run"_run.html command.

View File

@ -57,7 +57,9 @@ output</A>.
</P>
<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
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>No parameter of this fix can be used with the <I>start/stop</I> keywords of
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
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
the "run"_run.html command.

View File

@ -15,7 +15,7 @@
</P>
<PRE>print string
</PRE>
<UL><LI>string = text string to print with optional variable names
<UL><LI>string = text string to print. may contain variables
</UL>
<P><B>Examples:</B>
</P>
@ -31,11 +31,12 @@ will be evaluated and their current values printed.
</P>
<P>If you want the print command to be executed multiple times (with
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
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
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>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

View File

@ -12,7 +12,7 @@ print command :h3
print string :pre
string = text string to print with optional variable names :ul
string = text string to print. may contain variables :ul
[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
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
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
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}
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>post</I> value = <I>no</I> or <I>yes</I>
<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
NULL means no command will be invoked
</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
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.
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>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
<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
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.
</P>
<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
to "no" for the 1st run LAMMPS performs, then it is overridden, since
the initial setup computations must be done.
only a one-line summary timing is printed.
</P>
<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
@ -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 <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 useful for invoking a command you write that wraps some other
code (e.g. as a library) to perform a computation periodically during
a long LAMMPS run. See <A HREF = "Section_modify.html">this section</A> of the
documentation for info about how to add new commands to LAMMPS. See
<A HREF = "Section_howto.html#4_10">this section</A> of the documentation for ideas
about how to couple LAMMPS to other codes.
could be useful for invoking a command you have added to LAMMPS that
wraps some other code (e.g. as a library) to perform a computation
periodically during a long LAMMPS run. See <A HREF = "Section_modify.html">this
section</A> of the documentation for info about how
to add new commands to LAMMPS. See <A HREF = "Section_howto.html#4_10">this
section</A> of the documentation for ideas about
how to couple LAMMPS to other codes.
</P>
<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
@ -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
each time the command is invoked.
</P>
<P>IMPORTANT NOTE: For the <I>every</I> option, all remaining arguments after
the M value are considerd part of the LAMMPS command (e.g. print
"Protein Rg = $r" as in the example above). This means that, if
specified, the <I>every</I> option must be the last keyword used. The
command should be listed exactly as it would appear if it were on a
line by itself in the input script.
<P>IMPORTANT NOTE: For the <I>every</I> option, the command should be listed
exactly as it would be if it appeared on a line by itself. Thus all
remaining arguments after the M value are considerd part of the LAMMPS
command (e.g. print "Protein Rg = $r" as in the example above). This
means that, if specified, the <I>every</I> option must be the last keyword
used.
</P>
<P>If the <I>pre</I> and <I>post</I> options are set to "no" when <I>every</I> is used,
then the 1st run will do the full setup and the last run will print
the full timing summary, but these operations will be skipped for
intermediate runs.
<P>If the <I>pre</I> and <I>post</I> options are set to "no" when used with the
<I>every</I> keyword, then the 1st run will do the full setup and the last
run will print the full timing summary, but these operations will be
skipped for intermediate runs.
</P>
<P><B>Restrictions:</B> none
</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}
{post} value = {no} or {yes}
{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
NULL means no command will be invoked :pre
: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
still valid as are the forces. So if {pre} is specified as "no" then
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
(e.g. adds a "fix"_fix.html or "dump"_dump.html or
"compute"_compute.html or changes a "neighbor"_neigh_modify.html list
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.
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
to "no" for the 1st run LAMMPS performs, then it is overridden, since
the initial setup computations must be done.
only a one-line summary timing is printed.
The {every} option provides a means of breaking a LAMMPS run into a
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 "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 useful for invoking a command you write that wraps some other
code (e.g. as a library) to perform a computation periodically during
a long LAMMPS run. See "this section"_Section_modify.html of the
documentation for info about how to add new commands to LAMMPS. See
"this section"_Section_howto.html#4_10 of the documentation for ideas
about how to couple LAMMPS to other codes.
could be useful for invoking a command you have added to LAMMPS that
wraps some other code (e.g. as a library) to perform a computation
periodically during a long LAMMPS run. See "this
section"_Section_modify.html of the documentation for info about how
to add new commands to LAMMPS. See "this
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
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
each time the command is invoked.
IMPORTANT NOTE: For the {every} option, all remaining arguments after
the M value are considerd part of the LAMMPS command (e.g. print
"Protein Rg = $r" as in the example above). This means that, if
specified, the {every} option must be the last keyword used. The
command should be listed exactly as it would appear if it were on a
line by itself in the input script.
IMPORTANT NOTE: For the {every} option, the command should be listed
exactly as it would be if it appeared on a line by itself. Thus all
remaining arguments after the M value are considerd part of the LAMMPS
command (e.g. print "Protein Rg = $r" as in the example above). This
means that, if specified, the {every} option must be the last keyword
used.
If the {pre} and {post} options are set to "no" when {every} is used,
then the 1st run will do the full setup and the last run will print
the full timing summary, but these operations will be skipped for
intermediate runs.
If the {pre} and {post} options are set to "no" when used with the
{every} keyword, then the 1st run will do the full setup and the last
run will print the full timing summary, but these operations will be
skipped for intermediate runs.
[Restrictions:] none

View File

@ -56,11 +56,11 @@
pxx,pyy,pzz,pxy,pxz,pyz = 6 components of pressure tensor
drot = rotational energy of dipolar atoms
grot = rotational energy of granular atoms
c_ID = scalar quantity calculated by a compute identified by its ID
c_ID[N] = Nth vector quantity calculated by a compute identified by its ID
f_ID = scalar quantity calculated by a fix identified by its ID
f_ID[N] = Nth vector quantity calculated by a fix identified by its ID
v_name = current value of a variable identified by the variable name
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>
</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
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
<A HREF = "variable.html"">variables</A> that have been defined elsewhere in the
input script or can even be new styles which users have added to
LAMMPS (see the <A HREF = "Section_modify.html">Section_modify</A> section of the
documentation). Thus the <I>custom</I> style provides a flexible means of
outputting essentially any desired quantity as a simulation proceeds.
equal-style <A HREF = "variable.html"">variables</A> that have been defined
elsewhere in the input script or can even be new styles which users
have added to LAMMPS (see the <A HREF = "Section_modify.html">Section_modify</A>
section of the documentation). Thus the <I>custom</I> style provides a
flexible means of outputting essentially any desired quantity as a
simulation proceeds.
</P>
<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.
@ -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
<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
thermodynamic data; per-atom quantities calcalated by a compute are
output by the <A HREF = "dump.html">dump custom</A> command. However, 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 be output by thermo_style
custom.
thermodynamic data; per-atom quantities calcalated by a compute can be
output by the <A HREF = "dump.html">dump custom</A> command. 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 be output by thermo_style custom.
</P>
<P>Note that some computes calculate "intensive" global quantities like
temperature; others calculate "extensive" global quantities like
kinetic energy that are summed over all atoms in the compute group.
Intensive quantities are printed directly by thermo_style custom.
Extensive quantites may be normalized by the total number of atoms in
the simulation (NOT the number of atoms in the compute group)
depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A> option being
used.
Intensive quantities are printed directly as is by thermo_style
custom. Extensive quantites may be normalized when output by the
total number of atoms in the simulation (NOT the number of atoms in
the compute group) depending on the <A HREF = "thermo_modify.html">thermo_modify
norm</A> option being used.
</P>
<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
calculate a vector quantity and N must be an index from 1 to M where M
is the length of the vector calculated by the compute. See the doc
pages for individual compute styles for info on what these quantities
are.
the compute is printed. If <I>c_ID[N]</I> is used, then N must be an
index from 1-M where M is the length of the vector calculated by the
compute. See the doc pages for individual compute styles for info on
what these quantities are.
</P>
<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
@ -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
ave/time</A> command, which calculates time-averages of
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>Note that some fixes calculate "intensive" global quantities like
timestep size; others calculate "extensive" global quantities like
energy that are summed over all atoms in the fix group. Intensive
quantities are printed directly by thermo_style custom. Extensive
quantites may be normalized by the total number of atoms in the
simulation (NOT the number of atoms in the fix group) depending on the
<A HREF = "thermo_modify.html">thermo_modify norm</A> option being used.
quantities are printed directly as is by thermo_style custom.
Extensive quantites may be normalized when output by the total number
of atoms in the simulation (NOT the number of atoms in the fix group)
depending on the <A HREF = "thermo_modify.html">thermo_modify norm</A> option being
used.
</P>
<P>If <I>f_ID</I> is used as a keyword, then the scalar quantity calculated by
the fix is printed. If <I>f_ID[N]</I> is used, then the fix must
calculate a vector quantity and N must be an index from 1 to M where M
is the length of the vector calculated by the fix. See the doc pages
for individual fix styles for info on which fixes calculate these
global quantities and what they are. For fixes that compute a
contribution to the potential energy of the system, the scalar
quantity f_ID is typically that quantity.
the fix is printed. If <I>f_ID[N]</I> is used, then N must be an index
from 1-M where M is the length of the vector calculated by the fix.
See the doc pages for individual fix styles for info on which fixes
calculate these global quantities and what they are. For fixes that
compute a contribution to the potential energy of the system, the
scalar quantity referenced by f_ID is typically that quantity.
</P>
<P>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.
See the <A HREF = "variable.html">variable</A> command for details. Equal-style
variables can calculate complex formulas involving atom and group
properties, mathematical operations, other variables, etc. This
keyword enables them to be evaluated and their value printed
periodically during a simulation.
Only equal-style variables can be referenced. See the
<A HREF = "variable.html">variable</A> command for details. Variables of style
<I>equal</I> can reference individual atom properties or thermodynamic
keywords, or they can invoke other computes, fixes, or variables when
evaluated, so this is a very general means of creating thermodynamic
output.
</P>
<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
calculate quantities that could then be output with these keywords as
part of thermodyanmic information.
new compute and fix styles to LAMMPS to calculate quantities that
could then be output with these keywords as part of thermodyanmic
information.
</P>
<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
drot = rotational energy of dipolar atoms
grot = rotational energy of granular atoms
c_ID = scalar quantity calculated by a compute identified by its ID
c_ID\[N\] = Nth vector quantity calculated by a compute identified by its ID
f_ID = scalar quantity calculated by a fix identified by its ID
f_ID\[N\] = Nth vector quantity calculated by a fix identified by its ID
v_name = current value of a variable identified by the variable 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
:ule
[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
thermodynamic timestep. Note that the keywords c_ID, f_ID, v_name are
references to "computes"_compute.html, "fixes"_fix.html, and
"variables"_variable.html" that have been defined elsewhere in the
input script or can even be new styles which users have added to
LAMMPS (see the "Section_modify"_Section_modify.html section of the
documentation). Thus the {custom} style provides a flexible means of
outputting essentially any desired quantity as a simulation proceeds.
equal-style "variables"_variable.html" that have been defined
elsewhere in the input script or can even be new styles which users
have added to LAMMPS (see the "Section_modify"_Section_modify.html
section of the documentation). Thus the {custom} style provides a
flexible means of outputting essentially any desired quantity as a
simulation proceeds.
All styles except {custom} have {vol} appended to their list of
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
"compute"_compute.html command for details. Note that only global
scalar or vector quantities calculated by a compute can be output as
thermodynamic data; per-atom quantities calcalated by a compute are
output by the "dump custom"_dump.html command. However, there is a
"compute sum"_compute_sum.html command which sums per-atom quantities
into a global scalar or vector which can be output by thermo_style
custom.
thermodynamic data; per-atom quantities calcalated by a compute can be
output by the "dump custom"_dump.html command. There is a "compute
sum"_compute_sum.html command which sums per-atom quantities into a
global scalar or vector which can be output by thermo_style custom.
Note that some computes calculate "intensive" global quantities like
temperature; others calculate "extensive" global quantities like
kinetic energy that are summed over all atoms in the compute group.
Intensive quantities are printed directly by thermo_style custom.
Extensive quantites may be normalized by the total number of atoms in
the simulation (NOT the number of atoms in the compute group)
depending on the "thermo_modify norm"_thermo_modify.html option being
used.
Intensive quantities are printed directly as is by thermo_style
custom. Extensive quantites may be normalized when output by the
total number of atoms in the simulation (NOT the number of atoms in
the compute group) depending on the "thermo_modify
norm"_thermo_modify.html option being used.
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
calculate a vector quantity and N must be an index from 1 to M where M
is the length of the vector calculated by the compute. See the doc
pages for individual compute styles for info on what these quantities
are.
the compute is printed. If {c_ID\[N\]} is used, then N must be an
index from 1-M where M is the length of the vector calculated by the
compute. See the doc pages for individual compute styles for info on
what these quantities are.
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
@ -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
ave/time"_fix_ave_time.html command, which calculates time-averages of
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
timestep size; others calculate "extensive" global quantities like
energy that are summed over all atoms in the fix group. Intensive
quantities are printed directly by thermo_style custom. Extensive
quantites may be normalized by the total number of atoms in the
simulation (NOT the number of atoms in the fix group) depending on the
"thermo_modify norm"_thermo_modify.html option being used.
quantities are printed directly as is by thermo_style custom.
Extensive quantites may be normalized when output by the total number
of atoms in the simulation (NOT the number of atoms in the fix group)
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
the fix is printed. If {f_ID\[N\]} is used, then the fix must
calculate a vector quantity and N must be an index from 1 to M where M
is the length of the vector calculated by the fix. See the doc pages
for individual fix styles for info on which fixes calculate these
global quantities and what they are. For fixes that compute a
contribution to the potential energy of the system, the scalar
quantity f_ID is typically that quantity.
the fix is printed. If {f_ID\[N\]} is used, then N must be an index
from 1-M where M is the length of the vector calculated by the fix.
See the doc pages for individual fix styles for info on which fixes
calculate these global quantities and what they are. For fixes that
compute a contribution to the potential energy of the system, the
scalar quantity referenced by f_ID is typically that quantity.
The {v_name} keyword allow the current value of a variable to be
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.
See the "variable"_variable.html command for details. Equal-style
variables can calculate complex formulas involving atom and group
properties, mathematical operations, other variables, etc. This
keyword enables them to be evaluated and their value printed
periodically during a simulation.
Only equal-style variables can be referenced. See the
"variable"_variable.html command for details. Variables of style
{equal} can reference individual atom properties or thermodynamic
keywords, or they can invoke other computes, fixes, or variables when
evaluated, so this is a very general means of creating thermodynamic
output.
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
calculate quantities that could then be output with these keywords as
part of thermodyanmic information.
new compute and fix styles to LAMMPS to calculate quantities that
could then be output with these keywords as part of thermodyanmic
information.
:line

View File

@ -24,22 +24,19 @@
<I>world</I> args = one string for each partition of processors
<I>universe</I> args = one or more strings
<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
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),
neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
group functions = mass(group), charge(group),
math operations = (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group)
atom vectors for <I>equal</I> = mass[N], x[N], y[N], z[N],
vx[N], vy[N], vz[N],
fx[N], fy[N], fz[N]
atom vectors for <I>atom</I> = mass[], x[], y[], z[],
vx[], vy[], vz[],
fx[], fy[], fz[]
compute references = c_ID[0], c_ID[N]
fix references = f_ID[0], f_ID[N]
atom value = mass[N], x[N], y[N], z[N],
vx[N], vy[N], vz[N], fx[N], fy[N], fz[N]
atom vector = mass[], x[], y[], z[],
vx[], vy[], vz[], fx[], fy[], fz[]
compute references = c_ID, c_ID[N]
fix references = f_ID, f_ID[N]
other variables = v_abc, v_x, etc
</PRE>
@ -48,37 +45,43 @@
</P>
<PRE>variable x index run1 run2 run3 run4 run5 run6 run7 run8
variable LoopVar loop $n
variable beta equal div(temp,3.0)
variable b1 equal add(x[234],mult(0.5,vol))
variable b equal div(xcm(mol1,x),2.0)
variable b equal c_myTemp[0]
variable b atom div(mult(x<B></B>,y<B></B>),vol)
variable beta equal temp/3.0
variable b1 equal "x[234] + 0.5*vol"
variable b equal xcm(mol1,x)/2.0
variable b equal c_myTemp
variable b atom x<B></B>*y<B></B>/vol
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 uloop 15
</PRE>
<P><B>Description:</B>
</P>
<P>This command assigns one or more strings to a variable name.
Variables can be used in several ways in LAMMPS. A variable can be
referenced elsewhere in an input script. For variable styles that
store multiple strings, the <A HREF = "next.html">next</A> command can be used to
increment which string is assigned to the variable. Variables can be
evaluated to produce a numeric value which can be output either
directly (see the <A HREF = "print.html">print</A>, <A HREF = "fix_print.html">fix print</A>, and
<A HREF = "run.html">run every</A> commands) or as part of thermodynamic output (see
the <A HREF = "thermo_style.html">thermo_style</A> command), fix output (see the
<A HREF = "fix_ave_spatial.html">fix ave/spatial</A> and <A HREF = "compute_variable_atom.html">compute
variable/atom</A> commands), or dump output
(see the <A HREF = "dump.html">dump custom</A> and <A HREF = "compute_variable_atom.html">compute
variable/atom</A> commands).
<P>This command assigns one or more strings to a variable name for
evaluation later in the input script or during a simulation.
</P>
<P>Variables can be used in several ways in LAMMPS. A variable can be
referenced elsewhere in an input script to become part of a new input
command. For variable styles that store multiple strings, the
<A HREF = "next.html">next</A> command can be used to increment which string is
assigned to the variable. Variables of style <I>equal</I> can be evaluated
to produce a single numeric value which can be output either directly
(see the <A HREF = "print.html">print</A>, <A HREF = "fix_print.html">fix print</A>, and <A HREF = "run.html">run
every</A> commands) or as part of thermodynamic output (see the
<A HREF = "thermo_style.html">thermo_style</A> command), or used as input to an
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>In the discussion that follows, the "name" of the variable is the
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"
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
3rd example. The "value" is the numeric quantity resulting from
variables as in the 2nd example, or it can be a formula as in the 3rd
example. The "value" is the numeric quantity resulting from
evaluation of the string. Note that the same string can generate
different values when it is evaluated at different times during a
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 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
means that using a command-line switch -var will override a
corresponding variable setting in the input script.
means that using the <A HREF = "Section_start.html#2_6">command-line switch</A> -var
will override a corresponding variable setting in the input script.
</P>
<P>There are two exceptions to this rule. First, variables of style
<I>equal</I> ARE redefined each time the command is encountered. This
allow them to be reset, e.g. in a loop. This means an <I>equal</I>-style
variable will re-define a command-line swich -var setting, so use an
<I>index</I>-style variable for these settings instead, as in bench/in.lj.
<I>equal</I> and <I>atom</I> ARE redefined each time the command is encountered.
This allows them to be reset, when their formulas contain a
substitution for another variable, e.g. $x. This can be useful in a
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>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
@ -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>,
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
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
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>
<HR>
@ -175,12 +180,13 @@ script.
<HR>
<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
variable is used. For <I>equal</I> style variables this equation computes
a scalar quantity, which becomes the value of the variable whenever it
is evaluated. For <I>atom</I> style variables it computes a quantity for
each atom, which is used by the "compute variable/atom" command and
its associated output.
represents a formula that will be evaluated afresh each time the
variable is used. If you want spaces in the string, enclose it in
double quotes so the parser will treat it as a single argument. For
<I>equal</I> style variables the formula computes a scalar quantity, which
becomes the value of the variable whenever it is evaluated. For
<I>atom</I> style variables the formula computes one quantity for each
atom whenever it is evaluated.
</P>
<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
@ -191,121 +197,159 @@ timestep it was invoked.
<P>The next command cannot be used with <I>equal</I> or <I>atom</I> style
variables, since there is only one string.
</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
multiple quantities can be nested and combined in various ways to
build up formulas of arbitrary complexity. For example, this is a
valid (though strange) variable equation:
valid (though strange) variable formula:
</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>
<P>Specifically, an equation can contain numbers, thermo keywords, math
functions, group functions, atom vectors, compute references, and
other variables. There is one difference between <I>equal</I> and <I>atom</I>
variables; the syntax of Atom vector references is different.
<P>Specifically, an formula can contain numbers, thermo keywords, math
operations, group functions, atom values, atom vectors, compute
references, fix references, and references to other variables.
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<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 >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 >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 >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 vectors for <I>atom</I></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 >Fix references</TD><TD > f_ID[0], f_ID[N]</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 > 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 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</TD><TD > mass[], x[], y[], z[], vx[], vy[], vz[], fx[], fy[], fz[]</TD></TR>
<TR><TD >Compute references</TD><TD > c_ID, c_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
</TD></TR></TABLE></DIV>
<P>The thermo keywords allowed in the equation are those defined by the
"thermo_style custom" command. Note that many thermodyanmic
quantities are only computable after the first simulation has begun.
Likewise, many thermodynamic quantities (such as energies) are only
computed on timesteps when thermodyanmic output is being performed.
If the variable equation these quantities at other times, out-of-date
or invalid values may be used.
<P>Note that the formula for equal-style variables cannot use any formula
element that produces per-atom values, namely atom vectors, a compute
that produces per-atom values, a fix that produces per-atoms values,
or an atom-style variable. The formula for atom-style variables can
use these quantities, as well as quantities that produce a global
scalar or vector, e.g. a compute or fix that produces global
quantities.
</P>
<P>Math functions take one or two arguments, each of which may be an
equation containing any of the quantities defined above. This allows
equations to be nested, as in the examples above.
<P>The thermo keywords allowed in a formula are those defined by the
"thermo_style custom" command. Since many thermodyanmic quantities
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>Group functions take one or two arguments. The first argument is the
group-ID. The <I>dim</I> argument is <I>x</I> or <I>y</I> or <I>z</I>. The <I>dir</I>
argument is <I>xmin</I>, <I>xmax</I>, <I>ymin</I>, <I>ymax</I>, <I>zmin</I>, or <I>zmax</I>. The
group functions mass() and charge() are the total mass and charge of
the group of atoms. 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 the formula.
<P>Math operations are written in the usual way, where the "x" and "y" in
the examples above can be another section of the formula. Operators
are evaluated left to right and have the usual precedence: unary minus
before exponentiation, exponentiation before multiplication and
division, and multiplication and division before addition and
subtraction. Parenthesis can be used to group one or more portions of
a formula and enforce a desired order of operations. Additional math
operations can be specified as keywords followed by a parenthesized
argument, e.g. sqrt(v_ke).
</P>
<P>For <I>equal</I> style variables, atom vectors take a single integer
argument from 1-N, which is the desired atom-ID, e.g. x[243]. For
<I>atom</I> style variables, atom vectors take no argument. Since <I>atom</I>
style variables compute one value per atom, a reference like x[]
means the x-coord of each atom will be used when evaluating the
variable.
<P>Group functions take one or two arguments in a specific format. The
first argument is the group-ID. The <I>dim</I> argument, if it exists, is
<I>x</I> or <I>y</I> or <I>z</I>. The <I>dir</I> argument, if it exists, is <I>xmin</I>,
<I>xmax</I>, <I>ymin</I>, <I>ymax</I>, <I>zmin</I>, or <I>zmax</I>. The group function count()
is the number of atoms in the group. The group functions mass() and
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>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
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
per-atom quantities calculated by a compute cannot be accessed this
way, but only global scalar or vector quantities. However, 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 be accessed by a variable.
See the <A HREF = "compute.html">compute</A> command for details. Any specific
compute will either generate global or per-atom values, so there
is no amiguity as to which is used.
</P>
<P>If <I>c_ID[0]</I> is used as a keyword, then the scalar quantity
calculated by the compute is used. If <I>c_ID[N]</I> is used, then one
component of the vector quantity calculated by the compute is used. N
should be an integer from 1-M, where M is the length of the vector
calculated by the compute.
<P>If <I>c_ID</I> is used as a keyword, then the scalar quantity calculated by
the compute is used (global or per-atom). If <I>c_ID[N]</I> is used,
then one component of the vector quantity calculated by the compute is
used (global or per-atom). N should be an integer from 1-M, where M
is the length of the vector calculated by the compute.
</P>
<P>Fix references access scalar or vector quantities calculated by a
<A HREF = "fix.html">fix</A>. See the doc pages for individual fixes to see which
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
<P>Fix references access global scalar or vector quantities or per-atom
scalar or vector quantities calculated by a <A HREF = "fix.html">fix</A>. The ID in
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
details. Note that per-atom quantities calculated by a fix cannot be
accessed this way, but only global scalar or vector quantities.
elsewhere in the input script. See the doc pages for individual fixes
to see which ones compute what kind of quantities. Any specific fix
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>If <I>f_ID[0]</I> is used as a keyword, then the scalar quantity
calculated by the fix is used. If <I>f_ID[N]</I> is used, then one
component of the vector quantity calculated by the fix is used. N
should be an integer from 1-M, where M is the length of the vector
calculated by the fix.
<P>If <I>f_ID</I> is used as a keyword, then the scalar quantity calculated by
the fix is used (global or per-atom). If <I>f_ID[N]</I> is used, then
one component of the vector quantity calculated by the fix is used
(global or per-atom). N should be an integer from 1-M, where M is the
length of the vector calculated by the fix.
</P>
<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
evaulated. Note that if you do something circular like this:
"v_" to the variable name. This will cause that variable to be
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>
<PRE>variable a equal v_b
variable b equal v_a
print $a
</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>Note that there is a subtle difference between using a variable in a
<I>equal</I> or <I>atom</I> style equation in the form $x versus v_x.
<P>Another way to reference a variable in a formula is using the $x form
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>In the former case, as with any other input script command, the
variable's value is substituted for immediately when the line is read
from the input script. Thus if the current simulation box volume was
1000.0, then these lines:
<P>Using a $x, the value of the include variable is substituted for
immediately when the line is read from the input script, just as it
would be in other input script command. This could be the desired
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>
<PRE>variable x equal vol
variable y equal mult($x,2)
variable y equal 2*$x
</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>By contrast, these lines:
</P>
<PRE>variable x equal vol
variable y equal mult(v_x,2)
variable y equal 2*v_x
</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>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
@ -315,13 +359,14 @@ the first case, but would change dynamically for the second case.
<P><B>Restrictions:</B>
</P>
<P>The use of atom vectors in <I>equal</I> style variables requires the atom
style to use a global mapping in order to look up the vector indices.
Only atom styles with molecular information create global maps unless
the <A HREF = "atom_modify.html">atom_modify map</A> command is used.
<P>The use of atom values in <I>equal</I> or <I>atom</I> style variables requires
the atom style to use a global mapping in order to look up the vector
indices. By default, only atom styles with molecular information
create global maps. The <A HREF = "atom_modify.html">atom_modify map</A> command
can override the default.
</P>
<P>All <I>universe</I>- and <I>uloop</I>-style variables must have the same number
of values.
<P>All <I>universe</I>- and <I>uloop</I>-style variables defined in an input script
must have the same number of values.
</P>
<P><B>Related commands:</B>
</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
{universe} args = one or more strings
{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
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),
neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
group functions = mass(group), charge(group),
math operations = (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group)
atom vectors for {equal} = mass\[N\], x\[N\], y\[N\], z\[N\],
vx\[N\], vy\[N\], vz\[N\],
fx\[N\], fy\[N\], fz\[N\]
atom vectors for {atom} = mass\[\], x\[\], y\[\], z\[\],
vx\[\], vy\[\], vz\[\],
fx\[\], fy\[\], fz\[\]
compute references = c_ID\[0\], c_ID\[N\]
fix references = f_ID\[0\], f_ID\[N\]
atom value = mass\[N\], x\[N\], y\[N\], z\[N\],
vx\[N\], vy\[N\], vz\[N\], fx\[N\], fy\[N\], fz\[N\]
atom vector = mass\[\], x\[\], y\[\], z\[\],
vx\[\], vy\[\], vz\[\], fx\[\], fy\[\], fz\[\]
compute references = c_ID, c_ID\[N\]
fix references = f_ID, f_ID\[N\]
other variables = v_abc, v_x, etc :pre
: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 LoopVar loop $n
variable beta equal div(temp,3.0)
variable b1 equal add(x\[234\],mult(0.5,vol))
variable b equal div(xcm(mol1,x),2.0)
variable b equal c_myTemp\[0\]
variable b atom div(mult(x[],y[]),vol)
variable beta equal temp/3.0
variable b1 equal "x\[234\] + 0.5*vol"
variable b equal xcm(mol1,x)/2.0
variable b equal c_myTemp
variable b atom x[]*y[]/vol
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 uloop 15 :pre
[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
referenced elsewhere in an input script. For variable styles that
store multiple strings, the "next"_next.html command can be used to
increment which string is assigned to the variable. Variables can be
evaluated to produce a numeric value which can be output either
directly (see the "print"_print.html, "fix print"_fix_print.html, and
"run every"_run.html commands) or as part of thermodynamic output (see
the "thermo_style"_thermo_style.html command), fix output (see the
"fix ave/spatial"_fix_ave_spatial.html and "compute
variable/atom"_compute_variable_atom.html commands), or dump output
(see the "dump custom"_dump.html and "compute
variable/atom"_compute_variable_atom.html commands).
referenced elsewhere in an input script to become part of a new input
command. For variable styles that store multiple strings, the
"next"_next.html command can be used to increment which string is
assigned to the variable. Variables of style {equal} can be evaluated
to produce a single numeric value which can be output either directly
(see the "print"_print.html, "fix print"_fix_print.html, and "run
every"_run.html commands) or as part of thermodynamic output (see the
"thermo_style"_thermo_style.html command), or used as input to an
averaging fix (see the "fix ave/time"_fix_ave/time command).
Variables of style {atom} can be evaluated to produce one numeric
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
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"
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
3rd example. The "value" is the numeric quantity resulting from
variables as in the 2nd example, or it can be a formula as in the 3rd
example. The "value" is the numeric quantity resulting from
evaluation of the string. Note that the same string can generate
different values when it is evaluated at different times during a
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 to be processed multiple times without resetting the variables;
see the "jump"_jump.html or "include"_include.html commands. It also
means that using a command-line switch -var will override a
corresponding variable setting in the input script.
means that using the "command-line switch"_Section_start.html#2_6 -var
will override a corresponding variable setting in the input script.
There are two exceptions to this rule. First, variables of style
{equal} ARE redefined each time the command is encountered. This
allow them to be reset, e.g. in a loop. This means an {equal}-style
variable will re-define a command-line swich -var setting, so use an
{index}-style variable for these settings instead, as in bench/in.lj.
{equal} and {atom} ARE redefined each time the command is encountered.
This allows them to be reset, when their formulas contain a
substitution for another variable, e.g. $x. This can be useful in a
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
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},
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
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
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
@ -169,12 +174,13 @@ script.
:line
For the {equal} and {atom} styles, a single string is specified which
represents an equation that will be evaluated afresh each time the
variable is used. For {equal} style variables this equation computes
a scalar quantity, which becomes the value of the variable whenever it
is evaluated. For {atom} style variables it computes a quantity for
each atom, which is used by the "compute variable/atom" command and
its associated output.
represents a formula that will be evaluated afresh each time the
variable is used. If you want spaces in the string, enclose it in
double quotes so the parser will treat it as a single argument. For
{equal} style variables the formula computes a scalar quantity, which
becomes the value of the variable whenever it is evaluated. For
{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
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
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
multiple quantities can be nested and combined in various ways to
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
functions, group functions, atom vectors, compute references, and
other variables. There is one difference between {equal} and {atom}
variables; the syntax of Atom vector references is different.
Specifically, an formula can contain numbers, thermo keywords, math
operations, group functions, atom values, atom vectors, compute
references, fix references, and references to other variables.
Number: 0.2, 1.0e20, -15.4, etc
Thermo keywords: vol, pe, ebond, etc
Math functions: add(x,y), sub(x,y), mult(x,y), div(x,y), \
neg(x), pow(x,y), exp(x), ln(x), sqrt(x)
Group functions: mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim) \
bound(ID,dir), gyration(ID)
Atom vectors for {equal}: mass\[N\], x\[N\], y\[N\], z\[N\], \
vx\[N\], vy\[N\], vz\[N\], \
fx\[N\], fy\[N\], fz\[N\]
Atom vectors for {atom}: mass\[\], x\[\], y\[\], z\[\], \
vx\[\], vy\[\], vz\[\], \
fx\[\], fy\[\], fz\[\]
Compute references: c_ID\[0\], c_ID\[N\]
Fix references: f_ID\[0\], f_ID\[N\]
Math operations: (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x)
Group functions: count(ID), mass(ID), charge(ID), xcm(ID,dim), \
vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID)
Atom values: mass\[N\], x\[N\], y\[N\], z\[N\], \
vx\[N\], vy\[N\], vz\[N\], fx\[N\], fy\[N\], fz\[N\]
Atom vectors: mass\[\], x\[\], y\[\], z\[\], \
vx\[\], vy\[\], vz\[\], fx\[\], fy\[\], fz\[\]
Compute references: c_ID, c_ID\[N\]
Fix references: f_ID, f_ID\[N\]
Other variables: v_abc, v_x, etc :tb(s=:)
The thermo keywords allowed in the equation are those defined by the
"thermo_style custom" command. Note that many thermodyanmic
quantities are only computable after the first simulation has begun.
Likewise, many thermodynamic quantities (such as energies) are only
computed on timesteps when thermodyanmic output is being performed.
If the variable equation these quantities at other times, out-of-date
or invalid values may be used.
Note that the formula for equal-style variables cannot use any formula
element that produces per-atom values, namely atom vectors, a compute
that produces per-atom values, a fix that produces per-atoms values,
or an atom-style variable. The formula for atom-style variables can
use these quantities, as well as quantities that produce a global
scalar or vector, e.g. a compute or fix that produces global
quantities.
Math functions take one or two arguments, each of which may be an
equation containing any of the quantities defined above. This allows
equations to be nested, as in the examples above.
The thermo keywords allowed in a formula are those defined by the
"thermo_style custom" command. Since many thermodyanmic quantities
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
group-ID. The {dim} argument is {x} or {y} or {z}. The {dir}
argument is {xmin}, {xmax}, {ymin}, {ymax}, {zmin}, or {zmax}. The
group functions mass() and charge() are the total mass and charge of
the group of atoms. 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 the formula.
Math operations are written in the usual way, where the "x" and "y" in
the examples above can be another section of the formula. Operators
are evaluated left to right and have the usual precedence: unary minus
before exponentiation, exponentiation before multiplication and
division, and multiplication and division before addition and
subtraction. Parenthesis can be used to group one or more portions of
a formula and enforce a desired order of operations. Additional math
operations can be specified as keywords followed by a parenthesized
argument, e.g. sqrt(v_ke).
For {equal} style variables, atom vectors take a single integer
argument from 1-N, which is the desired atom-ID, e.g. x\[243\]. For
{atom} style variables, atom vectors take no argument. Since {atom}
style variables compute one value per atom, a reference like x\[\]
means the x-coord of each atom will be used when evaluating the
variable.
Group functions take one or two arguments in a specific format. The
first argument is the group-ID. The {dim} argument, if it exists, is
{x} or {y} or {z}. The {dir} argument, if it exists, is {xmin},
{xmax}, {ymin}, {ymax}, {zmin}, or {zmax}. The group function count()
is the number of atoms in the group. The group functions mass() and
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
the actual ID of the compute defined elsewhere in the input script.
See the "compute"_compute.html command for details. Note that
per-atom quantities calculated by a compute cannot be accessed this
way, but only global scalar or vector quantities. However, there is a
"compute sum"_compute_sum.html command which sums per-atom quantities
into a global scalar or vector which can be accessed by a variable.
See the "compute"_compute.html command for details. Any specific
compute will either generate global or per-atom values, so there
is no amiguity as to which is used.
If {c_ID\[0\]} is used as a keyword, then the scalar quantity
calculated by the compute is used. If {c_ID\[N\]} is used, then one
component of the vector quantity calculated by the compute is used. N
should be an integer from 1-M, where M is the length of the vector
calculated by the compute.
If {c_ID} is used as a keyword, then the scalar quantity calculated by
the compute is used (global or per-atom). If {c_ID\[N\]} is used,
then one component of the vector quantity calculated by the compute is
used (global or per-atom). N should be an integer from 1-M, where M
is the length of the vector calculated by the compute.
Fix references access scalar or vector quantities calculated by a
"fix"_fix.html. See the doc pages for individual fixes to see which
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
Fix references access global scalar or vector quantities or per-atom
scalar or vector quantities calculated by a "fix"_fix.html. The ID in
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
details. Note that per-atom quantities calculated by a fix cannot be
accessed this way, but only global scalar or vector quantities.
elsewhere in the input script. See the doc pages for individual fixes
to see which ones compute what kind of quantities. Any specific fix
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
calculated by the fix is used. If {f_ID\[N\]} is used, then one
component of the vector quantity calculated by the fix is used. N
should be an integer from 1-M, where M is the length of the vector
calculated by the fix.
If {f_ID} is used as a keyword, then the scalar quantity calculated by
the fix is used (global or per-atom). If {f_ID\[N\]} is used, then
one component of the vector quantity calculated by the fix is used
(global or per-atom). N should be an integer from 1-M, where M is the
length of the vector calculated by the fix.
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
evaulated. Note that if you do something circular like this:
"v_" to the variable name. This will cause that variable to be
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 b equal v_a
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
{equal} or {atom} style equation in the form $x versus v_x.
Another way to reference a variable in a formula is using the $x form
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
variable's value is substituted for immediately when the line is read
from the input script. Thus if the current simulation box volume was
1000.0, then these lines:
Using a $x, the value of the include variable is substituted for
immediately when the line is read from the input script, just as it
would be in other input script command. This could be the desired
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 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:
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
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:]
The use of atom vectors in {equal} style variables requires the atom
style to use a global mapping in order to look up the vector indices.
Only atom styles with molecular information create global maps unless
the "atom_modify map"_atom_modify.html command is used.
The use of atom values in {equal} or {atom} style variables requires
the atom style to use a global mapping in order to look up the vector
indices. By default, only atom styles with molecular information
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
of values.
All {universe}- and {uloop}-style variables defined in an input script
must have the same number of values.
[Related commands:]