<p>Distance units for the x,y,z values are determined by the setting of
the <em>units</em> keyword, as discussed below. One or more x,y,z values can
also be specified as NULL, which means exclude that dimension from
this operation. Or it can be specified as INIT which means to
constrain the center-of-mass to its initial value at the beginning of
the run.</p>
<p>The center-of-mass (COM) is computed for the group specified by the
fix. If the current COM is different than the specified x,y,z, then a
group of atoms has their coordinates shifted by the difference. By
default the shifted group is also the group specified by the fix. A
different group can be shifted by using the <em>shift</em> keyword. For
example, the COM could be computed on a protein to keep it in the
center of the simulation box. But the entire system (protein + water)
could be shifted.</p>
<p>If the <em>units</em> keyword is set to <em>box</em>, then the distance units of
x,y,z are defined by the <span class="xref doc">units</span> command - e.g. Angstroms
for <em>real</em> units. A <em>lattice</em> value means the distance units are in
lattice spacings. The <a class="reference internal" href="lattice.html"><span class="doc">lattice</span></a> command must have been
previously used to define the lattice spacing. A <em>fraction</em> value
means a fractional distance between the lo/hi box boundaries, e.g. 0.5
= middle of the box. The default is to use lattice units.</p>
<p>Note that the <a class="reference internal" href="velocity.html"><span class="doc">velocity</span></a> command can be used to create
velocities with zero aggregate linear and/or angular momentum.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This fix performs its operations at the same point in the
timestep as other time integration fixes, such as <a class="reference internal" href="fix_nve.html"><span class="doc">fix nve</span></a>, <a class="reference internal" href="fix_nh.html"><span class="doc">fix nvt</span></a>, or <a class="reference internal" href="fix_nh.html"><span class="doc">fix npt</span></a>.
Thus fix recenter should normally be the last such fix specified in
the input script, since the adjustments it makes to atom coordinates
should come after the changes made by time integration. LAMMPS will
warn you if your fixes are not ordered this way.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you use this fix on a small group of atoms (e.g. a molecule
in solvent) without using the <em>shift</em> keyword to adjust the positions
of all atoms in the system, then the results can be unpredictable.
For example, if the molecule is pushed in one direction by the
solvent, its velocity will increase. But its coordinates will be
recentered, meaning it is pushed back towards the force. Thus over
time, the velocity and temperature of the molecule could become very
large (though it won’t appear to be moving due to the recentering).
If you are thermostatting the entire system, then the solvent would be
cooled to compensate. A better solution for this simulation scenario
is to use the <a class="reference internal" href="fix_spring.html"><span class="doc">fix spring</span></a> command to tether the
<h2>Restart, fix_modify, output, run start/stop, minimize info</h2>
<p>No information about this fix is written to <a class="reference internal" href="restart.html"><span class="doc">binary restart files</span></a>. None of the <a class="reference internal" href="fix_modify.html"><span class="doc">fix_modify</span></a> options
are relevant to this fix.</p>
<p>This fix computes a global scalar which can be accessed by various
<a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">output commands</span></a>. The scalar is the
distance the group is moved by fix recenter.</p>
<p>This fix also computes global 3-vector which can be accessed by
various <a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">output commands</span></a>. The 3
quantities in the vector are xyz components of displacement applied to
the group of atoms by the fix.</p>
<p>The scalar and vector values calculated by this fix are “extensive”.</p>
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
the <a class="reference internal" href="run.html"><span class="doc">run</span></a> command. This fix is not invoked during <a class="reference internal" href="minimize.html"><span class="doc">energy minimization</span></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions</h2>
<p>This fix should not be used with an x,y,z setting that causes a large
shift in the system on the 1st timestep, due to the requested COM
being very different from the initial COM. This could cause atoms to
be lost, especially in parallel. Instead, use the
<a class="reference internal" href="displace_atoms.html"><span class="doc">displace_atoms</span></a> command, which can be used to
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>.