Page MenuHomec4science

fix_recenter.html
No OneTemporary

File Metadata

Created
Mon, Dec 23, 08:52

fix_recenter.html

<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>fix recenter command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>fix ID group-ID recenter x y z keyword value ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>recenter = style name of this fix command
<LI>x,y,z = constrain center-of-mass to these coords (distance units), any coord can also be NULL or INIT (see below)
<LI>zero or more keyword/value pairs may be appended to the args
<LI>keyword = <I>shift</I> or <I>units</I>
<PRE> <I>shift</I> value = group-ID
group-ID = group of atoms whose coords are shifted
<I>units</I> value = <I>box</I> or <I>lattice</I> or <I>fraction</I>
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all recenter 1 1 1 0
</PRE>
<P><B>Description:</B>
</P>
<P>Constrain the center-of-mass position of a group of atoms by adjusting
the coordinates of the atoms every timestep. This is simply a small
shift that does not alter the dynamics of the system or change the
relative coordinates of any pair of atoms in the group. This can be
used to insure the entire collection of atoms (or a portion of them)
do not drift during the simulation due to random perturbations
(e.g. <A HREF = "fix_langevin.html">fix langevin</A> thermostatting).
</P>
<P>Distance units for the x,y,z values are determined by the setting of
the <I>units</I> 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
constain 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 <I>shift</I> 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 <I>units</I> keyword is set to <I>box</I>, then the distance units of
x,y,z are defined by the <A HREF = "units.html">units</A> command - e.g. Angstroms
for <I>real</I> units. <I>Lattice</I> means to use lattice spacings as defined
by the <A HREF = "lattice.html">lattice</A> command. <I>Fraction</I> 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 HREF = "velocity.html">velocity</A> command can be used to create
velocities with zero aggregate linear and/or angular momentum.
</P>
<P><B>Restrictions:</B>
</P>
<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 HREF = "displace_atoms.html">displace_atoms</A> command, which can be used
several times in succession to move atoms a large distance.
</P>
<P>This fix should be specified after integration fixes (<A HREF = "fix_nve.html">fix
nve</A>, <A HREF = "fix_nvt.html">fix_nvt</A>, <A HREF = "fix_npt.html">fix npt</A>,
etc), because the adjustments it makes to atom coordinates should come
after atom coordinates are changed due to time integration. LAMMPS
will warn you if your fixes are not ordered this way.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "fix_momentum.html">fix momentum</A>, <A HREF = "velocity.html">velocity</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are adjust = fix group-ID, and units = lattice.
</P>
</HTML>

Event Timeline