<spanid="index-0"></span><h1>compute stress/atom command<aclass="headerlink"href="#compute-stress-atom-command"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="syntax">
<h2>Syntax<aclass="headerlink"href="#syntax"title="Permalink to this headline">¶</a></h2>
<divclass="highlight-python"><divclass="highlight"><pre>compute ID group-ID stress/atom temp-ID keyword ...
</pre></div>
</div>
<ulclass="simple">
<li>ID, group-ID are documented in <aclass="reference internal"href="compute.html"><em>compute</em></a> command</li>
<li>stress/atom = style name of this compute command</li>
<li>temp-ID = ID of compute that calculates temperature, can be NULL if not needed</li>
<li>zero or more keywords may be appended</li>
<li>keyword = <em>ke</em> or <em>pair</em> or <em>bond</em> or <em>angle</em> or <em>dihedral</em> or <em>improper</em> or <em>kspace</em> or <em>fix</em> or <em>virial</em></li>
</ul>
</div>
<divclass="section"id="examples">
<h2>Examples<aclass="headerlink"href="#examples"title="Permalink to this headline">¶</a></h2>
<divclass="highlight-python"><divclass="highlight"><pre>compute 1 mobile stress/atom NULL
compute 1 mobile stress/atom myRamp
compute 1 all stress/atom NULL pair bond
</pre></div>
</div>
</div>
<divclass="section"id="description">
<h2>Description<aclass="headerlink"href="#description"title="Permalink to this headline">¶</a></h2>
<p>Define a computation that computes the symmetric per-atom stress
tensor for each atom in a group. The tensor for each atom has 6
components and is stored as a 6-element vector in the following order:
xx, yy, zz, xy, xz, yz. See the <aclass="reference internal"href="compute_pressure.html"><em>compute pressure</em></a> command if you want the stress tensor
(pressure) of the entire system.</p>
<p>The stress tensor for atom <em>I</em> is given by the following formula,
where <em>a</em> and <em>b</em> take on values x,y,z to generate the 6 components of
<p>The first term is a kinetic energy contribution for atom <em>I</em>. See
details below on how the specified <em>temp-ID</em> can affect the velocities
used in this calculation. The second term is a pairwise energy
contribution where <em>n</em> loops over the <em>Np</em> neighbors of atom <em>I</em>, <em>r1</em>
and <em>r2</em> are the positions of the 2 atoms in the pairwise interaction,
and <em>F1</em> and <em>F2</em> are the forces on the 2 atoms resulting from the
pairwise interaction. The third term is a bond contribution of
similar form for the <em>Nb</em> bonds which atom <em>I</em> is part of. There are
similar terms for the <em>Na</em> angle, <em>Nd</em> dihedral, and <em>Ni</em> improper
interactions atom <em>I</em> is part of. There is also a term for the KSpace
contribution from long-range Coulombic interactions, if defined.
Finally, there is a term for the <em>Nf</em><aclass="reference internal"href="fix.html"><em>fixes</em></a> that apply
internal constraint forces to atom <em>I</em>. Currently, only the <aclass="reference internal"href="fix_shake.html"><em>fix shake</em></a> and <aclass="reference internal"href="fix_rigid.html"><em>fix rigid</em></a> commands
contribute to this term.</p>
<p>As the coefficients in the formula imply, a virial contribution
produced by a small set of atoms (e.g. 4 atoms in a dihedral or 3
atoms in a Tersoff 3-body interaction) is assigned in equal portions
to each atom in the set. E.g. 1/4 of the dihedral virial to each of
the 4 atoms, or 1/3 of the fix virial due to SHAKE constraints applied
to atoms in a a water molecule via the <aclass="reference internal"href="fix_shake.html"><em>fix shake</em></a>
command.</p>
<p>If no extra keywords are listed, all of the terms in this formula are
included in the per-atom stress tensor. If any extra keywords are
listed, only those terms are summed to compute the tensor. The
<em>virial</em> keyword means include all terms except the kinetic energy
<em>ke</em>.</p>
<p>Note that the stress for each atom is due to its interaction with all
other atoms in the simulation, not just with other atoms in the group.</p>
<p>Details of how LAMMPS computes the virial for individual atoms for
either pairwise or manybody potentials, and including the effects of
periodic boundary conditions is discussed in <aclass="reference internal"href="#thompson"><span>(Thompson)</span></a>.
The basic idea for manybody potentials is to treat each component of
the force computation between a small cluster of atoms in the same
manner as in the formula above for bond, angle, dihedral, etc
interactions. Namely the quantity R dot F is summed over the atoms in
the interaction, with the R vectors unwrapped by periodic boundaries
so that the cluster of atoms is close together. The total
contribution for the cluster interaction is divided evenly among those
<p>This compute calculates a per-atom array with 6 columns, which can be
accessed by indices 1-6 by any command that uses per-atom values from
a compute as input. See <aclass="reference internal"href="Section_howto.html#howto-15"><span>Section_howto 15</span></a> for an overview of LAMMPS output
options.</p>
<p>The per-atom array values will be in pressure*volume
<aclass="reference internal"href="units.html"><em>units</em></a> as discussed above.</p>
</div>
<divclass="section"id="restrictions">
<h2>Restrictions<aclass="headerlink"href="#restrictions"title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<divclass="section"id="related-commands">
<h2>Related commands<aclass="headerlink"href="#related-commands"title="Permalink to this headline">¶</a></h2>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.