Page MenuHomec4science

compute_rigid_local.html
No OneTemporary

File Metadata

Created
Sun, Jul 7, 03:39

compute_rigid_local.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 rigid/local 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"/>
<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">
<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>
</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>compute rigid/local 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>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-rigid-local-command">
<span id="index-0"></span><h1>compute rigid/local 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">rigid</span><span class="o">/</span><span class="n">local</span> <span class="n">rigidID</span> <span class="n">input1</span> <span class="n">input2</span> <span class="o">...</span>
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><span class="doc">compute</span></a> command</li>
<li>rigid/local = style name of this compute command</li>
<li>rigidID = ID of fix rigid/small command or one of its variants</li>
<li>input = one or more rigid body attributes</li>
</ul>
<pre class="literal-block">
possible attributes = id, mol, mass,
x, y, z, xu, yu, zu, ix, iy, iz
vx, vy, vz, fx, fy, fz,
omegax, omegay, omegaz,
angmomx, angmomy, angmomz,
quatw, quati, quatj, quatk,
tqx, tqy, tqz,
inertiax, inertiay, inertiaz
id = atom ID of atom within body which owns body properties
mol = molecule ID used to define body in <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid/small</span></a> command
mass = total mass of body
x,y,z = center of mass coords of body
xu,yu,zu = unwrapped center of mass coords of body
ix,iy,iz = box image that the center of mass is in
vx,vy,vz = center of mass velocities
fx,fy,fz = force of center of mass
omegax,omegay,omegaz = angular velocity of body
angmomx,angmomy,angmomz = angular momentum of body
quatw,quati,quatj,quatk = quaternion components for body
tqx,tqy,tqz = torque on body
inertiax,inertiay,inertiaz = diagonalized moments of inertia of body
</pre>
</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">rigid</span><span class="o">/</span><span class="n">local</span> <span class="n">myRigid</span> <span class="n">mol</span> <span class="n">x</span> <span class="n">y</span> <span class="n">z</span>
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>Define a computation that simply stores rigid body attributes for
rigid bodies defined by the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid/small</span></a> command
or one of its NVE, NVT, NPT, NPH variants. The data is stored as
local data so it can be accessed by other <a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">output commands</span></a> that process local data, such as
the <a class="reference internal" href="compute_reduce.html"><span class="doc">compute reduce</span></a> or <a class="reference internal" href="dump.html"><span class="doc">dump local</span></a>
commands.</p>
<p>Note that this command only works with the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid/small</span></a> command or its variants, not the fix rigid
command and its variants. The ID of the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid/small</span></a> command used to define rigid bodies must
be specified as <em>rigidID</em>. The <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a> command is
typically used to define a handful of (potentially very large) rigid
bodies. It outputs similar per-body information as this command
directly from the fix as global data; see the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a> doc page for details</p>
<p>The local data stored by this command is generated by looping over all
the atoms owned on a processor. If the atom is not in the specified
<em>group-ID</em> or is not part of a rigid body it is skipped. If it is not
the atom within a body that is assigned to store the body information
it is skipped (only one atom per body is so assigned). If it is the
assigned atom, then the info for that body is output. This means that
information for N bodies is generated. N may be less than the # of
bodies defined by the fix rigid command, if the atoms in some bodies
are not in the <em>group-ID</em>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Which atom in a body owns the body info is determined internal
to LAMMPS; it&#8217;s the one nearest the geometric center of the body.
Typically you should avoid this complication, by defining the group
associated with this fix to include/exclude entire bodies.</p>
</div>
<p>Note that as atoms and bodies migrate from processor to processor,
there will be no consistent ordering of the entries within the local
vector or array from one timestep to the next.</p>
<p>Here is an example of how to use this compute to dump rigid body info
to a file:</p>
<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">rigid</span><span class="o">/</span><span class="n">local</span> <span class="n">myRigid</span> <span class="n">mol</span> <span class="n">x</span> <span class="n">y</span> <span class="n">z</span> <span class="n">fx</span> <span class="n">fy</span> <span class="n">fz</span>
<span class="n">dump</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">local</span> <span class="mi">1000</span> <span class="n">tmp</span><span class="o">.</span><span class="n">dump</span> <span class="n">index</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">6</span><span class="p">]</span> <span class="n">c_1</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span>
</pre></div>
</div>
<hr class="docutils" />
<p>This section explains the rigid body attributes that can be specified.</p>
<p>The <em>id</em> attribute is the atomID of the atom which owns the rigid body, which is
assigned by the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid/small</span></a> command.</p>
<p>The <em>mol</em> attribute is the molecule ID of the rigid body. It should
be the molecule ID which all of the atoms in the body belong to, since
that is how the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid/small</span></a> command defines its
rigid bodies.</p>
<p>The <em>mass</em> attribute is the total mass of the rigid body.</p>
<p>There are two options for outputting the coordinates of the center of
mass (COM) of the body. The <em>x</em>, <em>y</em>, <em>z</em> attributes write the COM
&#8220;unscaled&#8221;, in the appropriate distance <a class="reference internal" href="units.html"><span class="doc">units</span></a> (Angstroms,
sigma, etc). Use <em>xu</em>, <em>yu</em>, <em>zu</em> if you want the COM &#8220;unwrapped&#8221; by
the image flags for each atobody. Unwrapped means that if the body
COM has passed thru a periodic boundary one or more times, the value
is generated what the COM coordinate would be if it had not been
wrapped back into the periodic box.</p>
<p>The image flags for the body can be generated directly using the <em>ix</em>,
<em>iy</em>, <em>iz</em> attributes. For periodic dimensions, they specify which
image of the simulation box the COM is considered to be in. An image
of 0 means it is inside the box as defined. A value of 2 means add 2
box lengths to get the true value. A value of -1 means subtract 1 box
length to get the true value. LAMMPS updates these flags as the rigid
body COMs cross periodic boundaries during the simulation.</p>
<p>The <em>vx</em>, <em>vy</em>, <em>vz</em>, <em>fx</em>, <em>fy</em>, <em>fz</em> attributes are components of
the COM velocity and force on the COM of the body.</p>
<p>The <em>omegax</em>, <em>omegay</em>, and <em>omegaz</em> attributes are the angular
velocity componennts of the body around its COM.</p>
<p>The <em>angmomx</em>, <em>angmomy</em>, and <em>angmomz</em> attributes are the angular
momentum components of the body around its COM.</p>
<p>The <em>quatw</em>, <em>quati</em>, <em>quatj</em>, and <em>quatk</em> attributes are the
components of the 4-vector quaternion representing the orientation of
the rigid body. See the <a class="reference internal" href="set.html"><span class="doc">set</span></a> command for an explanation of
the quaternion vector.</p>
<p>The <em>angmomx</em>, <em>angmomy</em>, and <em>angmomz</em> attributes are the angular
momentum components of the body around its COM.</p>
<p>The <em>tqx</em>, <em>tqy</em>, <em>tqz</em> attributes are components of the torque acting
on the body around its COM.</p>
<p>The <em>inertiax</em>, <em>inertiay</em>, <em>inertiaz</em> attributes are components of
diagonalized inertia tensor for the body, i.e the 3 moments of inertia
for the body around its principal axes, as computed internally by
LAMMPS.</p>
<hr class="docutils" />
<p><strong>Output info:</strong></p>
<p>This compute calculates a local vector or local array depending on the
number of keywords. The length of the vector or number of rows in the
array is the number of rigid bodies. If a single keyword is
specified, a local vector is produced. If two or more keywords are
specified, a local array is produced where the number of columns = the
number of keywords. The vector or array can be accessed by any
command that uses local values from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">this section</span></a> for an overview of LAMMPS output
options.</p>
<p>The vector or array values will be in whatever <a class="reference internal" href="units.html"><span class="doc">units</span></a> the
corresponding attribute is in:</p>
<ul class="simple">
<li>id,mol = unitless</li>
<li>mass = mass units</li>
<li>x,y,z and xy,yu,zu = distance units</li>
<li>vx,vy,vz = velocity units</li>
<li>fx,fy,fz = force units</li>
<li>omegax,omegay,omegaz = radians/time units</li>
<li>angmomx,angmomy,angmomz = mass*distance^2/time units</li>
<li>quatw,quati,quatj,quatk = unitless</li>
<li>tqx,tqy,tqz = torque units</li>
<li>inertiax,inertiay,inertiaz = mass*distance^2 units</li>
</ul>
</div>
<div class="section" id="restrictions">
<h2>Restrictions</h2>
<p>This compute is part of the RIGID package. It is only enabled if
LAMMPS was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a> section for more info.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands</h2>
<p><a class="reference internal" href="dump.html"><span class="doc">dump local</span></a>, <a class="reference internal" href="compute_reduce.html"><span class="doc">compute reduce</span></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<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