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>
|
|
|
|
<P>Create 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
|
|
|
|
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" can be used in several ways. The results of
|
|
|
|
global computes 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
|
|
|
|
<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.
|
2007-09-28 07:25:52 +08:00
|
|
|
</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
|
2008-01-03 03:25:15 +08:00
|
|
|
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.
|
2007-09-28 07:25:52 +08:00
|
|
|
</P>
|
2007-10-10 02:24:42 +08:00
|
|
|
<P>See this <A HREF = "Section_howto.html#4_15">howto section</A> for a summary of
|
2008-01-03 03:25:15 +08:00
|
|
|
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.
|
2007-10-10 02:24:42 +08:00
|
|
|
</P>
|
2007-11-02 00:46:50 +08:00
|
|
|
<P>LAMMPS creates its own global computes for thermodynamic output.
|
|
|
|
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>
|
|
|
|
<P>In all these cases, the default computes can be replaced by computes
|
2007-09-28 07:25:52 +08:00
|
|
|
defined by the user in the input script, as described by the
|
2008-01-03 03:25:15 +08:00
|
|
|
<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
|
|
|
|
section</A> of the manaul) and the results of their
|
|
|
|
calculations accessed in the various ways described above.
|
2007-02-10 05:40:32 +08:00
|
|
|
</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
|
2008-01-03 03:25:15 +08:00
|
|
|
available in LAMMPS:
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<UL><LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom
|
2007-06-20 21:09:50 +08:00
|
|
|
<LI><A HREF = "compute_coord_atom.html">coord/atom</A> - coordination number for each atom
|
2008-01-04 08:27:56 +08:00
|
|
|
<LI><A HREF = "compute_displace_atom.html">displace/atom</A> - displacement of each atom
|
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
|
2007-02-10 05:40:32 +08:00
|
|
|
<LI><A HREF = "compute_ke_atom.html">ke/atom</A> - kinetic energy for each atom
|
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
|
|
|
|
<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
|
2007-10-27 04:42:35 +08:00
|
|
|
<LI><A HREF = "compute_sum.html">sum</A> - sum per-atom quantities to a global value
|
2007-02-10 05:40:32 +08:00
|
|
|
<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
|
|
|
|
<LI><A HREF = "compute_temp_deform.html">temp/deform</A> - temperature excluding box deformation velocity
|
|
|
|
<LI><A HREF = "compute_temp_dipole.html">temp/dipole</A> - temperature of point dipolar particles
|
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
|
2007-06-20 21:09:50 +08:00
|
|
|
<LI><A HREF = "compute_temp_ramp.html">temp/ramp</A> - temperature excluding ramped velocity component
|
2008-01-03 03:25:15 +08:00
|
|
|
<LI><A HREF = "compute_temp_region.html">temp/region</A> - temperature of a region of atoms
|
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>,
|
|
|
|
<A HREF = "fix_ave_time.html">fix ave/time</A>
|
2007-02-10 05:40:32 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Default:</B> none
|
|
|
|
</P>
|
|
|
|
</HTML>
|