<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 <aclass="reference internal"href="units.html"><spanclass="doc">units</span></a> command - e.g. Angstroms
for <em>real</em> units. A <em>lattice</em> value means the distance units are in
lattice spacings. The <aclass="reference internal"href="lattice.html"><spanclass="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 <aclass="reference internal"href="velocity.html"><spanclass="doc">velocity</span></a> command can be used to create
velocities with zero aggregate linear and/or angular momentum.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">This fix performs its operations at the same point in the
timestep as other time integration fixes, such as <aclass="reference internal"href="fix_nve.html"><spanclass="doc">fix nve</span></a>, <aclass="reference internal"href="fix_nh.html"><spanclass="doc">fix nvt</span></a>, or <aclass="reference internal"href="fix_nh.html"><spanclass="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>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="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 consistently in one direction
by a flowing solvent, its velocity will increase. But its coordinates
will be recentered, meaning it is moved back towards the force. Thus
over time, the velocity and effective temperature of the molecule
could become very large, though it won’t actually 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 <aclass="reference internal"href="fix_spring.html"><spanclass="doc">fix spring</span></a> command
to tether the molecule in place.</p>
</div>
<p><strong>Restart, fix_modify, output, run start/stop, minimize info:</strong></p>
<p>No information about this fix is written to <aclass="reference internal"href="restart.html"><spanclass="doc">binary restart files</span></a>. None of the <aclass="reference internal"href="fix_modify.html"><spanclass="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
<aclass="reference internal"href="Section_howto.html#howto-15"><spanclass="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 <aclass="reference internal"href="Section_howto.html#howto-15"><spanclass="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 <aclass="reference internal"href="run.html"><spanclass="doc">run</span></a> command. This fix is not invoked during <aclass="reference internal"href="minimize.html"><spanclass="doc">energy minimization</span></a>.</p>
</div>
<divclass="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
<aclass="reference internal"href="displace_atoms.html"><spanclass="doc">displace_atoms</span></a> command, which can be used to
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>.