2012-06-02 00:41:20 +08:00
< 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 > read_dump command
< / H3 >
< P > < B > Syntax:< / B >
< / P >
< PRE > read_dump file Nstep field1 field2 ... keyword values ...
< / PRE >
< UL > < LI > file = name of dump file to read
< LI > Nstep = snapshot timestep to read from file
< LI > one or more fields may be appended
2013-09-19 01:18:03 +08:00
< PRE > field = < I > x< / I > or < I > y< / I > or < I > z< / I > or < I > vx< / I > or < I > vy< / I > or < I > vz< / I > or < I > q< / I > or < I > ix< / I > or < I > iy< / I > or < I > iz< / I >
2012-06-02 00:41:20 +08:00
< I > x< / I > ,< I > y< / I > ,< I > z< / I > = atom coordinates
< I > vx< / I > ,< I > vy< / I > ,< I > vz< / I > = velocity components
2013-09-19 01:18:03 +08:00
< I > q< / I > = charge
2012-06-02 00:41:20 +08:00
< I > ix< / I > ,< I > iy< / I > ,< I > iz< / I > = image flags in each dimension
< / PRE >
< LI > zero or more keyword/value pairs may be appended
2013-09-19 01:18:03 +08:00
< LI > keyword = < I > box< / I > or < I > replace< / I > or < I > purge< / I > or < I > trim< / I > or < I > add< / I > or < I > label< / I > or < I > scaled< / I > or < I > wrapped< / I > or < I > format< / I >
2012-06-02 00:41:20 +08:00
< PRE > < I > box< / I > value = < I > yes< / I > or < I > no< / I > = replace simulation box with dump box
< I > replace< / I > value = < I > yes< / I > or < I > no< / I > = overwrite atoms with dump atoms
< I > purge< / I > value = < I > yes< / I > or < I > no< / I > = delete all atoms before adding dump atoms
< I > trim< / I > value = < I > yes< / I > or < I > no< / I > = trim atoms not in dump snapshot
< I > add< / I > value = < I > yes< / I > or < I > no< / I > = add new dump atoms to system
< I > label< / I > value = field column
field = one of the listed fields or < I > id< / I > or < I > type< / I >
column = label on corresponding column in dump file
< I > scaled< / I > value = < I > yes< / I > or < I > no< / I > = coords in dump file are scaled/unscaled
2013-09-19 01:18:03 +08:00
< I > wrapped< / I > value = < I > yes< / I > or < I > no< / I > = coords in dump file are wrapped/unwrapped
2012-06-20 02:59:05 +08:00
< I > format< / I > values = format of dump file, must be last keyword if used
< I > native< / I > = native LAMMPS dump file
< I > xyz< / I > = XYZ file
< I > molfile< / I > style path = VMD molfile plugin interface
2014-06-11 23:43:21 +08:00
style = < I > dcd< / I > or < I > xyz< / I > or others supported by my molfile plugins
2012-06-20 02:59:05 +08:00
path = optional path for location of molfile plugins
2012-06-02 00:41:20 +08:00
< / PRE >
< / UL >
< P > < B > Examples:< / B >
< / P >
< PRE > read_dump dump.file 5000 x y z
2014-06-11 23:43:21 +08:00
read_dump dump.xyz 5 x y z box no format xyz
read_dump dump.xyz 10 x y z box no format molfile xyz "../plugins"
read_dump dump.dcd 0 x y z box yes format molfile dcd
read_dump dump.file 1000 x y z vx vy vz box yes format molfile lammpstrj /usr/local/lib/vmd/plugins/LINUXAMD64/plugins/molfile
2012-06-02 00:41:20 +08:00
read_dump dump.file 5000 x y vx vy trim yes
read_dump ../run7/dump.file.gz 10000 x y z box yes
2012-06-20 02:59:05 +08:00
read_dump dump.xyz 10 x y z box no format molfile xyz ../plugins
read_dump dump.dcd 0 x y z format molfile dcd
read_dump dump.file 1000 x y z vx vy vz format molfile lammpstrj /usr/local/lib/vmd/plugins/LINUXAMD64/plugins/molfile
2012-06-02 00:41:20 +08:00
< / PRE >
< P > < B > Description:< / B >
< / P >
< 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
< A HREF = "read_restart.html" > read_restart< / A > and < A HREF = "read_data.html" > read_data< / A >
2013-11-23 01:34:49 +08:00
commands for alternative methods to do this. Also see the
< A HREF = "rerun.html" > rerun< / A > command for a means of reading multiple snapshots
from a dump file.
2012-06-02 00:41:20 +08:00
< / P >
< P > Note that a simulation box must already be defined before using the
read_dump command. This can be done by the
< A HREF = "create_box.html" > create_box< / A > , < A HREF = "read_data.html" > read_data< / A > , or
< A HREF = "read_restart.html" > read_restart< / 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 < A HREF = "read_data.html" > read_data< / A >
command, before using the read_dump command, or by the < A HREF = "set.html" > set< / A >
command, after the dump snapshot is read.
< / P >
< HR >
2012-06-20 02:59:05 +08:00
< P > If the dump filename specified as < I > file< / I > 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
< A HREF = "dump.html" > dump< / A > command for details.
< / P >
< P > The format of the dump file is selected through the < I > format< / I > keyword.
If specified, it must be the last keyword used, since all remaining
arguments are passed on to the dump reader. The < I > native< / I > format is
for native LAMMPS dump files, written with a "dump atom".html or < A HREF = "dump.html" > dump
custom< / A > command. The < I > xyz< / I > format is for generic XYZ
2014-06-11 23:43:21 +08:00
formatted dump files. These formats take no additional values.
2012-06-20 02:59:05 +08:00
< / P >
< P > The < I > molfile< / I > format supports reading data through using the < A 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 < I > molfile< / I > format takes one or two additional values. The < I > style< / I >
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 < A HREF = "dump.html" > dump dcd< / A > command.
The < I > path< / I > value specifies a list of directories which LAMMPS will
search for the molfile plugins appropriate to the specified < I > style< / I > .
The syntax of the < I > path< / I > value is like other search paths: it can
contain multiple directories separated by a colon (or semi-colon on
windows). The < I > path< / I > 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.
2012-06-02 00:41:20 +08:00
< / P >
2012-06-20 02:59:05 +08:00
< HR >
< P > Global information is first read from the dump file, namely timestep
and box information.
2012-06-02 00:41:20 +08:00
< / P >
< P > The dump file is scanned for a snapshot with a time stamp that matches
2012-06-20 02:59:05 +08:00
the specified < I > Nstep< / I > . This means the LAMMPS timestep the dump file
2014-04-30 23:17:18 +08:00
snapshot was written on for the < I > native< / I > format. Note that the < I > xyz< / I >
2012-06-20 02:59:05 +08:00
and < I > molfile< / I > 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 < I > xyz< / I > or < I > mofile< / I >
formatted dump file, use < I > Nstep< / I > = 9.
< / P >
< P > The dimensions of the simulation box for the selected snapshot are
also read; see the < I > box< / I > keyword discussion below. For the < I > native< / I >
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,
2012-06-02 00:41:20 +08:00
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 >
2012-06-20 02:59:05 +08:00
< P > For the < I > xyz< / I > format, no information about the box is available, so
you must set the < I > box< / I > flag to < I > no< / I > . See details below.
< / P >
< P > For the < I > molfile< / I > 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 >
< HR >
< P > Per-atom information from the dump file snapshot is then read from the
2013-09-19 01:18:03 +08:00
dump file snapshot. This corresponds to the specified < I > fields< / I > listed
in the read_dump command. It is an error to specify a z-dimension
field, namely < I > z< / I > , < I > vz< / I > , or < I > iz< / I > , for a 2d simulation.
2012-06-02 00:41:20 +08:00
< / P >
2012-06-20 02:59:05 +08:00
< P > For dump files in < I > native< / I > 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 < I > vy< / I > . For the < I > x< / I > , < I > y< / I > , < I > z< / I >
fields any of the following labels are considered a match:
2012-06-02 00:41:20 +08:00
< / P >
< PRE > x, xs, xu, xsu for field < I > x< / I >
y, ys, yu, ysu for field < I > y< / I >
z, zs, zu, zsu for field < I > z< / I >
< / PRE >
< P > The meaning of xs (scaled), xu (unwrapped), and xsu (scaled and
unwrapped) is explained on the < A HREF = "dump.html" > dump< / 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 >
2012-06-20 02:59:05 +08:00
< P > If the < I > add< / I > keyword is specified with a value of < I > yes< / I > , as discussed
below, the dump file must contain atom types, with a column label of
"type".
< / P >
2013-09-19 01:18:03 +08:00
< P > If a column label you want to read from the dump file is not a match
to a specified field, the < I > label< / I > 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 < A HREF = "fix_ave_atom.html" > fix ave/atom< / A > command. The column
will then have a label corresponding to the fix-ID rather than "x" or
"xs". The < I > label< / I > keyword can also be used to specify new column
labels for fields < I > id< / I > and < I > type< / I > .
2012-06-20 02:59:05 +08:00
< / P >
< P > For dump files in < I > xyz< / I > format, only the < I > x< / I > , < I > y< / I > , and < I > z< / I > 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 < A HREF = "dump_modify.html" > dump_modify sort< / A > command if the XYZ dump file
was written by LAMMPS.
< / P >
< P > For dump files in < I > molfile< / I > format, the < I > x< / I > , < I > y< / I > , < I > z< / I > , < I > vx< / I > , < I > vy< / I > , and
< I > vz< / I > 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 < A HREF = "dump_modify.html" > dump_modify sort< / A > command if the dump file
was written by LAMMPS.
2012-06-02 00:41:20 +08:00
< / P >
< HR >
< 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 < A HREF = "reset_timestep.html" > reset_timestep< / A > command if
you wish to change this after the dump snapshot is read.
< / P >
< P > If the < I > box< / I > keyword is specified with a < I > yes< / I > value, then the current
simulation box dimensions are replaced by the dump snapshot box
dimensions. If the < I > box< / I > keyword is specified with a < I > no< / I > value, the
current simulatoin box is unchanged.
< / P >
< P > If the < I > purge< / I > keyword is specified with a < I > yes< / I > value, then all
current atoms in the system are deleted before any of the operations
invoked by the < I > replace< / I > , < I > trim< / I > , or < I > add< / I > keywords take place.
< / P >
< P > If the < I > replace< / I > keyword is specified with a < I > yes< / I > 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 < I > replace< / I >
keyword is specified with a < I > no< / I > value, atoms with IDs that are in
both the current system and the dump snapshot are not modified.
< / P >
< P > If the < I > trim< / I > keyword is specified with a < I > yes< / I > 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 < I > trim< / I > keyword is
specified with a < I > no< / I > value.
< / P >
< P > If the < I > add< / I > keyword is specified with a < I > yes< / I > value, then atoms with
IDs that are in the dump snapshot, but not in the current system are
2012-06-20 02:59:05 +08:00
added to the system. These dump atoms are ignored if the < I > add< / I >
keyword is specified with a < I > no< / I > value.
2012-06-02 00:41:20 +08:00
< / P >
< P > Note that atoms added via the < I > add< / I > keyword will have only the
attributes read from the dump file due to the < I > field< / I > arguments. If
< I > x< / I > or < I > y< / I > or < I > z< / I > is not specified as a field, a value of 0.0 is used
2012-06-20 02:59:05 +08:00
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
< A HREF = "create_atoms.html" > create_atoms< / A > command were used.
2012-06-02 00:41:20 +08:00
< / P >
< P > Note that atom IDs are not preserved for new dump snapshot atoms added
via the < I > add< / I > keyword. The procedure for assigning new atom IDS to
added atoms is the same as is described for the
< A HREF = "create_atoms.html" > create_atoms< / A > command.
< / P >
< HR >
2013-09-19 01:18:03 +08:00
< P > Atom coordinates read from the dump file are first converted into
2012-06-02 00:41:20 +08:00
unscaled coordinates, relative to the box dimensions of the snapshot.
2013-09-19 01:18:03 +08:00
These coordinates are then be assigned to an existing or new atom in
the current simulation. The coordinates will then be remapped to the
2012-06-02 00:41:20 +08:00
simulation box, whether it is the original box or the dump snapshot
2013-09-19 01:18:03 +08:00
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.
2012-06-02 00:41:20 +08:00
< / P >
2012-06-20 02:59:05 +08:00
< P > For < I > native< / I > 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 < I > ix< / I > , < I > iy< / I > , < I > iz< / I > fields are specified. If not
2012-06-02 00:41:20 +08:00
specified, the image flags for replaced atoms are not changed and
2013-09-19 01:18:03 +08:00
image flags for new atoms are set to default values. If coordinates
read from the dump file are in unwrapped format (e.g. < I > xu< / I > ) 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 >
< P > IMPORTANT NOTE: 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 < A HREF = "Section_errors.html" > Section
errors< / 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 >
< P > LAMMPS knows how to compute unscaled and remapped coordinates for the
2012-06-02 00:41:20 +08:00
snapshot column labels discussed above, e.g. < I > x< / I > , < I > xs< / I > , < I > xu< / I > , < I > xsu< / I > .
If another column label is assigned to the < I > x< / I > or < I > y< / I > or < I > z< / I > field via
the < I > label< / I > keyword, e.g. for coordinates output by the < A HREF = "fix_ave_atom.html" > fix
ave/atom< / A > command, then LAMMPS needs to know whether
2013-09-19 01:18:03 +08:00
the coordinate information in the dump file is scaled and/or wrapped.
This can be set via the < I > scaled< / I > and < I > wrapped< / I > keywords. Note that
the value of the < I > scaled< / I > and < I > wrapped< / I > keywords is ignored for fields
< I > x< / I > or < I > y< / I > or < I > z< / I > if the < I > label< / I > 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 < I > x< / I > , < I > y< / I > , < I > z< / I > fields that are specified. Thus you
cannot read < I > xs< / I > and < I > yu< / I > from the dump file. Also, if the dump file
coordinates are scaled and the simulation box is triclinic, then all 3
of the < I > x< / I > , < I > y< / I > , < I > z< / I > fields must be specified, since they are all
needed to generate absolute, unscaled coordinates.
2012-06-02 00:41:20 +08:00
< / P >
< HR >
< P > < B > Restrictions:< / B >
< / P >
< P > To read gzipped dump files, you must compile LAMMPS with the
-DLAMMPS_GZIP option - see the < A HREF = "Section_start.html#start_2" > Making
LAMMPS< / A > section of the documentation.
< / P >
2012-06-20 02:59:05 +08:00
< P > The < I > molfile< / I > dump file formats are part of the USER-MOLFILE package.
They are only enabled if LAMMPS was built with that packages. See the
< A HREF = "Section_start.html#start_3" > Making LAMMPS< / A > section for more info.
< / P >
2012-06-02 00:41:20 +08:00
< P > < B > Related commands:< / B >
< / P >
2012-06-20 02:59:05 +08:00
< P > < A HREF = "dump.html" > dump< / A > , < A HREF = "dump_molfile.html" > dump molfile< / A > ,
< A HREF = "read_data.html" > read_data< / A > , < A HREF = "read_restart.html" > read_restart< / A > ,
< A HREF = "rerun.html" > rerun< / A >
2012-06-02 00:41:20 +08:00
< / P >
< P > < B > Default:< / B >
< / P >
< P > The option defaults are box = yes, replace = yes, purge = no, trim =
2013-09-19 01:18:03 +08:00
no, add = no, scaled = no, wrapped = yes, and format = native.
2012-06-02 00:41:20 +08:00
< / P >
< / HTML >