<span id="index-0"></span><h1>displace_atoms command<a class="headerlink" href="#displace-atoms-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>displace_atoms group-ID style args keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>group-ID = ID of group of atoms to displace</li>
<li>style = <em>move</em> or <em>ramp</em> or <em>random</em> or <em>rotate</em></li>
</ul>
<pre class="literal-block">
<em>move</em> args = delx dely delz
delx,dely,delz = distance to displace in each dimension (distance units)
any of delx,dely,delz can be a variable (see below)
<em>ramp</em> args = ddim dlo dhi dim clo chi
ddim = <em>x</em> or <em>y</em> or <em>z</em>
dlo,dhi = displacement distance between dlo and dhi (distance units)
dim = <em>x</em> or <em>y</em> or <em>z</em>
clo,chi = lower and upper bound of domain to displace (distance units)
<em>random</em> args = dx dy dz seed
dx,dy,dz = random displacement magnitude in each dimension (distance units)
seed = random # seed (positive integer)
<em>rotate</em> args = Px Py Pz Rx Ry Rz theta
Px,Py,Pz = origin point of axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector
theta = angle of rotation (degrees)
</pre>
<ul class="simple">
<li>zero or more keyword/value pairs may be appended</li>
</ul>
<pre class="literal-block">
keyword = <em>units</em>
value = <em>box</em> or <em>lattice</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>displace_atoms top move 0 -5 0 units box
displace_atoms flow ramp x 0.0 5.0 y 2.0 20.5
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Displace a group of atoms. This can be used to move atoms a large
distance before beginning a simulation or to randomize atoms initially
on a lattice. For example, in a shear simulation, an initial strain
can be imposed on the system. Or two groups of atoms can be brought
into closer proximity.</p>
<p>The <em>move</em> style displaces the group of atoms by the specified 3d
displacement vector. Any of the 3 quantities defining the vector
components can be specified as an equal-style or atom-style
<a class="reference internal" href="variable.html"><em>variable</em></a>. If the value is a variable, it should be
specified as v_name, where name is the variable name. In this case,
the variable will be evaluated, and its value(s) used for the
displacement(s). The scale factor implied by the <em>units</em> keyword will
also be applied to the variable result.</p>
<p>Equal-style variables can specify formulas with various mathematical
functions, and include <a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a> command
keywords for the simulation box parameters and timestep and elapsed
time. Atom-style variables can specify the same formulas as
equal-style variables but can also include per-atom values, such as
atom coordinates or per-atom values read from a file. Note that if
the variable references other <a class="reference internal" href="compute.html"><em>compute</em></a> or <a class="reference internal" href="fix.html"><em>fix</em></a>
commands, those values must be up-to-date for the current timestep.
See the “Variable Accuracy” section of the <a class="reference internal" href="variable.html"><em>variable</em></a>
doc page for more details.</p>
<p>The <em>ramp</em> style displaces atoms a variable amount in one dimension
depending on the atom’s coordinate in a (possibly) different
dimension. For example, the second example command displaces atoms in
the x-direction an amount between 0.0 and 5.0 distance units. Each
atom’s displacement depends on the fractional distance its y
coordinate is between 2.0 and 20.5. Atoms with y-coordinates outside
those bounds will be moved the minimum (0.0) or maximum (5.0) amount.</p>
<p>The <em>random</em> style independently moves each atom in the group by a
random displacement, uniformly sampled from a value between -dx and
+dx in the x dimension, and similarly for y and z. Random numbers are
used in such a way that the displacement of a particular atom is the
same, regardless of how many processors are being used.</p>
<p>The <em>rotate</em> style rotates each atom in the group by the angle <em>theta</em>
around a rotation axis <em>R</em> = (Rx,Ry,Rz) that goes thru a point <em>P</em> =
(Px,Py,Pz). The direction of rotation for the atoms around the
rotation axis is consistent with the right-hand rule: if your
right-hand’s thumb points along <em>R</em>, then your fingers wrap around the
axis in the direction of positive theta.</p>
<p>Distance units for displacements and the origin point of the <em>rotate</em>
style are determined by the setting of <em>box</em> or <em>lattice</em> for the
<em>units</em> keyword. <em>Box</em> means distance units as defined by the
<a class="reference internal" href="units.html"><em>units</em></a> command - e.g. Angstroms for <em>real</em> units.
<em>Lattice</em> means distance units are in lattice spacings. The
<a class="reference internal" href="lattice.html"><em>lattice</em></a> command must have been previously used to
define the lattice spacing.</p>
<hr class="docutils" />
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Care should be taken not to move atoms on top of other atoms.
After the move, atoms are remapped into the periodic simulation box if
needed, and any shrink-wrap boundary conditions (see the
<a class="reference internal" href="boundary.html"><em>boundary</em></a> command) are enforced which may change the
box size. Other than this effect, this command does not change the
size or shape of the simulation box. See the
<a class="reference internal" href="change_box.html"><em>change_box</em></a> command if that effect is desired.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Atoms can be moved arbitrarily long distances by this command.
If the simulation box is non-periodic and shrink-wrapped (see the
<a class="reference internal" href="boundary.html"><em>boundary</em></a> command), this can change its size or shape.
This is not a problem, except that the mapping of processors to the
simulation box is not changed by this command from its initial 3d
configuration; see the <a class="reference internal" href="processors.html"><em>processors</em></a> command. Thus, if
the box size/shape changes dramatically, the mapping of processors to
the simulation box may not end up as optimal as the initial mapping
attempted to be.</p>
</div>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>You cannot rotate around any rotation vector except the z-axis for a
2d simulation.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
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>.