<em>ix</em>,<em>iy</em>,<em>iz</em> = image flags in each dimension
</pre>
<ulclass="simple">
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>box</em> or <em>replace</em> or <em>purge</em> or <em>trim</em> or <em>add</em> or <em>label</em> or <em>scaled</em> or <em>wrapped</em> or <em>format</em></li>
</ul>
<preclass="literal-block">
<em>box</em> value = <em>yes</em> or <em>no</em> = replace simulation box with dump box
<em>replace</em> value = <em>yes</em> or <em>no</em> = overwrite atoms with dump atoms
<em>purge</em> value = <em>yes</em> or <em>no</em> = delete all atoms before adding dump atoms
<em>trim</em> value = <em>yes</em> or <em>no</em> = trim atoms not in dump snapshot
<em>add</em> value = <em>yes</em> or <em>no</em> = add new dump atoms to system
<em>label</em> value = field column
field = one of the listed fields or <em>id</em> or <em>type</em>
column = label on corresponding column in dump file
<em>scaled</em> value = <em>yes</em> or <em>no</em> = coords in dump file are scaled/unscaled
<em>wrapped</em> value = <em>yes</em> or <em>no</em> = coords in dump file are wrapped/unwrapped
<em>format</em> values = format of dump file, must be last keyword if used
<p>Read atom information from a dump file to overwrite the current atom
coordinates, and optionally the atom velocities and image flags and
the simluation box dimensions. This is useful for restarting a run
from a particular snapshot in a dump file. See the
<aclass="reference internal"href="read_restart.html"><spanclass="doc">read_restart</span></a> and <aclass="reference internal"href="read_data.html"><spanclass="doc">read_data</span></a>
commands for alternative methods to do this. Also see the
<aclass="reference internal"href="rerun.html"><spanclass="doc">rerun</span></a> command for a means of reading multiple snapshots
from a dump file.</p>
<p>Note that a simulation box must already be defined before using the
read_dump command. This can be done by the
<aclass="reference internal"href="create_box.html"><spanclass="doc">create_box</span></a>, <aclass="reference internal"href="read_data.html"><spanclass="doc">read_data</span></a>, or
<aclass="reference internal"href="read_restart.html"><spanclass="doc">read_restart</span></a> commands. The read_dump command can
reset the simulation box dimensions, as explained below.</p>
<p>Also note that reading per-atom information from a dump snapshot is
limited to the atom coordinates, velocities and image flags, as
explained below. Other atom properties, which may be necessary to run
a valid simulation, such as atom charge, or bond topology information
for a molecular system, are not read from (or even contained in) dump
files. Thus this auxiliary information should be defined in the usual
way, e.g. in a data file read in by a <aclass="reference internal"href="read_data.html"><spanclass="doc">read_data</span></a>
command, before using the read_dump command, or by the <aclass="reference internal"href="set.html"><spanclass="doc">set</span></a>
command, after the dump snapshot is read.</p>
<hrclass="docutils"/>
<p>If the dump filename specified as <em>file</em> ends with ”.gz”, the dump
file is read in gzipped format. You cannot (yet) read a dump file
that was written in binary format with a ”.bin” suffix, or to multiple
files via the “%” option in the dump file name. See the
<aclass="reference internal"href="dump.html"><spanclass="doc">dump</span></a> command for details.</p>
<p>The format of the dump file is selected through the <em>format</em> keyword.
If specified, it must be the last keyword used, since all remaining
arguments are passed on to the dump reader. The <em>native</em> format is
for native LAMMPS dump files, written with a <aclass="reference internal"href="dump.html"><spanclass="doc">dump atom</span></a> or
<aclass="reference internal"href="dump.html"><spanclass="doc">dump custom</span></a> command. The <em>xyz</em> format is for generic XYZ
formatted dump files. These formats take no additional values.</p>
<p>The <em>molfile</em> format supports reading data through using the <aclass="reference external"href="vmd">VMD</a>
molfile plugin interface. This dump reader format is only available,
if the USER-MOLFILE package has been installed when compiling
LAMMPS.</p>
<p>The <em>molfile</em> format takes one or two additional values. The <em>style</em>
value determines the file format to be used and can be any format that
the molfile plugins support, such as DCD or XYZ. Note that DCD dump
files can be written by LAMMPS via the <aclass="reference internal"href="dump.html"><spanclass="doc">dump dcd</span></a> command.
The <em>path</em> value specifies a list of directories which LAMMPS will
search for the molfile plugins appropriate to the specified <em>style</em>.
The syntax of the <em>path</em> value is like other search paths: it can
contain multiple directories separated by a colon (or semi-colon on
windows). The <em>path</em> keyword is optional and defaults to ”.”,
i.e. the current directory.</p>
<p>Support for other dump format readers may be added in the future.</p>
<hrclass="docutils"/>
<p>Global information is first read from the dump file, namely timestep
and box information.</p>
<p>The dump file is scanned for a snapshot with a time stamp that matches
the specified <em>Nstep</em>. This means the LAMMPS timestep the dump file
snapshot was written on for the <em>native</em> format. Note that the <em>xyz</em>
and <em>molfile</em> formats do not store the timestep. For these formats,
timesteps are numbered logically, in a sequential manner, starting
from 0. Thus to access the 10th snapshot in an <em>xyz</em> or <em>mofile</em>
formatted dump file, use <em>Nstep</em> = 9.</p>
<p>The dimensions of the simulation box for the selected snapshot are
also read; see the <em>box</em> keyword discussion below. For the <em>native</em>
format, an error is generated if the snapshot is for a triclinic box
and the current simulation box is orthogonal or vice versa. A warning
will be generated if the snapshot box boundary conditions (periodic,
shrink-wrapped, etc) do not match the current simulation boundary
conditions, but the boundary condition information in the snapshot is
otherwise ignored. See the “boundary” command for more details.</p>
<p>For the <em>xyz</em> format, no information about the box is available, so
you must set the <em>box</em> flag to <em>no</em>. See details below.</p>
<p>For the <em>molfile</em> format, reading simulation box information is
typically supported, but the location of the simulation box origin is
lost and no explicit information about periodicity or
orthogonal/triclinic box shape is available. The USER-MOLFILE package
makes a best effort to guess based on heuristics, but this may not
always work perfectly.</p>
<hrclass="docutils"/>
<p>Per-atom information from the dump file snapshot is then read from the
dump file snapshot. This corresponds to the specified <em>fields</em> listed
in the read_dump command. It is an error to specify a z-dimension
field, namely <em>z</em>, <em>vz</em>, or <em>iz</em>, for a 2d simulation.</p>
<p>For dump files in <em>native</em> format, each column of per-atom data has a
text label listed in the file. A matching label for each field must
appear, e.g. the label “vy” for the field <em>vy</em>. For the <em>x</em>, <em>y</em>, <em>z</em>
fields any of the following labels are considered a match:</p>
<preclass="literal-block">
x, xs, xu, xsu for field <em>x</em>
y, ys, yu, ysu for field <em>y</em>
z, zs, zu, zsu for field <em>z</em>
</pre>
<p>The meaning of xs (scaled), xu (unwrapped), and xsu (scaled and
unwrapped) is explained on the <aclass="reference internal"href="dump.html"><spanclass="doc">dump</span></a> command doc page.
These labels are searched for in the list of column labels in the dump
file, in order, until a match is found.</p>
<p>The dump file must also contain atom IDs, with a column label of “id”.</p>
<p>If the <em>add</em> keyword is specified with a value of <em>yes</em>, as discussed
below, the dump file must contain atom types, with a column label of
“type”.</p>
<p>If a column label you want to read from the dump file is not a match
to a specified field, the <em>label</em> keyword can be used to specify the
specific column label from the dump file to associate with that field.
An example is if a time-averaged coordinate is written to the dump
file via the <aclass="reference internal"href="fix_ave_atom.html"><spanclass="doc">fix ave/atom</span></a> command. The column
will then have a label corresponding to the fix-ID rather than “x” or
“xs”. The <em>label</em> keyword can also be used to specify new column
labels for fields <em>id</em> and <em>type</em>.</p>
<p>For dump files in <em>xyz</em> format, only the <em>x</em>, <em>y</em>, and <em>z</em> fields are
supported. The dump file does not store atom IDs, so these are
assigned consecutively to the atoms as they appear in the dump file,
starting from 1. Thus you should insure that order of atoms is
consistent from snapshot to snapshot in the the XYZ dump file. See
the <aclass="reference internal"href="dump_modify.html"><spanclass="doc">dump_modify sort</span></a> command if the XYZ dump file
was written by LAMMPS.</p>
<p>For dump files in <em>molfile</em> format, the <em>x</em>, <em>y</em>, <em>z</em>, <em>vx</em>, <em>vy</em>, and
<em>vz</em> fields can be specified. However, not all molfile formats store
velocities, or their respective plugins may not support reading of
velocities. The molfile dump files do not store atom IDs, so these
are assigned consecutively to the atoms as they appear in the dump
file, starting from 1. Thus you should insure that order of atoms are
consistent from snapshot to snapshot in the the molfile dump file.
See the <aclass="reference internal"href="dump_modify.html"><spanclass="doc">dump_modify sort</span></a> command if the dump file
was written by LAMMPS.</p>
<hrclass="docutils"/>
<p>Information from the dump file snapshot is used to overwrite or
replace properties of the current system. There are various options
for how this is done, determined by the specified fields and optional
keywords.</p>
<p>The timestep of the snapshot becomes the current timestep for the
simulation. See the <aclass="reference internal"href="reset_timestep.html"><spanclass="doc">reset_timestep</span></a> command if
you wish to change this after the dump snapshot is read.</p>
<p>If the <em>box</em> keyword is specified with a <em>yes</em> value, then the current
simulation box dimensions are replaced by the dump snapshot box
dimensions. If the <em>box</em> keyword is specified with a <em>no</em> value, the
current simulatoin box is unchanged.</p>
<p>If the <em>purge</em> keyword is specified with a <em>yes</em> value, then all
current atoms in the system are deleted before any of the operations
invoked by the <em>replace</em>, <em>trim</em>, or <em>add</em> keywords take place.</p>
<p>If the <em>replace</em> keyword is specified with a <em>yes</em> value, then atoms
with IDs that are in both the current system and the dump snapshot
have their properties overwritten by field values. If the <em>replace</em>
keyword is specified with a <em>no</em> value, atoms with IDs that are in
both the current system and the dump snapshot are not modified.</p>
<p>If the <em>trim</em> keyword is specified with a <em>yes</em> value, then atoms with
IDs that are in the current system but not in the dump snapshot are
deleted. These atoms are unaffected if the <em>trim</em> keyword is
specified with a <em>no</em> value.</p>
<p>If the <em>add</em> keyword is specified with a <em>yes</em> value, then atoms with
IDs that are in the dump snapshot, but not in the current system are
added to the system. These dump atoms are ignored if the <em>add</em>
keyword is specified with a <em>no</em> value.</p>
<p>Note that atoms added via the <em>add</em> keyword will have only the
attributes read from the dump file due to the <em>field</em> arguments. If
<em>x</em> or <em>y</em> or <em>z</em> is not specified as a field, a value of 0.0 is used
for added atoms. Added atoms must have an atom type, so this value
must appear in the dump file.</p>
<p>Any other attributes (e.g. charge or particle diameter for spherical
particles) will be set to default values, the same as if the
<aclass="reference internal"href="create_atoms.html"><spanclass="doc">create_atoms</span></a> command were used.</p>
<p>Note that atom IDs are not preserved for new dump snapshot atoms added
via the <em>add</em> keyword. The procedure for assigning new atom IDS to
<p>Atom coordinates read from the dump file are first converted into
unscaled coordinates, relative to the box dimensions of the snapshot.
These coordinates are then be assigned to an existing or new atom in
the current simulation. The coordinates will then be remapped to the
simulation box, whether it is the original box or the dump snapshot
box. If periodic boundary conditions apply, this means the atom will
be remapped back into the simulation box if necessary. If shrink-wrap
boundary conditions apply, the new coordinates may change the
simulation box dimensions. If fixed boundary conditions apply, the
atom will be lost if it is outside the simulation box.</p>
<p>For <em>native</em> format dump files, the 3 xyz image flags for an atom in
the dump file are set to the corresponding values appearing in the
dump file if the <em>ix</em>, <em>iy</em>, <em>iz</em> fields are specified. If not
specified, the image flags for replaced atoms are not changed and
image flags for new atoms are set to default values. If coordinates
read from the dump file are in unwrapped format (e.g. <em>xu</em>) then the
image flags for read-in atoms are also set to default values. The
remapping procedure described in the previous paragraph will then
change images flags for all atoms (old and new) if periodic boundary
conditions are applied to remap an atom back into the simulation box.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">If you get a warning about inconsistent image flags after
reading in a dump snapshot, it means one or more pairs of bonded atoms
now have inconsistent image flags. As discussed in <aclass="reference internal"href="Section_errors.html"><spanclass="doc">Section errors</span></a> this may or may not cause problems for
subsequent simulations, One way this can happen is if you read image
flag fields from the dump file but do not also use the dump file box
parameters.</p>
</div>
<p>LAMMPS knows how to compute unscaled and remapped coordinates for the
snapshot column labels discussed above, e.g. <em>x</em>, <em>xs</em>, <em>xu</em>, <em>xsu</em>.
If another column label is assigned to the <em>x</em> or <em>y</em> or <em>z</em> field via
the <em>label</em> keyword, e.g. for coordinates output by the <aclass="reference internal"href="fix_ave_atom.html"><spanclass="doc">fix ave/atom</span></a> command, then LAMMPS needs to know whether
the coordinate information in the dump file is scaled and/or wrapped.
This can be set via the <em>scaled</em> and <em>wrapped</em> keywords. Note that
the value of the <em>scaled</em> and <em>wrapped</em> keywords is ignored for fields
<em>x</em> or <em>y</em> or <em>z</em> if the <em>label</em> keyword is not used to assign a
column label to that field.</p>
<p>The scaled/unscaled and wrapped/unwrapped setting must be identical
for any of the <em>x</em>, <em>y</em>, <em>z</em> fields that are specified. Thus you
cannot read <em>xs</em> and <em>yu</em> from the dump file. Also, if the dump file
coordinates are scaled and the simulation box is triclinic, then all 3
of the <em>x</em>, <em>y</em>, <em>z</em> fields must be specified, since they are all
needed to generate absolute, unscaled coordinates.</p>
</div>
<hrclass="docutils"/>
<divclass="section"id="restrictions">
<h2>Restrictions</h2>
<p>To read gzipped dump files, you must compile LAMMPS with the
-DLAMMPS_GZIP option - see the <aclass="reference internal"href="Section_start.html#start-2"><spanclass="std std-ref">Making LAMMPS</span></a> section of the documentation.</p>
<p>The <em>molfile</em> dump file formats are part of the USER-MOLFILE package.
They are only enabled if LAMMPS was built with that packages. See the
<aclass="reference internal"href="Section_start.html#start-3"><spanclass="std std-ref">Making LAMMPS</span></a> section for more info.</p>
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>.