Page MenuHomec4science

compute.html
No OneTemporary

File Metadata

Created
Mon, Nov 25, 23:33

compute.html

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<link rel="up" title="Commands" href="commands.html"/>
<link rel="next" title="compute_modify command" href="compute_modify.html"/>
<link rel="prev" title="comm_style command" href="comm_style.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">User Documentation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
<p class="caption"><span class="caption-text">Index</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="tutorials.html">Tutorials</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="commands.html">Commands</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="angle_coeff.html">angle_coeff command</a></li>
<li class="toctree-l2"><a class="reference internal" href="angle_style.html">angle_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="atom_modify.html">atom_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="atom_style.html">atom_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="balance.html">balance command</a></li>
<li class="toctree-l2"><a class="reference internal" href="bond_coeff.html">bond_coeff command</a></li>
<li class="toctree-l2"><a class="reference internal" href="bond_style.html">bond_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="bond_write.html">bond_write command</a></li>
<li class="toctree-l2"><a class="reference internal" href="boundary.html">boundary command</a></li>
<li class="toctree-l2"><a class="reference internal" href="box.html">box command</a></li>
<li class="toctree-l2"><a class="reference internal" href="change_box.html">change_box command</a></li>
<li class="toctree-l2"><a class="reference internal" href="clear.html">clear command</a></li>
<li class="toctree-l2"><a class="reference internal" href="comm_modify.html">comm_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="comm_style.html">comm_style command</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">compute command</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#syntax">Syntax</a></li>
<li class="toctree-l3"><a class="reference internal" href="#examples">Examples</a></li>
<li class="toctree-l3"><a class="reference internal" href="#description">Description</a></li>
<li class="toctree-l3"><a class="reference internal" href="#restrictions">Restrictions</a></li>
<li class="toctree-l3"><a class="reference internal" href="#related-commands">Related commands</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compute_modify.html">compute_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="create_atoms.html">create_atoms command</a></li>
<li class="toctree-l2"><a class="reference internal" href="create_bonds.html">create_bonds command</a></li>
<li class="toctree-l2"><a class="reference internal" href="create_box.html">create_box command</a></li>
<li class="toctree-l2"><a class="reference internal" href="delete_atoms.html">delete_atoms command</a></li>
<li class="toctree-l2"><a class="reference internal" href="delete_bonds.html">delete_bonds command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dielectric.html">dielectric command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dihedral_coeff.html">dihedral_coeff command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dihedral_style.html">dihedral_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dimension.html">dimension command</a></li>
<li class="toctree-l2"><a class="reference internal" href="displace_atoms.html">displace_atoms command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html">dump command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html#dump-custom-vtk-command"><code class="docutils literal"><span class="pre">dump</span> <span class="pre">custom/vtk</span></code> command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html#dump-h5md-command"><code class="docutils literal"><span class="pre">dump</span> <span class="pre">h5md</span></code> command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html#dump-image-command"><code class="docutils literal"><span class="pre">dump</span> <span class="pre">image</span></code> command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html#dump-movie-command"><code class="docutils literal"><span class="pre">dump</span> <span class="pre">movie</span></code> command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump.html#dump-molfile-command"><code class="docutils literal"><span class="pre">dump</span> <span class="pre">molfile</span></code> command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump_custom_vtk.html">dump custom/vtk command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump_h5md.html">dump h5md command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump_image.html">dump image command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump_image.html#dump-movie-command">dump movie command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump_modify.html">dump_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="dump_molfile.html">dump molfile command</a></li>
<li class="toctree-l2"><a class="reference internal" href="echo.html">echo command</a></li>
<li class="toctree-l2"><a class="reference internal" href="fix.html">fix command</a></li>
<li class="toctree-l2"><a class="reference internal" href="fix_modify.html">fix_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="group.html">group command</a></li>
<li class="toctree-l2"><a class="reference internal" href="group2ndx.html">group2ndx command</a></li>
<li class="toctree-l2"><a class="reference internal" href="group2ndx.html#ndx2group-command">ndx2group command</a></li>
<li class="toctree-l2"><a class="reference internal" href="if.html">if command</a></li>
<li class="toctree-l2"><a class="reference internal" href="improper_coeff.html">improper_coeff command</a></li>
<li class="toctree-l2"><a class="reference internal" href="improper_style.html">improper_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="include.html">include command</a></li>
<li class="toctree-l2"><a class="reference internal" href="info.html">info command</a></li>
<li class="toctree-l2"><a class="reference internal" href="jump.html">jump command</a></li>
<li class="toctree-l2"><a class="reference internal" href="kspace_modify.html">kspace_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="kspace_style.html">kspace_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="label.html">label command</a></li>
<li class="toctree-l2"><a class="reference internal" href="lattice.html">lattice command</a></li>
<li class="toctree-l2"><a class="reference internal" href="log.html">log command</a></li>
<li class="toctree-l2"><a class="reference internal" href="mass.html">mass command</a></li>
<li class="toctree-l2"><a class="reference internal" href="min_modify.html">min_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="min_style.html">min_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="minimize.html">minimize command</a></li>
<li class="toctree-l2"><a class="reference internal" href="molecule.html">molecule command</a></li>
<li class="toctree-l2"><a class="reference internal" href="neb.html">neb command</a></li>
<li class="toctree-l2"><a class="reference internal" href="neigh_modify.html">neigh_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="neighbor.html">neighbor command</a></li>
<li class="toctree-l2"><a class="reference internal" href="newton.html">newton command</a></li>
<li class="toctree-l2"><a class="reference internal" href="next.html">next command</a></li>
<li class="toctree-l2"><a class="reference internal" href="package.html">package command</a></li>
<li class="toctree-l2"><a class="reference internal" href="pair_coeff.html">pair_coeff command</a></li>
<li class="toctree-l2"><a class="reference internal" href="pair_modify.html">pair_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="pair_style.html">pair_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="pair_write.html">pair_write command</a></li>
<li class="toctree-l2"><a class="reference internal" href="partition.html">partition command</a></li>
<li class="toctree-l2"><a class="reference internal" href="prd.html">prd command</a></li>
<li class="toctree-l2"><a class="reference internal" href="print.html">print command</a></li>
<li class="toctree-l2"><a class="reference internal" href="processors.html">processors command</a></li>
<li class="toctree-l2"><a class="reference internal" href="python.html">python command</a></li>
<li class="toctree-l2"><a class="reference internal" href="quit.html">quit command</a></li>
<li class="toctree-l2"><a class="reference internal" href="read_data.html">read_data command</a></li>
<li class="toctree-l2"><a class="reference internal" href="read_dump.html">read_dump command</a></li>
<li class="toctree-l2"><a class="reference internal" href="read_restart.html">read_restart command</a></li>
<li class="toctree-l2"><a class="reference internal" href="region.html">region command</a></li>
<li class="toctree-l2"><a class="reference internal" href="replicate.html">replicate command</a></li>
<li class="toctree-l2"><a class="reference internal" href="rerun.html">rerun command</a></li>
<li class="toctree-l2"><a class="reference internal" href="reset_timestep.html">reset_timestep command</a></li>
<li class="toctree-l2"><a class="reference internal" href="restart.html">restart command</a></li>
<li class="toctree-l2"><a class="reference internal" href="run.html">run command</a></li>
<li class="toctree-l2"><a class="reference internal" href="run_style.html">run_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="set.html">set command</a></li>
<li class="toctree-l2"><a class="reference internal" href="shell.html">shell command</a></li>
<li class="toctree-l2"><a class="reference internal" href="special_bonds.html">special_bonds command</a></li>
<li class="toctree-l2"><a class="reference internal" href="suffix.html">suffix command</a></li>
<li class="toctree-l2"><a class="reference internal" href="tad.html">tad command</a></li>
<li class="toctree-l2"><a class="reference internal" href="temper.html">temper command</a></li>
<li class="toctree-l2"><a class="reference internal" href="thermo.html">thermo command</a></li>
<li class="toctree-l2"><a class="reference internal" href="thermo_modify.html">thermo_modify command</a></li>
<li class="toctree-l2"><a class="reference internal" href="thermo_style.html">thermo_style command</a></li>
<li class="toctree-l2"><a class="reference internal" href="timer.html">timer command</a></li>
<li class="toctree-l2"><a class="reference internal" href="timestep.html">timestep command</a></li>
<li class="toctree-l2"><a class="reference internal" href="uncompute.html">uncompute command</a></li>
<li class="toctree-l2"><a class="reference internal" href="undump.html">undump command</a></li>
<li class="toctree-l2"><a class="reference internal" href="unfix.html">unfix command</a></li>
<li class="toctree-l2"><a class="reference internal" href="units.html">units command</a></li>
<li class="toctree-l2"><a class="reference internal" href="variable.html">variable command</a></li>
<li class="toctree-l2"><a class="reference internal" href="velocity.html">velocity command</a></li>
<li class="toctree-l2"><a class="reference internal" href="write_coeff.html">write_coeff command</a></li>
<li class="toctree-l2"><a class="reference internal" href="write_data.html">write_data command</a></li>
<li class="toctree-l2"><a class="reference internal" href="write_dump.html">write_dump command</a></li>
<li class="toctree-l2"><a class="reference internal" href="write_restart.html">write_restart command</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="fixes.html">Fixes</a></li>
<li class="toctree-l1"><a class="reference internal" href="computes.html">Computes</a></li>
<li class="toctree-l1"><a class="reference internal" href="pairs.html">Pair Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="bonds.html">Bond Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="angles.html">Angle Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="dihedrals.html">Dihedral Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="impropers.html">Improper Styles</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="Manual.html">LAMMPS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li><a href="commands.html">Commands</a> &raquo;</li>
<li>compute command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
<div class="rst-footer-buttons" style="margin-bottom: 1em" role="navigation" aria-label="footer navigation">
<a href="compute_modify.html" class="btn btn-neutral float-right" title="compute_modify command" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="comm_style.html" class="btn btn-neutral" title="comm_style command" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-command">
<span id="index-0"></span><h1>compute command</h1>
<div class="section" id="syntax">
<h2>Syntax</h2>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">ID</span> <span class="n">group</span><span class="o">-</span><span class="n">ID</span> <span class="n">style</span> <span class="n">args</span>
</pre></div>
</div>
<ul class="simple">
<li>ID = user-assigned name for the computation</li>
<li>group-ID = ID of the group of atoms to perform the computation on</li>
<li>style = one of a list of possible style names (see below)</li>
<li>args = arguments used by a particular style</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples</h2>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">temp</span>
<span class="n">compute</span> <span class="n">newtemp</span> <span class="n">flow</span> <span class="n">temp</span><span class="o">/</span><span class="n">partial</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">0</span>
<span class="n">compute</span> <span class="mi">3</span> <span class="nb">all</span> <span class="n">ke</span><span class="o">/</span><span class="n">atom</span>
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>Define 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, though a compute may internally store some
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 class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">howto section</span></a> for a summary of
various LAMMPS output options, many of which involve computes.</p>
<p>The ID of a compute can only contain alphanumeric characters and
underscores.</p>
<hr class="docutils" />
<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 &#8220;atom&#8221; in their style, e.g. <em>ke/atom</em>. Computes that produce
local quantities have the word &#8220;local&#8221; in their style,
e.g. <em>bond/local</em>. Styles with neither &#8220;atom&#8221; or &#8220;local&#8221; 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 (with only a few
exceptions, as documented by individual compute commands).</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>
<table border="1" class="docutils">
<colgroup>
<col width="23%" />
<col width="77%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>c_ID</td>
<td>entire scalar, vector, or array</td>
</tr>
<tr class="row-even"><td>c_ID[I]</td>
<td>one element of vector, one column of array</td>
</tr>
<tr class="row-odd"><td>c_ID[I][J]</td>
<td>one element of array</td>
</tr>
</tbody>
</table>
<p>In other words, using one bracket reduces the dimension of the
quantity once (vector -&gt; scalar, array -&gt; vector). Using two brackets
reduces the dimension twice (array -&gt; 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 class="reference internal" href="variable.html"><span class="doc">variables</span></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 class="docutils" />
<p>In LAMMPS, the values generated by a compute can be used in several
ways:</p>
<ul class="simple">
<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>
<li>Global values can be output via the <a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style custom</span></a> or <a class="reference internal" href="fix_ave_time.html"><span class="doc">fix ave/time</span></a> command.
Or the values can be referenced in a <a class="reference internal" href="variable.html"><span class="doc">variable equal</span></a> or
<a class="reference internal" href="variable.html"><span class="doc">variable atom</span></a> command.</li>
<li>Per-atom values can be output via the <a class="reference internal" href="dump.html"><span class="doc">dump custom</span></a> command.
Or they can be time-averaged via the <a class="reference internal" href="fix_ave_atom.html"><span class="doc">fix ave/atom</span></a>
command or reduced by the <a class="reference internal" href="compute_reduce.html"><span class="doc">compute reduce</span></a>
command. Or the per-atom values can be referenced in an <a class="reference internal" href="variable.html"><span class="doc">atom-style variable</span></a>.</li>
<li>Local values can be reduced by the <a class="reference internal" href="compute_reduce.html"><span class="doc">compute reduce</span></a> command, or histogrammed by the <a class="reference internal" href="fix_ave_histo.html"><span class="doc">fix ave/histo</span></a> command, or output by the <a class="reference internal" href="dump.html"><span class="doc">dump local</span></a> command.</li>
</ul>
<p>The results of computes that calculate global quantities can be either
&#8220;intensive&#8221; or &#8220;extensive&#8221; 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 class="reference internal" href="thermo_style.html"><span class="doc">Thermodynamic output</span></a> will normalize extensive
values by the number of atoms in the system, depending on the
&#8220;thermo_modify norm&#8221; setting. It will not normalize intensive values.
If a compute value is accessed in another way, e.g. by a
<a class="reference internal" href="variable.html"><span class="doc">variable</span></a>, you may want to know whether it is an
intensive or extensive value. See the doc page for individual
computes for further info.</p>
<hr class="docutils" />
<p>LAMMPS creates its own computes internally for thermodynamic output.
Three computes are always created, named &#8220;thermo_temp&#8221;,
&#8220;thermo_press&#8221;, and &#8220;thermo_pe&#8221;, as if these commands had been invoked
in the input script:</p>
<pre class="literal-block">
compute thermo_temp all temp
compute thermo_press all pressure thermo_temp
compute thermo_pe all pe
</pre>
<p>Additional computes for other quantities are created if the thermo
style requires it. See the documentation for the
<a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style</span></a> command.</p>
<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 class="reference internal" href="fix.html"><span class="doc">fix</span></a> commands.</p>
<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 class="reference internal" href="thermo_modify.html"><span class="doc">thermo_modify</span></a> and <a class="reference internal" href="fix_modify.html"><span class="doc">fix modify</span></a> commands.</p>
<p>Properties of either a default or user-defined compute can be modified
via the <a class="reference internal" href="compute_modify.html"><span class="doc">compute_modify</span></a> command.</p>
<p>Computes can be deleted with the <a class="reference internal" href="uncompute.html"><span class="doc">uncompute</span></a> command.</p>
<p>Code for new computes can be added to LAMMPS (see <a class="reference internal" href="Section_modify.html"><span class="doc">this section</span></a> of the manual) and the results of their
calculations accessed in the various ways described above.</p>
<hr class="docutils" />
<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
available in LAMMPS. They are also given in more compact form in the
Compute section of <a class="reference internal" href="Section_commands.html#cmd-5"><span class="std std-ref">this page</span></a>.</p>
<p>There are also additional compute styles (not listed here) 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 class="reference internal" href="Section_commands.html#cmd-5"><span class="std std-ref">this page</span></a>.</p>
<ul class="simple">
<li><a class="reference internal" href="compute_bond_local.html"><span class="doc">angle/local</span></a> - theta and energy of each angle</li>
<li><a class="reference internal" href="compute_angmom_chunk.html"><span class="doc">angmom/chunk</span></a> - angular momentum for each chunk</li>
<li><a class="reference internal" href="compute_body_local.html"><span class="doc">body/local</span></a> - attributes of body sub-particles</li>
<li><a class="reference internal" href="compute_bond.html"><span class="doc">bond</span></a> - values computed by a bond style</li>
<li><a class="reference internal" href="compute_bond_local.html"><span class="doc">bond/local</span></a> - distance and energy of each bond</li>
<li><a class="reference internal" href="compute_centro_atom.html"><span class="doc">centro/atom</span></a> - centro-symmetry parameter for each atom</li>
<li><a class="reference internal" href="compute_chunk_atom.html"><span class="doc">chunk/atom</span></a> - assign chunk IDs to each atom</li>
<li><a class="reference internal" href="compute_cluster_atom.html"><span class="doc">cluster/atom</span></a> - cluster ID for each atom</li>
<li><a class="reference internal" href="compute_cna_atom.html"><span class="doc">cna/atom</span></a> - common neighbor analysis (CNA) for each atom</li>
<li><a class="reference internal" href="compute_com.html"><span class="doc">com</span></a> - center-of-mass of group of atoms</li>
<li><a class="reference internal" href="compute_com_chunk.html"><span class="doc">com/chunk</span></a> - center-of-mass for each chunk</li>
<li><a class="reference internal" href="compute_contact_atom.html"><span class="doc">contact/atom</span></a> - contact count for each spherical particle</li>
<li><a class="reference internal" href="compute_coord_atom.html"><span class="doc">coord/atom</span></a> - coordination number for each atom</li>
<li><a class="reference internal" href="compute_damage_atom.html"><span class="doc">damage/atom</span></a> - Peridynamic damage for each atom</li>
<li><a class="reference internal" href="compute_dihedral_local.html"><span class="doc">dihedral/local</span></a> - angle of each dihedral</li>
<li><a class="reference internal" href="compute_dilatation_atom.html"><span class="doc">dilatation/atom</span></a> - Peridynamic dilatation for each atom</li>
<li><a class="reference internal" href="compute_displace_atom.html"><span class="doc">displace/atom</span></a> - displacement of each atom</li>
<li><a class="reference internal" href="compute_erotate_asphere.html"><span class="doc">erotate/asphere</span></a> - rotational energy of aspherical particles</li>
<li><a class="reference internal" href="compute_erotate_rigid.html"><span class="doc">erotate/rigid</span></a> - rotational energy of rigid bodies</li>
<li><a class="reference internal" href="compute_erotate_sphere.html"><span class="doc">erotate/sphere</span></a> - rotational energy of spherical particles</li>
<li><a class="reference internal" href="compute_erotate_sphere.html"><span class="doc">erotate/sphere/atom</span></a> - rotational energy for each spherical particle</li>
<li><a class="reference internal" href="compute_event_displace.html"><span class="doc">event/displace</span></a> - detect event on atom displacement</li>
<li><a class="reference internal" href="compute_group_group.html"><span class="doc">group/group</span></a> - energy/force between two groups of atoms</li>
<li><a class="reference internal" href="compute_gyration.html"><span class="doc">gyration</span></a> - radius of gyration of group of atoms</li>
<li><a class="reference internal" href="compute_gyration_chunk.html"><span class="doc">gyration/chunk</span></a> - radius of gyration for each chunk</li>
<li><a class="reference internal" href="compute_heat_flux.html"><span class="doc">heat/flux</span></a> - heat flux through a group of atoms</li>
<li><a class="reference internal" href="compute_hexorder_atom.html"><span class="doc">hexorder/atom</span></a> - bond orientational order parameter q6</li>
<li><a class="reference internal" href="compute_improper_local.html"><span class="doc">improper/local</span></a> - angle of each improper</li>
<li><a class="reference internal" href="compute_inertia_chunk.html"><span class="doc">inertia/chunk</span></a> - inertia tensor for each chunk</li>
<li><a class="reference internal" href="compute_ke.html"><span class="doc">ke</span></a> - translational kinetic energy</li>
<li><a class="reference internal" href="compute_ke_atom.html"><span class="doc">ke/atom</span></a> - kinetic energy for each atom</li>
<li><a class="reference internal" href="compute_ke_rigid.html"><span class="doc">ke/rigid</span></a> - translational kinetic energy of rigid bodies</li>
<li><a class="reference internal" href="compute_msd.html"><span class="doc">msd</span></a> - mean-squared displacement of group of atoms</li>
<li><a class="reference internal" href="compute_msd_chunk.html"><span class="doc">msd/chunk</span></a> - mean-squared displacement for each chunk</li>
<li><a class="reference internal" href="compute_msd_nongauss.html"><span class="doc">msd/nongauss</span></a> - MSD and non-Gaussian parameter of group of atoms</li>
<li><a class="reference internal" href="compute_omega_chunk.html"><span class="doc">omega/chunk</span></a> - angular velocity for each chunk</li>
<li><a class="reference internal" href="compute_orientorder_atom.html"><span class="doc">orientorder/atom</span></a> - Steinhardt bond orientational order parameters Ql</li>
<li><a class="reference internal" href="compute_pair.html"><span class="doc">pair</span></a> - values computed by a pair style</li>
<li><a class="reference internal" href="compute_pair_local.html"><span class="doc">pair/local</span></a> - distance/energy/force of each pairwise interaction</li>
<li><a class="reference internal" href="compute_pe.html"><span class="doc">pe</span></a> - potential energy</li>
<li><a class="reference internal" href="compute_pe_atom.html"><span class="doc">pe/atom</span></a> - potential energy for each atom</li>
<li><a class="reference internal" href="compute_plasticity_atom.html"><span class="doc">plasticity/atom</span></a> - Peridynamic plasticity for each atom</li>
<li><a class="reference internal" href="compute_pressure.html"><span class="doc">pressure</span></a> - total pressure and pressure tensor</li>
<li><a class="reference internal" href="compute_property_atom.html"><span class="doc">property/atom</span></a> - convert atom attributes to per-atom vectors/arrays</li>
<li><a class="reference internal" href="compute_property_local.html"><span class="doc">property/local</span></a> - convert local attributes to localvectors/arrays</li>
<li><a class="reference internal" href="compute_property_chunk.html"><span class="doc">property/chunk</span></a> - extract various per-chunk attributes</li>
<li><a class="reference internal" href="compute_rdf.html"><span class="doc">rdf</span></a> - radial distribution function g(r) histogram of group of atoms</li>
<li><a class="reference internal" href="compute_reduce.html"><span class="doc">reduce</span></a> - combine per-atom quantities into a single global value</li>
<li><a class="reference internal" href="compute_reduce.html"><span class="doc">reduce/region</span></a> - same as compute reduce, within a region</li>
<li><a class="reference internal" href="compute_rigid_local.html"><span class="doc">rigid/local</span></a> - extract rigid body attributes</li>
<li><a class="reference internal" href="compute_slice.html"><span class="doc">slice</span></a> - extract values from global vector or array</li>
<li><a class="reference internal" href="compute_sna_atom.html"><span class="doc">sna/atom</span></a> - calculate bispectrum coefficients for each atom</li>
<li><a class="reference internal" href="compute_sna_atom.html"><span class="doc">snad/atom</span></a> - derivative of bispectrum coefficients for each atom</li>
<li><a class="reference internal" href="compute_sna_atom.html"><span class="doc">snav/atom</span></a> - virial contribution from bispectrum coefficients for each atom</li>
<li><a class="reference internal" href="compute_stress_atom.html"><span class="doc">stress/atom</span></a> - stress tensor for each atom</li>
<li><a class="reference internal" href="compute_temp.html"><span class="doc">temp</span></a> - temperature of group of atoms</li>
<li><a class="reference internal" href="compute_temp_asphere.html"><span class="doc">temp/asphere</span></a> - temperature of aspherical particles</li>
<li><a class="reference internal" href="compute_temp_body.html"><span class="doc">temp/body</span></a> - temperature of body particles</li>
<li><a class="reference internal" href="compute_temp_chunk.html"><span class="doc">temp/chunk</span></a> - temperature of each chunk</li>
<li><a class="reference internal" href="compute_temp_com.html"><span class="doc">temp/com</span></a> - temperature after subtracting center-of-mass velocity</li>
<li><a class="reference internal" href="compute_temp_deform.html"><span class="doc">temp/deform</span></a> - temperature excluding box deformation velocity</li>
<li><a class="reference internal" href="compute_temp_partial.html"><span class="doc">temp/partial</span></a> - temperature excluding one or more dimensions of velocity</li>
<li><a class="reference internal" href="compute_temp_profile.html"><span class="doc">temp/profile</span></a> - temperature excluding a binned velocity profile</li>
<li><a class="reference internal" href="compute_temp_ramp.html"><span class="doc">temp/ramp</span></a> - temperature excluding ramped velocity component</li>
<li><a class="reference internal" href="compute_temp_region.html"><span class="doc">temp/region</span></a> - temperature of a region of atoms</li>
<li><a class="reference internal" href="compute_temp_sphere.html"><span class="doc">temp/sphere</span></a> - temperature of spherical particles</li>
<li><a class="reference internal" href="compute_ti.html"><span class="doc">ti</span></a> - thermodyanmic integration free energy values</li>
<li><a class="reference internal" href="compute_torque_chunk.html"><span class="doc">torque/chunk</span></a> - torque applied on each chunk</li>
<li><a class="reference internal" href="compute_vacf.html"><span class="doc">vacf</span></a> - velocity-autocorrelation function of group of atoms</li>
<li><a class="reference internal" href="compute_vcm_chunk.html"><span class="doc">vcm/chunk</span></a> - velocity of center-of-mass for each chunk</li>
<li><a class="reference internal" href="compute_voronoi_atom.html"><span class="doc">voronoi/atom</span></a> - Voronoi volume and neighbors for each atom</li>
</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
the individual styles are given in the compute section of <a class="reference internal" href="Section_commands.html#cmd-5"><span class="std std-ref">this page</span></a>.</p>
<p>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
section of <a class="reference internal" href="Section_commands.html#cmd-5"><span class="std std-ref">this page</span></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions</h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands</h2>
<p><a class="reference internal" href="uncompute.html"><span class="doc">uncompute</span></a>, <a class="reference internal" href="compute_modify.html"><span class="doc">compute_modify</span></a>, <a class="reference internal" href="fix_ave_atom.html"><span class="doc">fix ave/atom</span></a>, <a class="reference internal" href="fix_ave_time.html"><span class="doc">fix ave/time</span></a>, <a class="reference internal" href="fix_ave_histo.html"><span class="doc">fix ave/histo</span></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="compute_modify.html" class="btn btn-neutral float-right" title="compute_modify command" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="comm_style.html" class="btn btn-neutral" title="comm_style command" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>

Event Timeline