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)
9 dump custom/vtk command :h3
13 dump ID group-ID style N file args :pre
15 ID = user-assigned name for the dump :ulb,l
16 group-ID = ID of the group of atoms to be dumped :l
17 style = {custom/vtk} :l
18 N = dump every this many timesteps :l
19 file = name of file to write dump info to :l
20 args = list of arguments for a particular style :l
21 {custom/vtk} args = list of atom attributes
22 possible attributes = id, mol, proc, procp1, type, element, mass,
23 x, y, z, xs, ys, zs, xu, yu, zu,
24 xsu, ysu, zsu, ix, iy, iz,
25 vx, vy, vz, fx, fy, fz,
27 radius, diameter, omegax, omegay, omegaz,
28 angmomx, angmomy, angmomz, tqx, tqy, tqz,
29 spin, eradius, ervel, erforce,
30 c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :pre
34 proc = ID of processor that owns atom
35 procp1 = ID+1 of processor that owns atom
37 element = name of atom element, as defined by "dump_modify"_dump_modify.html command
39 x,y,z = unscaled atom coordinates
40 xs,ys,zs = scaled atom coordinates
41 xu,yu,zu = unwrapped atom coordinates
42 xsu,ysu,zsu = scaled unwrapped atom coordinates
43 ix,iy,iz = box image that the atom is in
44 vx,vy,vz = atom velocities
45 fx,fy,fz = forces on atoms
47 mux,muy,muz = orientation of dipole moment of atom
48 mu = magnitude of dipole moment of atom
49 radius,diameter = radius,diameter of spherical particle
50 omegax,omegay,omegaz = angular velocity of spherical particle
51 angmomx,angmomy,angmomz = angular momentum of aspherical particle
52 tqx,tqy,tqz = torque on finite-size particles
53 c_ID = per-atom vector calculated by a compute with ID
54 c_ID\[N\] = Nth column of per-atom array calculated by a compute with ID
55 f_ID = per-atom vector calculated by a fix with ID
56 f_ID\[N\] = Nth column of per-atom array calculated by a fix with ID
57 v_name = per-atom vector calculated by an atom-style variable with name :pre
62 dump dmpvtk all custom/vtk 100 dump*.myforce.vtk id type vx fx
63 dump dmpvtp flow custom/vtk 100 dump*.%.displace.vtp id type c_myD\[1\] c_myD\[2\] c_myD\[3\] v_ke
64 dump e_data all custom/vtk 100 dump*.vtu id type spin eradius fx fy fz eforce :pre
66 The style {custom/vtk} is similar to the "custom"_dump.html style but
67 uses the VTK library to write data to VTK simple legacy or XML format
68 depending on the filename extension specified. This can be either
69 {*.vtk} for the legacy format or {*.vtp} and {*.vtu}, respectively,
70 for the XML format; see the "VTK
71 homepage"_http://www.vtk.org/VTK/img/file-formats.pdf for a detailed
72 description of these formats. Since this naming convention conflicts
73 with the way binary output is usually specified (see below),
74 "dump_modify binary"_dump_modify.html allows to set the binary
75 flag for this dump style explicitly.
79 Dump a snapshot of atom quantities to one or more files every N
80 timesteps in a format readable by the "VTK visualization
81 toolkit"_http://www.vtk.org or other visualization tools that use it,
82 e.g. "ParaView"_http://www.paraview.org. The timesteps on which dump
83 output is written can also be controlled by a variable; see the
84 "dump_modify every"_dump_modify.html command for details.
86 Only information for atoms in the specified group is dumped. The
87 "dump_modify thresh and region"_dump_modify.html commands can also
88 alter what atoms are included; see details below.
90 As described below, special characters ("*", "%") in the filename
91 determine the kind of output.
93 IMPORTANT NOTE: Because periodic boundary conditions are enforced only
94 on timesteps when neighbor lists are rebuilt, the coordinates of an
95 atom written to a dump file may be slightly outside the simulation
98 IMPORTANT NOTE: Unless the "dump_modify sort"_dump_modify.html
99 option is invoked, the lines of atom information written to dump files
100 will be in an indeterminate order for each snapshot. This is even
101 true when running on a single processor, if the "atom_modify
102 sort"_atom_modify.html option is on, which it is by default. In this
103 case atoms are re-ordered periodically during a simulation, due to
104 spatial sorting. It is also true when running in parallel, because
105 data for a single snapshot is collected from multiple processors, each
106 of which owns a subset of the atoms.
108 For the {custom/vtk} style, sorting is off by default. See the
109 "dump_modify"_dump_modify.html doc page for details.
113 The dimensions of the simulation box are written to a separate file
114 for each snapshot (either in legacy VTK or XML format depending on
115 the format of the main dump file) with the suffix {_boundingBox}
116 appended to the given dump filename.
118 For an orthogonal simulation box this information is saved as a
119 rectilinear grid (legacy .vtk or .vtr XML format).
121 Triclinic simulation boxes (non-orthogonal) are saved as
122 hexahedrons in either legacy .vtk or .vtu XML format.
124 Style {custom/vtk} allows you to specify a list of atom attributes
125 to be written to the dump file for each atom. Possible attributes
126 are listed above. In contrast to the {custom} style, the attributes
127 are rearranged to ensure correct ordering of vector components
128 (except for computes and fixes - these have to be given in the right
129 order) and duplicate entries are removed.
131 You cannot specify a quantity that is not defined for a particular
132 simulation - such as {q} for atom style {bond}, since that atom style
133 doesn't assign charges. Dumps occur at the very end of a timestep,
134 so atom attributes will include effects due to fixes that are applied
135 during the timestep. An explanation of the possible dump custom/vtk attributes
136 is given below. Since position data is required to write VTK files "x y z"
137 do not have to be specified explicitly.
139 The VTK format uses a single snapshot of the system per file, thus
140 a wildcard "*" must be included in the filename, as discussed below.
141 Otherwise the dump files will get overwritten with the new snapshot
146 Dumps are performed on timesteps that are a multiple of N (including
147 timestep 0) and on the last timestep of a minimization if the
148 minimization converges. Note that this means a dump will not be
149 performed on the initial timestep after the dump command is invoked,
150 if the current timestep is not a multiple of N. This behavior can be
151 changed via the "dump_modify first"_dump_modify.html command, which
152 can also be useful if the dump command is invoked after a minimization
153 ended on an arbitrary timestep. N can be changed between runs by
154 using the "dump_modify every"_dump_modify.html command.
155 The "dump_modify every"_dump_modify.html command
156 also allows a variable to be used to determine the sequence of
157 timesteps on which dump files are written. In this mode a dump on the
158 first timestep of a run will also not be written unless the
159 "dump_modify first"_dump_modify.html command is used.
161 Dump filenames can contain two wildcard characters. If a "*"
162 character appears in the filename, then one file per snapshot is
163 written and the "*" character is replaced with the timestep value.
164 For example, tmp.dump*.vtk becomes tmp.dump0.vtk, tmp.dump10000.vtk,
165 tmp.dump20000.vtk, etc. Note that the "dump_modify pad"_dump_modify.html
166 command can be used to insure all timestep numbers are the same length
167 (e.g. 00010), which can make it easier to read a series of dump files
168 in order with some post-processing tools.
170 If a "%" character appears in the filename, then each of P processors
171 writes a portion of the dump file, and the "%" character is replaced
172 with the processor ID from 0 to P-1 preceded by an underscore character.
173 For example, tmp.dump%.vtp becomes tmp.dump_0.vtp, tmp.dump_1.vtp, ...
174 tmp.dump_P-1.vtp, etc. This creates smaller files and can be a fast
175 mode of output on parallel machines that support parallel I/O for output.
177 By default, P = the number of processors meaning one file per
178 processor, but P can be set to a smaller value via the {nfile} or
179 {fileper} keywords of the "dump_modify"_dump_modify.html command.
180 These options can be the most efficient way of writing out dump files
181 when running on large numbers of processors.
183 For the legacy VTK format "%" is ignored and P = 1, i.e., only
184 processor 0 does write files.
186 Note that using the "*" and "%" characters together can produce a
187 large number of small dump files!
189 If {dump_modify binary} is used, the dump file (or files, if "*" or
190 "%" is also used) is written in binary format. A binary dump file
191 will be about the same size as a text version, but will typically
192 write out much faster.
196 This section explains the atom attributes that can be specified as
197 part of the {custom/vtk} style.
199 The {id}, {mol}, {proc}, {procp1}, {type}, {element}, {mass}, {vx},
200 {vy}, {vz}, {fx}, {fy}, {fz}, {q} attributes are self-explanatory.
202 {id} is the atom ID. {mol} is the molecule ID, included in the data
203 file for molecular systems. {type} is the atom type. {element} is
204 typically the chemical name of an element, which you must assign to
205 each type via the "dump_modify element"_dump_modify.html command.
206 More generally, it can be any string you wish to associate with an
207 atom type. {mass} is the atom mass. {vx}, {vy}, {vz}, {fx}, {fy},
208 {fz}, and {q} are components of atom velocity and force and atomic
211 There are several options for outputting atom coordinates. The {x},
212 {y}, {z} attributes are used to write atom coordinates "unscaled", in
213 the appropriate distance "units"_units.html (Angstroms, sigma, etc).
214 Additionaly, you can use {xs}, {ys}, {zs} if you want to also save the
215 coordinates "scaled" to the box size, so that each value is 0.0 to
216 1.0. If the simulation box is triclinic (tilted), then all atom
217 coords will still be between 0.0 and 1.0. Use {xu}, {yu}, {zu} if you
218 want the coordinates "unwrapped" by the image flags for each atom.
219 Unwrapped means that if the atom has passed through a periodic
220 boundary one or more times, the value is printed for what the
221 coordinate would be if it had not been wrapped back into the periodic
222 box. Note that using {xu}, {yu}, {zu} means that the coordinate
223 values may be far outside the box bounds printed with the snapshot.
224 Using {xsu}, {ysu}, {zsu} is similar to using {xu}, {yu}, {zu}, except
225 that the unwrapped coordinates are scaled by the box size. Atoms that
226 have passed through a periodic boundary will have the corresponding
227 cooordinate increased or decreased by 1.0.
229 The image flags can be printed directly using the {ix}, {iy}, {iz}
230 attributes. For periodic dimensions, they specify which image of the
231 simulation box the atom is considered to be in. An image of 0 means
232 it is inside the box as defined. A value of 2 means add 2 box lengths
233 to get the true value. A value of -1 means subtract 1 box length to
234 get the true value. LAMMPS updates these flags as atoms cross
235 periodic boundaries during the simulation.
237 The {mux}, {muy}, {muz} attributes are specific to dipolar systems
238 defined with an atom style of {dipole}. They give the orientation of
239 the atom's point dipole moment. The {mu} attribute gives the
240 magnitude of the atom's dipole moment.
242 The {radius} and {diameter} attributes are specific to spherical
243 particles that have a finite size, such as those defined with an atom
246 The {omegax}, {omegay}, and {omegaz} attributes are specific to
247 finite-size spherical particles that have an angular velocity. Only
248 certain atom styles, such as {sphere} define this quantity.
250 The {angmomx}, {angmomy}, and {angmomz} attributes are specific to
251 finite-size aspherical particles that have an angular momentum. Only
252 the {ellipsoid} atom style defines this quantity.
254 The {tqx}, {tqy}, {tqz} attributes are for finite-size particles that
255 can sustain a rotational torque due to interactions with other
258 The {spin}, {eradius}, {ervel}, and {erforce} attributes are for
259 particles that represent nuclei and electrons modeled with the
260 electronic force field (EFF). See "atom_style
261 electron"_atom_style.html and "pair_style eff"_pair_eff.html for more
264 The {c_ID} and {c_ID\[N\]} attributes allow per-atom vectors or arrays
265 calculated by a "compute"_compute.html to be output. The ID in the
266 attribute should be replaced by the actual ID of the compute that has
267 been defined previously in the input script. See the
268 "compute"_compute.html command for details. There are computes for
269 calculating the per-atom energy, stress, centro-symmetry parameter,
270 and coordination number of individual atoms.
272 Note that computes which calculate global or local quantities, as
273 opposed to per-atom quantities, cannot be output in a dump custom/vtk
274 command. Instead, global quantities can be output by the
275 "thermo_style custom"_thermo_style.html command, and local quantities
276 can be output by the dump local command.
278 If {c_ID} is used as an attribute, then the per-atom vector calculated
279 by the compute is printed. If {c_ID\[N\]} is used, then N must be in
280 the range from 1-M, which will print the Nth column of the M-length
281 per-atom array calculated by the compute.
283 The {f_ID} and {f_ID\[N\]} attributes allow vector or array per-atom
284 quantities calculated by a "fix"_fix.html to be output. The ID in the
285 attribute should be replaced by the actual ID of the fix that has been
286 defined previously in the input script. The "fix
287 ave/atom"_fix_ave_atom.html command is one that calculates per-atom
288 quantities. Since it can time-average per-atom quantities produced by
289 any "compute"_compute.html, "fix"_fix.html, or atom-style
290 "variable"_variable.html, this allows those time-averaged results to
291 be written to a dump file.
293 If {f_ID} is used as a attribute, then the per-atom vector calculated
294 by the fix is printed. If {f_ID\[N\]} is used, then N must be in the
295 range from 1-M, which will print the Nth column of the M-length
296 per-atom array calculated by the fix.
298 The {v_name} attribute allows per-atom vectors calculated by a
299 "variable"_variable.html to be output. The name in the attribute
300 should be replaced by the actual name of the variable that has been
301 defined previously in the input script. Only an atom-style variable
302 can be referenced, since it is the only style that generates per-atom
303 values. Variables of style {atom} can reference individual atom
304 attributes, per-atom atom attributes, thermodynamic keywords, or
305 invoke other computes, fixes, or variables when they are evaluated, so
306 this is a very general means of creating quantities to output to a
309 See "Section 10"_Section_modify.html of the manual for information
310 on how to add new compute and fix styles to LAMMPS to calculate
311 per-atom quantities which could then be output into dump files.
317 The {custom/vtk} style does not support writing of gzipped dump files.
319 The {custom/vtk} dump style is part of the USER-VTK package. It is
320 only enabled if LAMMPS was built with that package. See the "Making
321 LAMMPS"_Section_start.html#start_3 section for more info.
323 To use this dump style, you also must link to the VTK library. See
324 the info in lib/vtk/README and insure the Makefile.lammps file in that
325 directory is appropriate for your machine.
327 The {custom/vtk} dump style neither supports buffering nor custom
332 "dump"_dump.html, "dump image"_dump_image.html,
333 "dump_modify"_dump_modify.html, "undump"_undump.html
337 By default, files are written in ASCII format. If the file extension
338 is not one of .vtk, .vtp or .vtu, the legacy VTK file format is used.