2007-02-10 05:40:32 +08:00
|
|
|
"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 command :h3
|
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
|
|
|
compute ID group-ID style args :pre
|
|
|
|
|
|
|
|
ID = user-assigned name for the computation
|
|
|
|
group-ID = ID of the group of atoms to perform the computation on
|
|
|
|
style = one of a list of possible style names (see below)
|
|
|
|
args = arguments used by a particular style :ul
|
|
|
|
|
|
|
|
[Examples:]
|
|
|
|
|
|
|
|
compute 1 all temp
|
|
|
|
compute newtemp flow temp/partial 1 1 0
|
|
|
|
compute 3 all ke/atom :pre
|
|
|
|
|
|
|
|
[Description:]
|
|
|
|
|
2009-12-10 05:20:59 +08:00
|
|
|
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.
|
2011-08-26 01:01:01 +08:00
|
|
|
See this "howto section"_Section_howto.html#howto_15 for a summary of
|
2009-12-11 01:10:35 +08:00
|
|
|
various LAMMPS output options, many of which involve computes.
|
2009-12-10 05:20:59 +08:00
|
|
|
|
|
|
|
The ID of a compute can only contain alphanumeric characters and
|
|
|
|
underscores.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
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. {ke/atom}. Computes that produce
|
|
|
|
local quantities have the word "local" in their style,
|
|
|
|
e.g. {bond/local}. Styles with neither "atom" or "local" in their
|
|
|
|
style produce global quantities.
|
|
|
|
|
|
|
|
Note that a single compute produces either global or per-atom or local
|
|
|
|
quantities, but never more than one of these.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
c_ID | entire scalar, vector, or array
|
|
|
|
c_ID\[I\] | one element of vector, one column of array
|
|
|
|
c_ID\[I\]\[J\] | one element of array :tb(s=|)
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Note that commands and "variables"_variable.html 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.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
In LAMMPS, the values generated by a compute can be used in several
|
|
|
|
ways:
|
|
|
|
|
|
|
|
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. :ulb,l
|
|
|
|
|
|
|
|
Global values can be output via the "thermo_style
|
2007-09-28 07:25:52 +08:00
|
|
|
custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command.
|
2008-01-03 03:25:15 +08:00
|
|
|
Or the values can be referenced in a "variable equal"_variable.html or
|
2009-12-10 05:20:59 +08:00
|
|
|
"variable atom"_variable.html command. :l
|
|
|
|
|
|
|
|
Per-atom values can be output via the "dump custom"_dump.html command
|
|
|
|
or the "fix ave/spatial"_fix_ave_spatial.html command. Or they can be
|
|
|
|
time-averaged via the "fix ave/atom"_fix_ave_atom.html command or
|
|
|
|
reduced by the "compute reduce"_compute_reduce.html command. Or the
|
|
|
|
per-atom values can be referenced in an "atom-style
|
|
|
|
variable"_variable.html. :l
|
|
|
|
|
|
|
|
Local values can be reduced by the "compute
|
|
|
|
reduce"_compute_reduce.html command, or histogrammed by the "fix
|
2009-12-18 01:28:42 +08:00
|
|
|
ave/histo"_fix_ave_histo.html command, or output by the "dump
|
|
|
|
local"_dump.html command. :l,ule
|
2007-09-28 07:25:52 +08:00
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
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
|
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
|
|
|
|
"variable"_variable.html, 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
|
|
|
|
2009-12-10 05:20:59 +08:00
|
|
|
:line
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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 :pre
|
2007-06-20 20:56:17 +08:00
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
Additional computes for other quantities are created if the thermo
|
|
|
|
style requires it. See the documentation for the
|
|
|
|
"thermo_style"_thermo_style.html command.
|
2007-06-20 20:56:17 +08:00
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
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.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2009-12-10 05:20:59 +08:00
|
|
|
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 "thermo_modify"_thermo_modify.html and "fix
|
|
|
|
modify"_fix_modify.html commands.
|
2007-06-20 20:56:17 +08:00
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
Properties of either a default or user-defined compute can be modified
|
2007-06-20 20:56:17 +08:00
|
|
|
via the "compute_modify"_compute_modify.html command.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2007-06-20 20:56:17 +08:00
|
|
|
Computes can be deleted with the "uncompute"_uncompute.html command.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2007-06-20 20:56:17 +08:00
|
|
|
Code for new computes can be added to LAMMPS (see "this
|
2008-02-20 05:47:37 +08:00
|
|
|
section"_Section_modify.html 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
|
|
|
|
2009-12-10 05:20:59 +08:00
|
|
|
:line
|
|
|
|
|
2007-02-10 05:40:32 +08:00
|
|
|
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
|
|
|
|
2009-12-19 01:25:39 +08:00
|
|
|
"angle/local"_compute_bond_local.html - theta and energy of each angle
|
2010-10-19 01:42:05 +08:00
|
|
|
"atom/molecule"_compute_atom_molecule.html - sum per-atom properties for each molecule
|
2013-02-01 00:39:48 +08:00
|
|
|
"body/local"_compute_body_local.html - attributes of body sub-particles
|
2009-12-19 01:25:39 +08:00
|
|
|
"bond/local"_compute_bond_local.html - distance and energy of each bond
|
2007-02-10 05:40:32 +08:00
|
|
|
"centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom
|
2011-03-09 06:23:59 +08:00
|
|
|
"cluster/atom"_compute_cluster_atom.html - cluster ID for each atom
|
2009-01-20 01:18:42 +08:00
|
|
|
"cna/atom"_compute_cna_atom.html - common neighbor analysis (CNA) for each atom
|
2009-12-04 08:42:15 +08:00
|
|
|
"com"_compute_com.html - center-of-mass of group of atoms
|
2009-12-22 01:26:47 +08:00
|
|
|
"com/molecule"_compute_com_molecule.html - center-of-mass for each molecule
|
2012-08-09 00:41:49 +08:00
|
|
|
"contact/atom"_compute_contact_atom.html - contact count for each spherical particle
|
2007-06-20 21:09:50 +08:00
|
|
|
"coord/atom"_compute_coord_atom.html - coordination number for each atom
|
2008-07-24 22:43:12 +08:00
|
|
|
"damage/atom"_compute_damage_atom.html - Peridynamic damage for each atom
|
2009-12-19 05:24:44 +08:00
|
|
|
"dihedral/local"_compute_dihedral_local.html - angle of each dihedral
|
2008-01-04 08:27:56 +08:00
|
|
|
"displace/atom"_compute_displace_atom.html - displacement of each atom
|
2008-03-20 01:04:31 +08:00
|
|
|
"erotate/asphere"_compute_erotate_asphere.html - rotational energy of aspherical particles
|
2013-09-06 06:59:35 +08:00
|
|
|
"erotate/rigid"_compute_erotate_rigid.html - rotational energy of rigid bodies
|
2008-03-18 08:23:39 +08:00
|
|
|
"erotate/sphere"_compute_erotate_sphere.html - rotational energy of spherical particles
|
2012-08-07 06:50:52 +08:00
|
|
|
"erotate/sphere/atom"_compute_erotate_sphere.html - rotational energy for each spherical particle
|
2009-10-30 06:41:53 +08:00
|
|
|
"event/displace"_compute_event_displace.html - detect event on atom displacement
|
2008-02-15 07:24:11 +08:00
|
|
|
"group/group"_compute_group_group.html - energy/force between two groups of atoms
|
2009-12-04 08:52:20 +08:00
|
|
|
"gyration"_compute_gyration.html - radius of gyration of group of atoms
|
2009-12-22 01:26:47 +08:00
|
|
|
"gyration/molecule"_compute_gyration_molecule.html - radius of gyration for each molecule
|
2009-07-03 00:38:31 +08:00
|
|
|
"heat/flux"_compute_heat_flux.html - heat flux through a group of atoms
|
2009-12-19 05:24:44 +08:00
|
|
|
"improper/local"_compute_improper_local.html - angle of each improper
|
2012-11-27 22:42:49 +08:00
|
|
|
"inertia/molecule"_compute_inertia_molecule.html - inertia tensor for each molecule
|
2008-03-19 23:39:14 +08:00
|
|
|
"ke"_compute_ke.html - translational kinetic energy
|
2007-02-10 05:40:32 +08:00
|
|
|
"ke/atom"_compute_ke_atom.html - kinetic energy for each atom
|
2013-09-06 06:59:35 +08:00
|
|
|
"ke/rigid"_compute_ke_rigid.html - translational kinetic energy of rigid bodies
|
2009-12-04 07:58:11 +08:00
|
|
|
"msd"_compute_msd.html - mean-squared displacement of group of atoms
|
2009-12-22 01:26:47 +08:00
|
|
|
"msd/molecule"_compute_msd_molecule.html - mean-squared displacement for each molecule
|
2010-10-19 01:17:06 +08:00
|
|
|
"pair"_compute_pair.html - values computed by a pair style
|
2009-12-22 07:01:36 +08:00
|
|
|
"pair/local"_compute_pair_local.html - distance/energy/force of each pairwise interaction
|
2007-11-02 00:46:50 +08:00
|
|
|
"pe"_compute_pe.html - potential energy
|
2008-01-03 03:25:15 +08:00
|
|
|
"pe/atom"_compute_pe_atom.html - potential energy for each atom
|
2007-02-10 05:40:32 +08:00
|
|
|
"pressure"_compute_pressure.html - total pressure and pressure tensor
|
2009-12-17 01:27:23 +08:00
|
|
|
"property/atom"_compute_property_atom.html - convert atom attributes to per-atom vectors/arrays
|
2009-12-18 01:28:42 +08:00
|
|
|
"property/local"_compute_property_local.html - convert local attributes to localvectors/arrays
|
2009-12-22 05:43:10 +08:00
|
|
|
"property/molecule"_compute_property_molecule.html - convert molecule attributes to localvectors/arrays
|
2009-12-17 04:27:03 +08:00
|
|
|
"rdf"_compute_rdf.html - radial distribution function g(r) histogram of group of atoms
|
2008-02-20 22:52:21 +08:00
|
|
|
"reduce"_compute_reduce.html - combine per-atom quantities into a single global value
|
2009-04-28 22:56:27 +08:00
|
|
|
"reduce/region"_compute_reduce.html - same as compute reduce, within a region
|
2011-06-08 01:25:14 +08:00
|
|
|
"slice"_compute_slice.html - extract values from global vector or array
|
2007-02-10 05:40:32 +08:00
|
|
|
"stress/atom"_compute_stress_atom.html - stress tensor for each atom
|
|
|
|
"temp"_compute_temp.html - temperature of group of atoms
|
2007-06-20 21:09:50 +08:00
|
|
|
"temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles
|
2008-03-12 00:37:01 +08:00
|
|
|
"temp/com"_compute_temp_com.html - temperature after subtracting center-of-mass velocity
|
2007-06-20 21:09:50 +08:00
|
|
|
"temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity
|
2007-02-10 05:40:32 +08:00
|
|
|
"temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity
|
2009-04-30 00:54:14 +08:00
|
|
|
"temp/profile"_compute_temp_profile.html - temperature excluding a binned velocity profile
|
2007-06-20 21:09:50 +08:00
|
|
|
"temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component
|
2008-03-18 08:23:39 +08:00
|
|
|
"temp/region"_compute_temp_region.html - temperature of a region of atoms
|
2010-10-23 05:24:33 +08:00
|
|
|
"temp/sphere"_compute_temp_sphere.html - temperature of spherical particles
|
2013-01-26 00:33:10 +08:00
|
|
|
"ti"_compute_ti.html - thermodyanmic integration free energy values
|
|
|
|
"voronoi/atom"_compute_voronoi_atom.html - Voronoi volume and neighbors for each atom :ul
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2007-10-03 06:56:45 +08:00
|
|
|
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 "this
|
2011-08-26 01:01:01 +08:00
|
|
|
page"_Section_commands.html#cmd_5.
|
2007-10-03 06:56:45 +08:00
|
|
|
|
2011-05-27 08:22:06 +08:00
|
|
|
There are also additional accelerated compute styles included in the
|
|
|
|
LAMMPS distribution for faster performance on CPUs and GPUs. The list
|
|
|
|
of these with links to the individual styles are given in the pair
|
2011-08-26 01:01:01 +08:00
|
|
|
section of "this page"_Section_commands.html#cmd_5.
|
2011-05-27 08:22:06 +08:00
|
|
|
|
2007-02-10 05:40:32 +08:00
|
|
|
[Restrictions:] none
|
|
|
|
|
|
|
|
[Related commands:]
|
|
|
|
|
2007-10-27 04:42:35 +08:00
|
|
|
"uncompute"_uncompute.html, "compute_modify"_compute_modify.html, "fix
|
|
|
|
ave/atom"_fix_ave_atom.html, "fix ave/spatial"_fix_ave_spatial.html,
|
2009-12-18 01:28:42 +08:00
|
|
|
"fix ave/time"_fix_ave_time.html, "fix ave/histo"_fix_ave_histo.html
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
[Default:] none
|