1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
5 :link(lc,Section_commands.html#comm)
13 read_dump file Nstep field1 field2 ... keyword values ... :pre
15 file = name of dump file to read :ulb,l
16 Nstep = snapshot timestep to read from file :l
17 one or more fields may be appended :l
18 field = {x} or {y} or {z} or {vx} or {vy} or {vz} or {q} or {ix} or {iy} or {iz} or {fx} or {fy} or {fz}
19 {x},{y},{z} = atom coordinates
20 {vx},{vy},{vz} = velocity components
22 {ix},{iy},{iz} = image flags in each dimension
23 {fx},{fy},{fz} = force components :pre
24 zero or more keyword/value pairs may be appended :l
25 keyword = {box} or {replace} or {purge} or {trim} or {add} or {label} or {scaled} or {wrapped} or {format} :l
26 {box} value = {yes} or {no} = replace simulation box with dump box
27 {replace} value = {yes} or {no} = overwrite atoms with dump atoms
28 {purge} value = {yes} or {no} = delete all atoms before adding dump atoms
29 {trim} value = {yes} or {no} = trim atoms not in dump snapshot
30 {add} value = {yes} or {no} = add new dump atoms to system
31 {label} value = field column
32 field = one of the listed fields or {id} or {type}
33 column = label on corresponding column in dump file
34 {scaled} value = {yes} or {no} = coords in dump file are scaled/unscaled
35 {wrapped} value = {yes} or {no} = coords in dump file are wrapped/unwrapped
36 {format} values = format of dump file, must be last keyword if used
37 {native} = native LAMMPS dump file
39 {molfile} style path = VMD molfile plugin interface
40 style = {dcd} or {xyz} or others supported by molfile plugins
41 path = optional path for location of molfile plugins :pre
46 read_dump dump.file 5000 x y z
47 read_dump dump.xyz 5 x y z box no format xyz
48 read_dump dump.xyz 10 x y z box no format molfile xyz "../plugins"
49 read_dump dump.dcd 0 x y z box yes format molfile dcd
50 read_dump dump.file 1000 x y z vx vy vz box yes format molfile lammpstrj /usr/local/lib/vmd/plugins/LINUXAMD64/plugins/molfile
51 read_dump dump.file 5000 x y vx vy trim yes
52 read_dump ../run7/dump.file.gz 10000 x y z box yes
53 read_dump dump.xyz 10 x y z box no format molfile xyz ../plugins
54 read_dump dump.dcd 0 x y z format molfile dcd
55 read_dump dump.file 1000 x y z vx vy vz format molfile lammpstrj /usr/local/lib/vmd/plugins/LINUXAMD64/plugins/molfile :pre
59 Read atom information from a dump file to overwrite the current atom
60 coordinates, and optionally the atom velocities and image flags and
61 the simluation box dimensions. This is useful for restarting a run
62 from a particular snapshot in a dump file. See the
63 "read_restart"_read_restart.html and "read_data"_read_data.html
64 commands for alternative methods to do this. Also see the
65 "rerun"_rerun.html command for a means of reading multiple snapshots
68 Note that a simulation box must already be defined before using the
69 read_dump command. This can be done by the
70 "create_box"_create_box.html, "read_data"_read_data.html, or
71 "read_restart"_read_restart.html commands. The read_dump command can
72 reset the simulation box dimensions, as explained below.
74 Also note that reading per-atom information from a dump snapshot is
75 limited to the atom coordinates, velocities and image flags, as
76 explained below. Other atom properties, which may be necessary to run
77 a valid simulation, such as atom charge, or bond topology information
78 for a molecular system, are not read from (or even contained in) dump
79 files. Thus this auxiliary information should be defined in the usual
80 way, e.g. in a data file read in by a "read_data"_read_data.html
81 command, before using the read_dump command, or by the "set"_set.html
82 command, after the dump snapshot is read.
86 If the dump filename specified as {file} ends with ".gz", the dump
87 file is read in gzipped format. You cannot (yet) read a dump file
88 that was written in binary format with a ".bin" suffix, or to multiple
89 files via the "%" option in the dump file name. See the
90 "dump"_dump.html command for details.
92 The format of the dump file is selected through the {format} keyword.
93 If specified, it must be the last keyword used, since all remaining
94 arguments are passed on to the dump reader. The {native} format is
95 for native LAMMPS dump files, written with a "dump atom"_dump.html or
96 "dump custom"_dump.html command. The {xyz} format is for generic XYZ
97 formatted dump files. These formats take no additional values.
99 The {molfile} format supports reading data through using the "VMD"_vmd
100 molfile plugin interface. This dump reader format is only available,
101 if the USER-MOLFILE package has been installed when compiling
104 The {molfile} format takes one or two additional values. The {style}
105 value determines the file format to be used and can be any format that
106 the molfile plugins support, such as DCD or XYZ. Note that DCD dump
107 files can be written by LAMMPS via the "dump dcd"_dump.html command.
108 The {path} value specifies a list of directories which LAMMPS will
109 search for the molfile plugins appropriate to the specified {style}.
110 The syntax of the {path} value is like other search paths: it can
111 contain multiple directories separated by a colon (or semi-colon on
112 windows). The {path} keyword is optional and defaults to ".",
113 i.e. the current directory.
115 Support for other dump format readers may be added in the future.
119 Global information is first read from the dump file, namely timestep
122 The dump file is scanned for a snapshot with a time stamp that matches
123 the specified {Nstep}. This means the LAMMPS timestep the dump file
124 snapshot was written on for the {native} format. Note that the {xyz}
125 and {molfile} formats do not store the timestep. For these formats,
126 timesteps are numbered logically, in a sequential manner, starting
127 from 0. Thus to access the 10th snapshot in an {xyz} or {mofile}
128 formatted dump file, use {Nstep} = 9.
130 The dimensions of the simulation box for the selected snapshot are
131 also read; see the {box} keyword discussion below. For the {native}
132 format, an error is generated if the snapshot is for a triclinic box
133 and the current simulation box is orthogonal or vice versa. A warning
134 will be generated if the snapshot box boundary conditions (periodic,
135 shrink-wrapped, etc) do not match the current simulation boundary
136 conditions, but the boundary condition information in the snapshot is
137 otherwise ignored. See the "boundary" command for more details.
139 For the {xyz} format, no information about the box is available, so
140 you must set the {box} flag to {no}. See details below.
142 For the {molfile} format, reading simulation box information is
143 typically supported, but the location of the simulation box origin is
144 lost and no explicit information about periodicity or
145 orthogonal/triclinic box shape is available. The USER-MOLFILE package
146 makes a best effort to guess based on heuristics, but this may not
147 always work perfectly.
151 Per-atom information from the dump file snapshot is then read from the
152 dump file snapshot. This corresponds to the specified {fields} listed
153 in the read_dump command. It is an error to specify a z-dimension
154 field, namely {z}, {vz}, or {iz}, for a 2d simulation.
156 For dump files in {native} format, each column of per-atom data has a
157 text label listed in the file. A matching label for each field must
158 appear, e.g. the label "vy" for the field {vy}. For the {x}, {y}, {z}
159 fields any of the following labels are considered a match:
161 x, xs, xu, xsu for field {x}
162 y, ys, yu, ysu for field {y}
163 z, zs, zu, zsu for field {z} :pre
165 The meaning of xs (scaled), xu (unwrapped), and xsu (scaled and
166 unwrapped) is explained on the "dump"_dump.html command doc page.
167 These labels are searched for in the list of column labels in the dump
168 file, in order, until a match is found.
170 The dump file must also contain atom IDs, with a column label of "id".
172 If the {add} keyword is specified with a value of {yes}, as discussed
173 below, the dump file must contain atom types, with a column label of
176 If a column label you want to read from the dump file is not a match
177 to a specified field, the {label} keyword can be used to specify the
178 specific column label from the dump file to associate with that field.
179 An example is if a time-averaged coordinate is written to the dump
180 file via the "fix ave/atom"_fix_ave_atom.html command. The column
181 will then have a label corresponding to the fix-ID rather than "x" or
182 "xs". The {label} keyword can also be used to specify new column
183 labels for fields {id} and {type}.
185 For dump files in {xyz} format, only the {x}, {y}, and {z} fields are
186 supported. The dump file does not store atom IDs, so these are
187 assigned consecutively to the atoms as they appear in the dump file,
188 starting from 1. Thus you should insure that order of atoms is
189 consistent from snapshot to snapshot in the XYZ dump file. See
190 the "dump_modify sort"_dump_modify.html command if the XYZ dump file
191 was written by LAMMPS.
193 For dump files in {molfile} format, the {x}, {y}, {z}, {vx}, {vy}, and
194 {vz} fields can be specified. However, not all molfile formats store
195 velocities, or their respective plugins may not support reading of
196 velocities. The molfile dump files do not store atom IDs, so these
197 are assigned consecutively to the atoms as they appear in the dump
198 file, starting from 1. Thus you should insure that order of atoms are
199 consistent from snapshot to snapshot in the molfile dump file.
200 See the "dump_modify sort"_dump_modify.html command if the dump file
201 was written by LAMMPS.
205 Information from the dump file snapshot is used to overwrite or
206 replace properties of the current system. There are various options
207 for how this is done, determined by the specified fields and optional
210 The timestep of the snapshot becomes the current timestep for the
211 simulation. See the "reset_timestep"_reset_timestep.html command if
212 you wish to change this after the dump snapshot is read.
214 If the {box} keyword is specified with a {yes} value, then the current
215 simulation box dimensions are replaced by the dump snapshot box
216 dimensions. If the {box} keyword is specified with a {no} value, the
217 current simulatoin box is unchanged.
219 If the {purge} keyword is specified with a {yes} value, then all
220 current atoms in the system are deleted before any of the operations
221 invoked by the {replace}, {trim}, or {add} keywords take place.
223 If the {replace} keyword is specified with a {yes} value, then atoms
224 with IDs that are in both the current system and the dump snapshot
225 have their properties overwritten by field values. If the {replace}
226 keyword is specified with a {no} value, atoms with IDs that are in
227 both the current system and the dump snapshot are not modified.
229 If the {trim} keyword is specified with a {yes} value, then atoms with
230 IDs that are in the current system but not in the dump snapshot are
231 deleted. These atoms are unaffected if the {trim} keyword is
232 specified with a {no} value.
234 If the {add} keyword is specified with a {yes} value, then atoms with
235 IDs that are in the dump snapshot, but not in the current system are
236 added to the system. These dump atoms are ignored if the {add}
237 keyword is specified with a {no} value.
239 Note that atoms added via the {add} keyword will have only the
240 attributes read from the dump file due to the {field} arguments. If
241 {x} or {y} or {z} is not specified as a field, a value of 0.0 is used
242 for added atoms. Added atoms must have an atom type, so this value
243 must appear in the dump file.
245 Any other attributes (e.g. charge or particle diameter for spherical
246 particles) will be set to default values, the same as if the
247 "create_atoms"_create_atoms.html command were used.
249 Note that atom IDs are not preserved for new dump snapshot atoms added
250 via the {add} keyword. The procedure for assigning new atom IDS to
251 added atoms is the same as is described for the
252 "create_atoms"_create_atoms.html command.
256 Atom coordinates read from the dump file are first converted into
257 unscaled coordinates, relative to the box dimensions of the snapshot.
258 These coordinates are then be assigned to an existing or new atom in
259 the current simulation. The coordinates will then be remapped to the
260 simulation box, whether it is the original box or the dump snapshot
261 box. If periodic boundary conditions apply, this means the atom will
262 be remapped back into the simulation box if necessary. If shrink-wrap
263 boundary conditions apply, the new coordinates may change the
264 simulation box dimensions. If fixed boundary conditions apply, the
265 atom will be lost if it is outside the simulation box.
267 For {native} format dump files, the 3 xyz image flags for an atom in
268 the dump file are set to the corresponding values appearing in the
269 dump file if the {ix}, {iy}, {iz} fields are specified. If not
270 specified, the image flags for replaced atoms are not changed and
271 image flags for new atoms are set to default values. If coordinates
272 read from the dump file are in unwrapped format (e.g. {xu}) then the
273 image flags for read-in atoms are also set to default values. The
274 remapping procedure described in the previous paragraph will then
275 change images flags for all atoms (old and new) if periodic boundary
276 conditions are applied to remap an atom back into the simulation box.
278 NOTE: If you get a warning about inconsistent image flags after
279 reading in a dump snapshot, it means one or more pairs of bonded atoms
280 now have inconsistent image flags. As discussed in "Section
281 errors"_Section_errors.html this may or may not cause problems for
282 subsequent simulations, One way this can happen is if you read image
283 flag fields from the dump file but do not also use the dump file box
286 LAMMPS knows how to compute unscaled and remapped coordinates for the
287 snapshot column labels discussed above, e.g. {x}, {xs}, {xu}, {xsu}.
288 If another column label is assigned to the {x} or {y} or {z} field via
289 the {label} keyword, e.g. for coordinates output by the "fix
290 ave/atom"_fix_ave_atom.html command, then LAMMPS needs to know whether
291 the coordinate information in the dump file is scaled and/or wrapped.
292 This can be set via the {scaled} and {wrapped} keywords. Note that
293 the value of the {scaled} and {wrapped} keywords is ignored for fields
294 {x} or {y} or {z} if the {label} keyword is not used to assign a
295 column label to that field.
297 The scaled/unscaled and wrapped/unwrapped setting must be identical
298 for any of the {x}, {y}, {z} fields that are specified. Thus you
299 cannot read {xs} and {yu} from the dump file. Also, if the dump file
300 coordinates are scaled and the simulation box is triclinic, then all 3
301 of the {x}, {y}, {z} fields must be specified, since they are all
302 needed to generate absolute, unscaled coordinates.
308 To read gzipped dump files, you must compile LAMMPS with the
309 -DLAMMPS_GZIP option - see the "Making
310 LAMMPS"_Section_start.html#start_2 section of the documentation.
312 The {molfile} dump file formats are part of the USER-MOLFILE package.
313 They are only enabled if LAMMPS was built with that packages. See the
314 "Making LAMMPS"_Section_start.html#start_3 section for more info.
318 "dump"_dump.html, "dump molfile"_dump_molfile.html,
319 "read_data"_read_data.html, "read_restart"_read_restart.html,
324 The option defaults are box = yes, replace = yes, purge = no, trim =
325 no, add = no, scaled = no, wrapped = yes, and format = native.
327 :link(vmd,http://www.ks.uiuc.edu/Research/vmd)