2010-10-19 02:33:18 +08:00
|
|
|
<HTML>
|
|
|
|
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
|
|
|
|
</CENTER>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H3>compute atom/molecule command
|
|
|
|
</H3>
|
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
|
|
|
<PRE>compute ID group-ID atom/molecule input1 input2 ...
|
|
|
|
</PRE>
|
|
|
|
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
|
|
|
|
|
|
|
|
<LI>atom/molecule = style name of this compute command
|
|
|
|
|
|
|
|
<LI>one or more inputs can be listed
|
|
|
|
|
|
|
|
<LI>input = c_ID, c_ID[N], f_ID, f_ID[N], v_name
|
|
|
|
|
|
|
|
<PRE> c_ID = per-atom vector calculated by a compute with ID
|
|
|
|
c_ID[I] = Ith column of per-atom array calculated by a compute with ID
|
|
|
|
f_ID = per-atom vector calculated by a fix with ID
|
|
|
|
f_ID[I] = Ith column of per-atom array calculated by a fix with ID
|
|
|
|
v_name = per-atom vector calculated by an atom-style variable with name
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
2010-10-19 04:01:49 +08:00
|
|
|
<PRE>compute 1 all atom/molecule c_ke c_pe
|
2014-02-06 02:09:51 +08:00
|
|
|
compute 1 top atom/molecule v_myFormula c_stress[3]
|
2010-10-19 03:56:48 +08:00
|
|
|
</PRE>
|
2010-10-19 02:33:18 +08:00
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
2010-10-19 03:56:48 +08:00
|
|
|
<P>Define a calculation that sums per-atom values on a per-molecule
|
|
|
|
basis, one per listed input. The inputs can <A HREF = "compute.html">computes</A>,
|
|
|
|
<A HREF = "fix.html">fixes</A>, or <A HREF = "variable.html">variables</A> that generate per-atom
|
|
|
|
quantities. Note that attributes stored by atoms, such as mass or
|
|
|
|
force, can also be summed on a per-molecule basis, by accessing these
|
|
|
|
quantities via the <A HREF = "compute_property_atom.html">compute property/atom</A>
|
|
|
|
command.
|
|
|
|
</P>
|
|
|
|
<P>Each listed input is operated on independently. Only atoms within the
|
|
|
|
specified group contribute to the per-molecule sum. Note that compute
|
|
|
|
or fix inputs define their own group which may affect the quantities
|
|
|
|
they return. For example, if a compute is used as an input which
|
|
|
|
generates a per-atom vector, it will generate values of 0.0 for atoms
|
|
|
|
that are not in the group specified for that compute.
|
|
|
|
</P>
|
2010-10-19 04:01:49 +08:00
|
|
|
<P>The ordering of per-molecule quantities produced by this compute is
|
2010-10-19 03:56:48 +08:00
|
|
|
consistent with the ordering produced by other compute commands that
|
2010-10-19 04:01:49 +08:00
|
|
|
generate per-molecule datums. Conceptually, them molecule IDs will be
|
|
|
|
in ascending order for any molecule with one or more of its atoms in
|
|
|
|
the specified group.
|
2010-10-19 03:56:48 +08:00
|
|
|
</P>
|
|
|
|
<P>If an input begins with "c_", a compute ID must follow which has been
|
|
|
|
previously defined in the input script and which generates per-atom
|
|
|
|
quantities. See the individual <A HREF = "compute.html">compute</A> doc page for
|
|
|
|
details. If no bracketed integer is appended, the vector calculated
|
2012-05-18 06:29:43 +08:00
|
|
|
by the compute is used. If a bracketed integer is appended, the Ith
|
2010-10-19 03:56:48 +08:00
|
|
|
column of the array calculated by the compute is used. Users can also
|
|
|
|
write code for their own compute styles and <A HREF = "Section_modify.html">add them to
|
|
|
|
LAMMPS</A>.
|
|
|
|
</P>
|
|
|
|
<P>If an input begins with "f_", a fix ID must follow which has been
|
|
|
|
previously defined in the input script and which generates per-atom
|
|
|
|
quantities. See the individual <A HREF = "fix.html">fix</A> doc page for details.
|
|
|
|
Note that some fixes only produce their values on certain timesteps,
|
|
|
|
which must be compatible with when compute atom/molecule references
|
|
|
|
the values, else an error results. If no bracketed integer is
|
|
|
|
appended, the vector calculated by the fix is used. If a bracketed
|
2010-10-19 02:33:18 +08:00
|
|
|
integer is appended, the Ith column of the array calculated by the fix
|
|
|
|
is used. Users can also write code for their own fix style and <A HREF = "Section_modify.html">add
|
|
|
|
them to LAMMPS</A>.
|
|
|
|
</P>
|
2010-10-19 03:56:48 +08:00
|
|
|
<P>If an input begins with "v_", a variable name must follow which has
|
2010-10-19 02:33:18 +08:00
|
|
|
been previously defined in the input script. It must be an
|
|
|
|
<A HREF = "variable.html">atom-style variable</A>. Atom-style variables can
|
|
|
|
reference thermodynamic keywords and various per-atom attributes, or
|
|
|
|
invoke other computes, fixes, or variables when they are evaluated, so
|
2010-10-19 03:56:48 +08:00
|
|
|
this is a very general means of generating per-atom quantities to sum
|
|
|
|
on a per-molecule basis.
|
2010-10-19 02:33:18 +08:00
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P><B>Output info:</B>
|
|
|
|
</P>
|
2010-10-19 03:56:48 +08:00
|
|
|
<P>This compute calculates a global vector or global array depending on
|
|
|
|
the number of input values. The length of the vector or number of
|
|
|
|
rows in the array is the number of molecules. If a single input is
|
|
|
|
specified, a global vector is produced. If two or more inputs are
|
|
|
|
specified, a global array is produced where the number of columns =
|
|
|
|
the number of inputs. The vector or array can be accessed by any
|
2011-08-26 01:01:01 +08:00
|
|
|
command that uses global values from a compute as input. See <A HREF = "Section_howto.html#howto_15">this
|
2010-10-19 03:56:48 +08:00
|
|
|
section</A> for an overview of LAMMPS output
|
|
|
|
options.
|
|
|
|
</P>
|
|
|
|
<P>All the vector or array values calculated by this compute are
|
|
|
|
"extensive".
|
|
|
|
</P>
|
|
|
|
<P>The vector or array values will be in whatever <A HREF = "units.html">units</A> the
|
|
|
|
input quantities are in.
|
2010-10-19 02:33:18 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Restrictions:</B> none
|
|
|
|
</P>
|
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
|
|
|
<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>
|
|
|
|
</HTML>
|