# dump command

# dump image command

# dump movie command

## Syntax

    dump ID group-ID style N file args

- ID = user-assigned name for the dump
- group-ID = ID of the group of atoms to be dumped
- style = atom or atom/vtk or xyz or image or local or custom or mesh/stl or mesh/vtk or mesh/vtm or decomposition/vtk
- N = dump every this many timesteps
- file = name of file to write dump info to
- args = list of arguments for a particular style

    atom args = none
    atom/vtk args = none
    xyz args = none

    image args = discussed on dump image doc page

    mesh/stl args = 'local' or 'ghost' or 'all' or 'region' or any ID of a fix mesh/surface
        region values = ID for region threshold
    mesh/vtk args =  zero or more keyword/ value pairs followed by one or more dump-identifiers followed by one or more mesh ids
        keywords = output
        output values = 'face' or 'interpolate' or 'original'
        dump-identifier = 'stress' or 'id' or 'wear' or 'vel' or 'stresscomponents' or 'owner' or 'area' or 'aedges' or 'acorners' or 'nneigs'
        mesh-ids = any ID of a fix mesh/surface
    mesh/vtm args =  one or two keyword/ value(s) pairs
        keywords = meshes (required) or mesh_properties
        meshes value(s) = mesh-ids
        mesh-ids = either keyword 'all' or a list of IDs of fix mesh/surface
        mesh_properties value(s) = one or more dump-identifier
        dump-identifier = 'stress' or 'id' or 'wear' or 'vel' or 'stresscomponents' or 'owner' or 'area' or 'aedges' or 'acorners' or 'nneigs'
    decomposition/vtk args = none

    local args = list of local attributes
      possible attributes = index, c_ID, c_ID[N], f_ID, f_ID[N]
        index = enumeration of local values
        c_ID = local vector calculated by a compute with ID
        c_ID[N] = Nth column of local array calculated by a compute with ID
        f_ID = local vector calculated by a fix with ID
        f_ID[N] = Nth column of local array calculated by a fix with ID

    custom args = list of atom attributes
      possible attributes = id, mol, id_multisphere , type, element, mass,
                         x, y, z, xs, ys, zs, xu, yu, zu,
                         xsu, ysu, zsu, ix, iy, iz,
                         vx, vy, vz, fx, fy, fz,
                            q, mux, muy, muz, mu,
                            radius, diameter, omegax, omegay, omegaz,
                         angmomx, angmomy, angmomz, tqx, tqy, tqz,
                         c_ID, c_ID[N], f_ID, f_ID[N], v_name

    id = atom ID
    mol = molecule ID
    id_multisphere = ID of multisphere body
    type = atom type
    element = name of atom element, as defined by dump_modify command
    mass = atom mass
    x,y,z = unscaled atom coordinates
    xs,ys,zs = scaled atom coordinates
    xu,yu,zu = unwrapped atom coordinates
    xsu,ysu,zsu = scaled unwrapped atom coordinates
    ix,iy,iz = box image that the atom is in
    vx,vy,vz = atom velocities
    fx,fy,fz = forces on atoms
    q = atom charge
    mux,muy,muz = orientation of dipole moment of atom
    mu = magnitude of dipole moment of atom
    radius,diameter = radius,diameter of spherical particle
    omegax,omegay,omegaz = angular velocity of spherical particle
    angmomx,angmomy,angmomz = angular momentum of aspherical particle
    tqx,tqy,tqz = torque on finite-size particles
    c_ID = per-atom vector calculated by a compute with ID
    c_ID[N] = Nth column of per-atom array calculated by a compute with ID
    f_ID = per-atom vector calculated by a fix with ID
    f_ID[N] = Nth column of per-atom array calculated by a fix with ID
    v_name = per-atom vector calculated by an atom-style variable with name

## Examples

    dump myDump all atom 100 dump.atom
    dump 2 subgroup atom 50 dump.run.bin
    dump 4a all custom 100 dump.myforce.* id type x y vx fx
    dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
    dump dmpMyMesh mesh/vtk 100 mesh*.vtk vel area my_mesh_id
    dump dmpAllMeshes mesh/vtk 100 mesh*.vtk stress wear
    dump dmpMyMeshVTM mesh/vtm 100 mesh*.vtm meshes my_mesh_id mesh_properties vel area
    dump dmpAllMeshesVTM mesh/vtm 100 mesh*.vtm meshes all mesh_properties stress wear

## Description

Dump a snapshot of atom quantities to one or more files every N timesteps in one of several styles. The image style is the exception; it creates a JPG or PPM image file of the atom configuration every N timesteps, as discussed on the dump image doc page. The timesteps on which dump output is written can also be controlled by a variable; see the dump_modify every command for details.

Only information for atoms in the specified group is dumped. The dump_modify thresh and region commands can also alter what atoms are included. Not all styles support all these options; see details below.

As described below, the filename determines the kind of output (text or binary or gzipped, one big file or one per timestep, one big file or multiple smaller files).

Warning

Because periodic boundary conditions are enforced only on timesteps when neighbor lists are rebuilt, the coordinates of an atom written to a dump file may be slightly outside the simulation box.

Warning

Unless the dump_modify sort option is invoked, the lines of atom information written to dump files (typically one line per atom) will be in an indeterminate order for each snapshot. This is even true when running on a single processor, if the atom_modify sort option is on, which it is by default. In this case atoms are re-ordered periodically during a simulation, due to spatial sorting. It is also true when running in parallel, because data for a single snapshot is collected from multiple processors, each of which owns a subset of the atoms.

For the atom, custom, and local styles, sorting is off by default. For the xyz style, sorting by atom ID is on by default. See the dump_modify doc page for details.

The style keyword determines what atom quantities are written to the file and in what format. Settings made via the dump_modify command can also alter the format of individual values and the file itself.

The atom, local, and custom styles create files in a simple text format that is self-explanatory when viewing a dump file.

For post-processing purposes the atom, local, and custom text files are self-describing in the following sense.

The dimensions of the simulation box are included in each snapshot. For an orthogonal simulation box this information is is formatted as:

    ITEM: BOX BOUNDS xx yy zz
    xlo xhi
    ylo yhi
    zlo zhi

where xlo,xhi are the maximum extents of the simulation box in the x-dimension, and similarly for y and z. The “xx yy zz” represent 6 characters that encode the style of boundary for each of the 6 simulation box boundaries (xlo,xhi and ylo,yhi and zlo,zhi). Each of the 6 characters is either p = periodic, f = fixed, s = shrink wrap, or m = shrink wrapped with a minimum value. See the boundary command for details.

For triclinic simulation boxes (non-orthogonal), an orthogonal bounding box which encloses the triclinic simulation box is output, along with the 3 tilt factors (xy, xz, yz) of the triclinic box, formatted as follows:

    ITEM: BOX BOUNDS xy xz yz xx yy zz
    xlo_bound xhi_bound xy
    ylo_bound yhi_bound xz
    zlo_bound zhi_bound yz

The presence of the text “xy xz yz” in the ITEM line indicates that the 3 tilt factors will be included on each of the 3 following lines. This bounding box is convenient for many visualization programs. The meaning of the 6 character flags for “xx yy zz” is the same as above.

Note that the first two numbers on each line are now xlo_bound instead of xlo, etc, since they repesent a bounding box. See this section of the doc pages for a geometric description of triclinic boxes, as defined by LIGGGHTS(R)-PUBLIC, simple formulas for how the 6 bounding box extents (xlo_bound,xhi_bound,etc) are calculated from the triclinic parameters, and how to transform those parameters to and from other commonly used triclinic representations.

The “ITEM: ATOMS” line in each snapshot lists column descriptors for the per-atom lines that follow. For example, the descriptors would be “id type xs ys zs” for the default atom style, and would be the atom attributes you specify in the dump command for the custom style.

For style atom, atom coordinates are written to the file, along with the atom ID and atom type. By default, atom coords are written in a scaled format (from 0 to 1). I.e. an x value of 0.25 means the atom is at a location 1/4 of the distance from xlo to xhi of the box boundaries. The format can be changed to unscaled coords via the dump_modify settings. Image flags can also be added for each atom via dump_modify.

For style atom/vtk, atom coordinates, velocity, rotational velocity, force, atom ID, atom radius and atom type are written to VTK files. Note that you have to link against VTK libraries to use this functionality.

Style custom allows you to specify a list of atom attributes to be written to the dump file for each atom. Possible attributes are listed above and will appear in the order specified. You cannot specify a quantity that is not defined for a particular simulation - such as q for atom style bond, since that atom style doesn’t assign charges. Dumps occur at the very end of a timestep, so atom attributes will include effects due to fixes that are applied during the timestep. An explanation of the possible dump custom attributes is given below.

For style local, local output generated by computes and fixes is used to generate lines of output that is written to the dump file. This local data is typically calculated by each processor based on the atoms it owns, but there may be zero or more entities per atom, e.g. a list of bond distances. An explanation of the possible dump local attributes is given below. Note that by using input from the compute property/local command with dump local, it is possible to generate information on bonds that can be cut and pasted directly into a data file read by the read_data command.

The xyz style writes XYZ files, which is a simple text-based coordinate format that many codes can read. Specifically it has a line with the number of atoms, then a comment line that is usually ignored followed by one line per atom with the atom type and the x-, y-, and z-coordinate of that atom. You can use the dump_modify element option to change the output from using the (numerical) atom type to an element name (or some other label). This will help many visualization programs to guess bonds and colors.

The mesh/stl style dumps active STL geometries defined via `fix mesh` commands into the specified file. If you do not supply the optional list of mesh IDs, all meshes are dumped, irrespective of whether they are used in a fix wall/gran command or not. By specifying a list of mesh IDs you can explicitly choose which meshes to dump. The group-ID is ignored, because the command is not applied to particles, but to mesh geometries. With keywords ‘local’, ‘owned’ or ‘ghost’ you can decide which parts of the parallel meshes you want to dump (default is ‘local’). If the multiprocessor option is not used (no ‘%’ in filename), data is gathered from all processors, so using the default will output the whole mesh data across all processors.

Examples:

    dump stl1 all mesh/stl 300 post/dump*.stl
    dump stl2 all mesh/stl 300 post/dump_proc%_local*.stl local
    dump stl3 all mesh/stl 300 post/dump_proc%_ghost*.stl ghost
    dump stl4 all mesh/stl 300 post/dump_proc_all_ghost*.stl ghost

The first command will write one file per time-step containing the complete mesh. The second command will output one file per time-step per processor containing the local (owned) mesh elements of each processor. The third command will output one file per time-step per processor containing the ghost (corona) mesh elements of each processor. The third command will output one file per time-step containing the ghost (corona) mesh elements of all processors.

With the region keyword, just those mesh element where the element center (arithmetic average of all nodes) is in the specified region, will be dumped.

This dump is especially useful if a fix move/mesh is registered. If the position of the mesh is changed over time and you want to dump one file for each dump timestep for post-processing together with the particle data, you should use a filename like ‘mydumpfile*.stl’. Note: This series of files can then be post-processed together with the particle dump file converted to VTK in Paraview , www.paraview.org

By providing any ID (or a list of IDs) of fix mesh/surface commands, you can specify which meshes to dump. If no meshes are specified, all meshes used in the simulation are dumped.

The mesh/vtk or the mesh/vtm (new) style can be used to dump active mesh geometries defined via `fix mesh` commands to a series of VTK files. The mesh/vtk style allows the file endings .vtk, .vtp and .pvtp. The first two write the data only on one processor, the latter writes several files in parallel. The mesh/vtm style currently only allows the .vtm file ending and writes in serial only. Different keywords can be used to dump the per-triangle averaged stress in normal and shear direction, id, velocity, wear, stress components (fx / element area, fy / element area, fz / element area), area (area of each element) or the process which owns the element (visulatisation of the parallel decomposition) into the specified file using a VTK file format. The ‘meshes’ keyword (only for mesh/vtm) and the list of mesh IDs is optional. As with the stl style, all active meshes are dumped if you do not supply the optional list of mesh IDs. By specifying list of mesh IDs you can explicitly choose which meshes to dump. The group-ID is ignored. Again, a series of files can be post-processed in Paraview , www.paraview.org Most keywords as used for the mesh/vtk style are self-explanatory. Keyword output controls how the data is written. If face (default) is selected then all point variables will be interpolated to the triangle faces. For the value interpolated all cell values will be interpolated to the respective points and finally for original no interpolation will take place and cell and point variables are written to cells and points, respectively. Keywords aedges and acorners dump the number of active edges/corners per face. Keyword nneighs dumps the number of face neighbors LIGGGHTS(R)-PUBLIC has recognized for each face.

mesh/vtm is similar to mesh/vtk but only the arguments are different. The former requires the use of the keyword meshes which has to be followed either by a list of mesh-ids or the keyword ‘all’. The latter will cause all meshes to be dumped. After the mesh specification mesh/vtm can be provided with the optional keyword mesh_properties that needs to be followed by the dump identifiers. The list of such identifiers is identical to mesh/vtk.

By providing the ‘meshes’ keyword and any ID (or a list of IDs) of fix mesh/surface commands, you can specify which meshes to dump. If no meshes are specified, all meshes used in the simulation are dumped.

The decomposition/vtk style dumps the processor grid decomposition into a series of VTK files. No further args are expected.

For all vkt outputs if dump_modify binary is used, the dump file (or files, if “*” is also used) is written in binary format. A binary dump file will be about the same size as a text version, but will typically write out much faster. Additionally, dump_modify compressor can be used to specify the writing of compressed binary data. Options for compressors include:

    none: No compression
    zlib: Zlib compression
    lz4: Lz4 compression (VTK >= 8.0 required)

Dumps are performed on timesteps that are a multiple of N (including timestep 0) and on the last timestep of a minimization if the minimization converges. Note that this means a dump will not be performed on the initial timestep after the dump command is invoked, if the current timestep is not a multiple of N. This behavior can be changed via the dump_modify first command, which can also be useful if the dump command is invoked after a minimization ended on an arbitrary timestep. N can be changed between runs by using the dump_modify every command. The dump_modify every command also allows a variable to be used to determine the sequence of timesteps on which dump files are written. In this mode a dump on the first timestep of a run will also not be written unless the dump_modify first command is used.

The specified filename determines how the dump file(s) is written. The default is to write one large text file, which is opened when the dump command is invoked and closed when an undump command is used or when LIGGGHTS(R)-PUBLIC exits.

Dump filenames can contain two wildcard characters. If a “*” character appears in the filename, then one file per snapshot is written and the “*” character is replaced with the timestep value. For example, tmp.dump.* becomes tmp.dump.0, tmp.dump.10000, tmp.dump.20000, etc. Note that the dump_modify pad command can be used to insure all timestep numbers are the same length (e.g. 00010), which can make it easier to read a series of dump files in order with some post-processing tools.

If a “%” character appears in the filename, then each of P processors writes a portion of the dump file, and the “%” character is replaced with the processor ID from 0 to P-1. For example, tmp.dump.% becomes tmp.dump.0, tmp.dump.1, ... tmp.dump.P-1, etc. This creates smaller files and can be a fast mode of output on parallel machines that support parallel I/O for output. This option is not available for the

> xyz style.

By default, P = the number of processors meaning one file per processor, but P can be set to a smaller value via the nfile or fileper keywords of the dump_modify command. These options can be the most efficient way of writing out dump files when running on large numbers of processors.

Note that using the “*” and “%” characters together can produce a large number of small dump files!

If the filename ends with ”.bin”, the dump file (or files, if “*” or “%” is also used) is written in binary format. A binary dump file will be about the same size as a text version, but will typically write out much faster. This option is only available for the atom and custom styles.

If the filename ends with ”.gz”, the dump file (or files, if “*” or “%” is also used) is written in gzipped format. A gzipped dump file will be about 3x smaller than the text version, but will also take longer to write.

This section explains the local attributes that can be specified as part of the local style.

The index attribute can be used to generate an index number from 1 to N for each line written into the dump file, where N is the total number of local datums from all processors, or lines of output that will appear in the snapshot. Note that because data from different processors depend on what atoms they currently own, and atoms migrate between processor, there is no guarantee that the same index will be used for the same info (e.g. a particular bond) in successive snapshots.

The c_ID and c_ID[N] attributes allow local vectors or arrays calculated by a compute to be output. The ID in the attribute should be replaced by the actual ID of the compute that has been defined previously in the input script. See the compute command for details. There are computes for calculating local information such as indices, types, and energies for bonds.

Note that computes which calculate global or per-atom quantities, as opposed to local quantities, cannot be output in a dump local command. Instead, global quantities can be output by the thermo_style custom command, and per-atom quantities can be output by the dump custom command.

If c_ID is used as a attribute, then the local vector calculated by the compute is printed. If c_ID[N] is used, then N must be in the range from 1-M, which will print the Nth column of the M-length local array calculated by the compute.

The f_ID and f_ID[N] attributes allow local vectors or arrays calculated by a fix to be output. The ID in the attribute should be replaced by the actual ID of the fix that has been defined previously in the input script.

If f_ID is used as a attribute, then the local vector calculated by the fix is printed. If f_ID[N] is used, then N must be in the range from 1-M, which will print the Nth column of the M-length local array calculated by the fix.

Here is an example of how to dump bond info for a system, including the distance and energy of each bond:

    compute 1 all property/local batom1 batom2 btype
    compute 2 all bond/local dist eng
    dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_2[1] c_2[2]

This section explains the atom attributes that can be specified as part of the custom and style.

The id, mol, type, element, mass, vx, vy, vz, fx, fy, fz, q attributes are self-explanatory.

Id is the atom ID. Mol is the molecule ID, included in the data file for molecular systems. id_multisphere is the ID of the multisphere body that the particle belongs to (if your version supports multisphere). Type is the atom type. Element is typically the chemical name of an element, which you must assign to each type via the dump_modify element command. More generally, it can be any string you wish to associated with an atom type. Mass is the atom mass. Vx, vy, vz, fx, fy, fz, and q are components of atom velocity and force and atomic charge.

There are several options for outputting atom coordinates. The x, y, z attributes write atom coordinates “unscaled”, in the appropriate distance units (Angstroms, sigma, etc). Use xs, ys, zs if you want the coordinates “scaled” to the box size, so that each value is 0.0 to 1.0. If the simulation box is triclinic (tilted), then all atom coords will still be between 0.0 and 1.0. Use xu, yu, zu if you want the coordinates “unwrapped” by the image flags for each atom. Unwrapped means that if the atom has passed thru a periodic boundary one or more times, the value is printed for what the coordinate would be if it had not been wrapped back into the periodic box. Note that using xu, yu, zu means that the coordinate values may be far outside the box bounds printed with the snapshot. Using xsu, ysu, zsu is similar to using xu, yu, zu, except that the unwrapped coordinates are scaled by the box size. Atoms that have passed through a periodic boundary will have the corresponding cooordinate increased or decreased by 1.0.

The image flags can be printed directly using the ix, iy, iz attributes. For periodic dimensions, they specify which image of the simulation box the atom is considered to be in. An image of 0 means it is inside the box as defined. A value of 2 means add 2 box lengths to get the true value. A value of -1 means subtract 1 box length to get the true value. LIGGGHTS(R)-PUBLIC updates these flags as atoms cross periodic boundaries during the simulation.

The mux, muy, muz attributes are specific to dipolar systems defined with an atom style of dipole. They give the orientation of the atom’s point dipole moment. The mu attribute gives the magnitude of the atom’s dipole moment.

The radius and diameter attributes are specific to spherical particles that have a finite size, such as those defined with an atom style of sphere.

The omegax, omegay, and omegaz attributes are specific to finite-size spherical particles that have an angular velocity. Only certain atom styles, such as sphere define this quantity.

The angmomx, angmomy, and angmomz attributes are specific to finite-size aspherical particles that have an angular momentum. Only the ellipsoid atom style defines this quantity.

The tqx, tqy, tqz attributes are for finite-size particles that can sustain a rotational torque due to interactions with other particles.

The c_ID and c_ID[N] attributes allow per-atom vectors or arrays calculated by a compute to be output. The ID in the attribute should be replaced by the actual ID of the compute that has been defined previously in the input script. See the compute command for details. There are computes for calculating the per-atom energy, stress, centro-symmetry parameter, and coordination number of individual atoms.

Note that computes which calculate global or local quantities, as opposed to per-atom quantities, cannot be output in a dump custom command. Instead, global quantities can be output by the thermo_style custom command, and local quantities can be output by the dump local command.

If c_ID is used as a attribute, then the per-atom vector calculated by the compute is printed. If c_ID[N] is used, then N must be in the range from 1-M, which will print the Nth column of the M-length per-atom array calculated by the compute.

The f_ID and f_ID[N] attributes allow vector or array per-atom quantities calculated by a fix to be output. The ID in the attribute should be replaced by the actual ID of the fix that has been defined previously in the input script. The fix ave/atom command is one that calculates per-atom quantities. Since it can time-average per-atom quantities produced by any compute, fix, or atom-style variable, this allows those time-averaged results to be written to a dump file.

If f_ID is used as a attribute, then the per-atom vector calculated by the fix is printed. If f_ID[N] is used, then N must be in the range from 1-M, which will print the Nth column of the M-length per-atom array calculated by the fix.

The v_name attribute allows per-atom vectors calculated by a variable to be output. The name in the attribute should be replaced by the actual name of the variable that has been defined previously in the input script. Only an atom-style variable can be referenced, since it is the only style that generates per-atom values. Variables of style atom can reference individual atom attributes, per-atom atom attributes, thermodynamic keywords, or invoke other computes, fixes, or variables when they are evaluated, so this is a very general means of creating quantities to output to a dump file.

See Section_modify of the manual for information on how to add new compute and fix styles to LIGGGHTS(R)-PUBLIC to calculate per-atom quantities which could then be output into dump files.

## Restrictions

To write gzipped dump files, you must compile LIGGGHTS(R)-PUBLIC with the -DLAMMPS_GZIP option - see the Making LAMMPS section of the documentation.

To be able to use atom/vtk, you have to link to VTK libraries, please adapt your Makefile accordingly.

## Related commands

dump image, dump_modify, undump

## Default

The defaults for the image style are listed on the dump image doc page.