<span id="index-0"></span><h1>compute gyration command<a class="headerlink" href="#compute-gyration-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID gyration
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>gyration = style name of this compute command</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<p>where M is the total mass of the group, Rcm is the center-of-mass
position of the group, and the sum is over all atoms in the group.</p>
<p>A Rg^2 tensor, stored as a 6-element vector, is also calculated by
this compute. The formula for the components of the tensor is the
same as the above formula, except that (Ri - Rcm)^2 is replaced by
(Rix - Rcmx) * (Riy - Rcmy) for the xy component, etc. The 6
components of the vector are ordered xx, yy, zz, xy, xz, yz. Note
that unlike the scalar Rg, each of the 6 values of the tensor is
effectively a “squared” value, since the cross-terms may be negative
and taking a sqrt() would be invalid.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The coordinates of an atom contribute to Rg in
“unwrapped” form, by using the image flags associated with each atom.
See the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command for a discussion of
“unwrapped” coordinates. See the Atoms section of the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the <a class="reference internal" href="set.html"><em>set image</em></a> command.</p>
</div>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global scalar (Rg) and a global vector of
length 6 (Rg^2 tensor), which can be accessed by indices 1-6. These
values can be used by any command that uses a global scalar value or
vector values from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>Section_howto 15</span></a> for an overview of LAMMPS output
options.</p>
<p>The scalar and vector values calculated by this compute are
“intensive”. The scalar and vector values will be in distance and
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>.