2007-02-10 05:40:32 +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 command
|
|
|
|
</H3>
|
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
|
|
|
<PRE>compute ID group-ID style args
|
|
|
|
</PRE>
|
|
|
|
<UL><LI>ID = user-assigned name for the computation
|
|
|
|
<LI>group-ID = ID of the group of atoms to perform the computation on
|
|
|
|
<LI>style = one of a list of possible style names (see below)
|
|
|
|
<LI>args = arguments used by a particular style
|
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
|
|
|
<PRE>compute 1 all temp
|
|
|
|
compute newtemp flow temp/partial 1 1 0
|
|
|
|
compute 3 all ke/atom
|
|
|
|
</PRE>
|
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
2009-12-10 05:20:59 +08:00
|
|
|
<P>Define a computation that will be performed on a group of atoms.
|
2008-01-03 03:25:15 +08:00
|
|
|
Quantities calculated by a compute are instantaneous values, meaning
|
|
|
|
they are calculated from information about atoms on the current
|
2009-12-10 05:20:59 +08:00
|
|
|
timestep or iteration, though a compute may internally store some
|
2009-12-11 01:10:35 +08:00
|
|
|
information about a previous state of the system. Defining a compute
|
|
|
|
does not perform a computation. Instead computes are invoked by other
|
|
|
|
LAMMPS commands as needed, e.g. to calculate a temperature needed for
|
|
|
|
a thermostat fix or to generate thermodynamic or dump file output.
|
|
|
|
See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
|
|
|
|
various LAMMPS output options, many of which involve computes.
|
2009-12-10 05:20:59 +08:00
|
|
|
</P>
|
|
|
|
<P>The ID of a compute can only contain alphanumeric characters and
|
|
|
|
underscores.
|
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>Computes calculate one of three styles of quantities: global,
|
|
|
|
per-atom, or local. A global quantity is one or more system-wide
|
|
|
|
values, e.g. the temperature of the system. A per-atom quantity is
|
|
|
|
one or more values per atom, e.g. the kinetic energy of each atom.
|
|
|
|
Per-atom values are set to 0.0 for atoms not in the specified compute
|
|
|
|
group. Local quantities are calculated by each processor based on the
|
|
|
|
atoms it owns, but there may be zero or more per atom, e.g. a list of
|
|
|
|
bond distances. Computes that produce per-atom quantities have the
|
|
|
|
word "atom" in their style, e.g. <I>ke/atom</I>. Computes that produce
|
|
|
|
local quantities have the word "local" in their style,
|
|
|
|
e.g. <I>bond/local</I>. Styles with neither "atom" or "local" in their
|
|
|
|
style produce global quantities.
|
|
|
|
</P>
|
|
|
|
<P>Note that a single compute produces either global or per-atom or local
|
|
|
|
quantities, but never more than one of these.
|
|
|
|
</P>
|
|
|
|
<P>Global, per-atom, and local quantities each come in three kinds: a
|
|
|
|
single scalar value, a vector of values, or a 2d array of values. The
|
|
|
|
doc page for each compute describes the style and kind of values it
|
|
|
|
produces, e.g. a per-atom vector. Some computes produce more than one
|
|
|
|
kind of a single style, e.g. a global scalar and a global vector.
|
|
|
|
</P>
|
|
|
|
<P>When a compute quantity is accessed, as in many of the output commands
|
|
|
|
discussed below, it can be referenced via the following bracket
|
|
|
|
notation, where ID is the ID of the compute:
|
|
|
|
</P>
|
|
|
|
<DIV ALIGN=center><TABLE BORDER=1 >
|
|
|
|
<TR><TD >c_ID </TD><TD > entire scalar, vector, or array</TD></TR>
|
|
|
|
<TR><TD >c_ID[I] </TD><TD > one element of vector, one column of array</TD></TR>
|
|
|
|
<TR><TD >c_ID[I][J] </TD><TD > one element of array
|
|
|
|
</TD></TR></TABLE></DIV>
|
|
|
|
|
|
|
|
<P>In other words, using one bracket reduces the dimension of the
|
|
|
|
quantity once (vector -> scalar, array -> vector). Using two brackets
|
|
|
|
reduces the dimension twice (array -> scalar). Thus a command that
|
|
|
|
uses scalar compute values as input can also process elements of a
|
|
|
|
vector or array.
|
|
|
|
</P>
|
|
|
|
<P>Note that commands and <A HREF = "variable.html">variables</A> which use compute
|
|
|
|
quantities typically do not allow for all kinds, e.g. a command may
|
|
|
|
require a vector of values, not a scalar. This means there is no
|
|
|
|
ambiguity about referring to a compute quantity as c_ID even if it
|
|
|
|
produces, for example, both a scalar and vector. The doc pages for
|
|
|
|
various commands explain the details.
|
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>In LAMMPS, the values generated by a compute can be used in several
|
|
|
|
ways:
|
|
|
|
</P>
|
|
|
|
<UL><LI>The results of computes that calculate a global temperature or
|
|
|
|
pressure can be used by fixes that do thermostatting or barostatting
|
|
|
|
or when atom velocities are created.
|
|
|
|
|
|
|
|
<LI>Global values can be output via the <A HREF = "thermo_style.html">thermo_style
|
2007-09-28 07:25:52 +08:00
|
|
|
custom</A> or <A HREF = "fix_ave_time.html">fix ave/time</A> command.
|
2008-01-03 03:25:15 +08:00
|
|
|
Or the values can be referenced in a <A HREF = "variable.html">variable equal</A> or
|
2009-12-10 05:20:59 +08:00
|
|
|
<A HREF = "variable.html">variable atom</A> command.
|
|
|
|
|
|
|
|
<LI>Per-atom values can be output via the <A HREF = "dump.html">dump custom</A> command
|
|
|
|
or the <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> command. Or they can be
|
|
|
|
time-averaged via the <A HREF = "fix_ave_atom.html">fix ave/atom</A> command or
|
|
|
|
reduced by the <A HREF = "compute_reduce.html">compute reduce</A> command. Or the
|
|
|
|
per-atom values can be referenced in an <A HREF = "variable.html">atom-style
|
|
|
|
variable</A>.
|
|
|
|
|
|
|
|
<LI>Local values can be reduced by the <A HREF = "compute_reduce.html">compute
|
|
|
|
reduce</A> command, or histogrammed by the <A HREF = "fix_ave_histo.html">fix
|
2009-12-18 01:28:42 +08:00
|
|
|
ave/histo</A> command, or output by the <A HREF = "dump.html">dump
|
|
|
|
local</A> command.
|
2009-12-10 05:20:59 +08:00
|
|
|
</UL>
|
2008-01-03 03:25:15 +08:00
|
|
|
<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
|
2010-03-03 05:51:16 +08:00
|
|
|
values by the number of atoms in the system, depending on the
|
|
|
|
"thermo_modify norm" setting. It will not normalize intensive values.
|
|
|
|
If a compute value is accessed in another way, e.g. by a
|
|
|
|
<A HREF = "variable.html">variable</A>, you may want to know whether it is an
|
2008-01-03 03:25:15 +08:00
|
|
|
intensive or extensive value. See the doc page for individual
|
|
|
|
computes for further info.
|
2007-10-10 02:24:42 +08:00
|
|
|
</P>
|
2009-12-10 05:20:59 +08:00
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>LAMMPS creates its own computes internally for thermodynamic output.
|
2007-11-02 00:46:50 +08:00
|
|
|
Three computes are always created, named "thermo_temp",
|
2008-01-18 07:46:30 +08:00
|
|
|
"thermo_press", and "thermo_pe", as if these commands had been invoked
|
|
|
|
in the input script:
|
2007-06-20 20:56:17 +08:00
|
|
|
</P>
|
|
|
|
<PRE>compute thermo_temp all temp
|
2008-01-18 07:46:30 +08:00
|
|
|
compute thermo_press all pressure thermo_temp
|
2007-11-02 00:46:50 +08:00
|
|
|
compute thermo_pe all pe
|
2007-06-20 20:56:17 +08:00
|
|
|
</PRE>
|
2008-01-03 03:25:15 +08:00
|
|
|
<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.
|
2007-06-20 20:56:17 +08:00
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<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.
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
2009-12-10 05:20:59 +08:00
|
|
|
<P>In all these cases, the default computes LAMMPS creates 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> and <A HREF = "fix_modify.html">fix
|
|
|
|
modify</A> commands.
|
2007-06-20 20:56:17 +08:00
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<P>Properties of either a default or user-defined compute can be modified
|
2007-06-20 20:56:17 +08:00
|
|
|
via the <A HREF = "compute_modify.html">compute_modify</A> command.
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
2007-06-20 20:56:17 +08:00
|
|
|
<P>Computes can be deleted with the <A HREF = "uncompute.html">uncompute</A> command.
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
2007-06-20 20:56:17 +08:00
|
|
|
<P>Code for new computes can be added to LAMMPS (see <A HREF = "Section_modify.html">this
|
2008-02-20 05:47:37 +08:00
|
|
|
section</A> of the manual) and the results of their
|
2007-06-20 20:56:17 +08:00
|
|
|
calculations accessed in the various ways described above.
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
2009-12-10 05:20:59 +08:00
|
|
|
<HR>
|
|
|
|
|
2007-02-10 05:40:32 +08:00
|
|
|
<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
|
2008-01-03 03:25:15 +08:00
|
|
|
available in LAMMPS:
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
2009-12-19 01:25:39 +08:00
|
|
|
<UL><LI><A HREF = "compute_bond_local.html">angle/local</A> - theta and energy of each angle
|
2010-10-19 01:42:05 +08:00
|
|
|
<LI><A HREF = "compute_atom_molecule.html">atom/molecule</A> - sum per-atom properties for each molecule
|
2009-12-19 01:25:39 +08:00
|
|
|
<LI><A HREF = "compute_bond_local.html">bond/local</A> - distance and energy of each bond
|
|
|
|
<LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom
|
2011-03-09 06:23:59 +08:00
|
|
|
<LI><A HREF = "compute_cluster_atom.html">cluster/atom</A> - cluster ID for each atom
|
2009-01-20 01:18:42 +08:00
|
|
|
<LI><A HREF = "compute_cna_atom.html">cna/atom</A> - common neighbor analysis (CNA) for each atom
|
2009-12-04 08:42:15 +08:00
|
|
|
<LI><A HREF = "compute_com.html">com</A> - center-of-mass of group of atoms
|
2009-12-22 01:27:08 +08:00
|
|
|
<LI><A HREF = "compute_com_molecule.html">com/molecule</A> - center-of-mass for each molecule
|
2007-06-20 21:09:50 +08:00
|
|
|
<LI><A HREF = "compute_coord_atom.html">coord/atom</A> - coordination number for each atom
|
2008-07-24 23:04:46 +08:00
|
|
|
<LI><A HREF = "compute_damage_atom.html">damage/atom</A> - Peridynamic damage for each atom
|
2009-12-19 05:24:44 +08:00
|
|
|
<LI><A HREF = "compute_dihedral_local.html">dihedral/local</A> - angle of each dihedral
|
2008-01-04 08:27:56 +08:00
|
|
|
<LI><A HREF = "compute_displace_atom.html">displace/atom</A> - displacement of each atom
|
2008-03-20 01:04:31 +08:00
|
|
|
<LI><A HREF = "compute_erotate_asphere.html">erotate/asphere</A> - rotational energy of aspherical particles
|
2008-03-18 08:23:39 +08:00
|
|
|
<LI><A HREF = "compute_erotate_sphere.html">erotate/sphere</A> - rotational energy of spherical particles
|
2009-10-30 06:41:53 +08:00
|
|
|
<LI><A HREF = "compute_event_displace.html">event/displace</A> - detect event on atom displacement
|
2008-02-15 07:24:11 +08:00
|
|
|
<LI><A HREF = "compute_group_group.html">group/group</A> - energy/force between two groups of atoms
|
2009-12-04 08:52:20 +08:00
|
|
|
<LI><A HREF = "compute_gyration.html">gyration</A> - radius of gyration of group of atoms
|
2009-12-22 01:27:08 +08:00
|
|
|
<LI><A HREF = "compute_gyration_molecule.html">gyration/molecule</A> - radius of gyration for each molecule
|
2009-07-03 00:38:31 +08:00
|
|
|
<LI><A HREF = "compute_heat_flux.html">heat/flux</A> - heat flux through a group of atoms
|
2009-12-19 05:24:44 +08:00
|
|
|
<LI><A HREF = "compute_improper_local.html">improper/local</A> - angle of each improper
|
2008-03-19 23:39:14 +08:00
|
|
|
<LI><A HREF = "compute_ke.html">ke</A> - translational kinetic energy
|
2007-02-10 05:40:32 +08:00
|
|
|
<LI><A HREF = "compute_ke_atom.html">ke/atom</A> - kinetic energy for each atom
|
2009-12-04 07:58:11 +08:00
|
|
|
<LI><A HREF = "compute_msd.html">msd</A> - mean-squared displacement of group of atoms
|
2009-12-22 01:27:08 +08:00
|
|
|
<LI><A HREF = "compute_msd_molecule.html">msd/molecule</A> - mean-squared displacement for each molecule
|
2010-10-19 01:17:06 +08:00
|
|
|
<LI><A HREF = "compute_pair.html">pair</A> - values computed by a pair style
|
2009-12-22 07:01:36 +08:00
|
|
|
<LI><A HREF = "compute_pair_local.html">pair/local</A> - distance/energy/force of each pairwise interaction
|
2007-11-02 00:46:50 +08:00
|
|
|
<LI><A HREF = "compute_pe.html">pe</A> - potential energy
|
2008-01-03 03:25:15 +08:00
|
|
|
<LI><A HREF = "compute_pe_atom.html">pe/atom</A> - potential energy for each atom
|
2007-02-10 05:40:32 +08:00
|
|
|
<LI><A HREF = "compute_pressure.html">pressure</A> - total pressure and pressure tensor
|
2009-12-17 01:27:23 +08:00
|
|
|
<LI><A HREF = "compute_property_atom.html">property/atom</A> - convert atom attributes to per-atom vectors/arrays
|
2009-12-18 01:28:42 +08:00
|
|
|
<LI><A HREF = "compute_property_local.html">property/local</A> - convert local attributes to localvectors/arrays
|
2009-12-22 05:43:10 +08:00
|
|
|
<LI><A HREF = "compute_property_molecule.html">property/molecule</A> - convert molecule attributes to localvectors/arrays
|
2009-12-17 04:27:03 +08:00
|
|
|
<LI><A HREF = "compute_rdf.html">rdf</A> - radial distribution function g(r) histogram of group of atoms
|
2008-02-20 23:00:04 +08:00
|
|
|
<LI><A HREF = "compute_reduce.html">reduce</A> - combine per-atom quantities into a single global value
|
2009-04-28 22:56:27 +08:00
|
|
|
<LI><A HREF = "compute_reduce.html">reduce/region</A> - same as compute reduce, within a region
|
2007-02-10 05:40:32 +08:00
|
|
|
<LI><A HREF = "compute_stress_atom.html">stress/atom</A> - stress tensor for each atom
|
|
|
|
<LI><A HREF = "compute_temp.html">temp</A> - temperature of group of atoms
|
2007-06-20 21:09:50 +08:00
|
|
|
<LI><A HREF = "compute_temp_asphere.html">temp/asphere</A> - temperature of aspherical particles
|
2008-03-12 00:37:01 +08:00
|
|
|
<LI><A HREF = "compute_temp_com.html">temp/com</A> - temperature after subtracting center-of-mass velocity
|
2007-06-20 21:09:50 +08:00
|
|
|
<LI><A HREF = "compute_temp_deform.html">temp/deform</A> - temperature excluding box deformation velocity
|
2007-02-10 05:40:32 +08:00
|
|
|
<LI><A HREF = "compute_temp_partial.html">temp/partial</A> - temperature excluding one or more dimensions of velocity
|
2009-04-30 00:54:14 +08:00
|
|
|
<LI><A HREF = "compute_temp_profile.html">temp/profile</A> - temperature excluding a binned velocity profile
|
2007-06-20 21:09:50 +08:00
|
|
|
<LI><A HREF = "compute_temp_ramp.html">temp/ramp</A> - temperature excluding ramped velocity component
|
2008-03-18 08:23:39 +08:00
|
|
|
<LI><A HREF = "compute_temp_region.html">temp/region</A> - temperature of a region of atoms
|
2010-10-23 05:24:33 +08:00
|
|
|
<LI><A HREF = "compute_temp_sphere.html">temp/sphere</A> - temperature of spherical particles
|
|
|
|
<LI><A HREF = "compute_ti.html">ti</A> - thermodyanmic integration free energy values
|
2007-02-10 05:40:32 +08:00
|
|
|
</UL>
|
2007-10-03 06:56:45 +08:00
|
|
|
<P>There are also additional compute styles submitted by users which are
|
|
|
|
included in the LAMMPS distribution. The list of these with links to
|
|
|
|
the individual styles are given in the compute section of <A HREF = "Section_commands.html#3_5">this
|
|
|
|
page</A>.
|
|
|
|
</P>
|
2007-02-10 05:40:32 +08:00
|
|
|
<P><B>Restrictions:</B> none
|
|
|
|
</P>
|
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
2007-10-27 04:42:35 +08:00
|
|
|
<P><A HREF = "uncompute.html">uncompute</A>, <A HREF = "compute_modify.html">compute_modify</A>, <A HREF = "fix_ave_atom.html">fix
|
|
|
|
ave/atom</A>, <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>,
|
2009-12-18 01:28:42 +08:00
|
|
|
<A HREF = "fix_ave_time.html">fix ave/time</A>, <A HREF = "fix_ave_histo.html">fix ave/histo</A>
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Default:</B> none
|
|
|
|
</P>
|
|
|
|
</HTML>
|