\(\renewcommand\AA{\text{Å}}\)
LAMMPS dump file reader

User interface of the LAMMPS dump reader, which appears as part of a pipeline’s file source.
For loading particle trajectory data from files written by the dump command of the LAMMPS simulation code.
Supported format variants
The reader handles files written by the following LAMMPS dump styles:
custom
,custom/gz
,custom/mpiio
atom
,atom/gz
,atom/mpiio
Note
Dump styles cfg
, xyz
, local
, xtc
and netcdf
are handled by different file format readers of OVITO.
In addition to text dump files, binary dump files (“.bin” suffix) and gzipped dump files (“.gz” suffix) can be read.
OVITO can process trajectories from a single large dump file or from a sequence of smaller dump files (written by LAMMPS when the output filename contains a “*” wildcard character). It can even concatenate a long trajectory from several dump files, each containing multiple frames.
The current program version does not support loading sets of parallel dump files, written by LAMMPS when the output filename contains a “%” wildcard character.
LAMMPS dump_modify
options
LAMMPS lets you configure the dump output through its dump_modify command. OVITO provides support for the following dump_modify keywords:
The time keyword makes LAMMPS write the current elapsed simulation time to the dump file. In OVITO, the time value of each trajectory frame is made available as a global attribute named “Time”. The timestep number, which is always present, is made available as global attribute “Timestep”.
The units keyword makes LAMMPS write two extra lines “ITEM: UNITS” to the dump file header. OVITO currently ignores this information, since the program has no internal unit system (all quantities are treated as being without units).
The sort keyword requests LAMMPS to output the list of atoms to the dump file in sorted order (by unique atom ID). This option is normally not needed, because OVITO accepts an unsorted list of atoms and can handle trajectories in which the storage order of atoms varies throughout a simulation (which is common in LAMMPS). OVITO maintains the original order in which atoms appear in the dump file. Unique atom IDs (if present as a separate column in the dump file) are used to identify individual atoms in different trajectory frames. Nevertheless, if desired, the dump file reader provides a user option requesting OVITO to sort the atoms by ID during data import (
sort_particles=True
keyword parameter in Python, see below). This option makes the ordering of atoms stable within OVITO even if the sort keyword was not used at the time LAMMPS wrote the dump file.
Column-to-property mapping
The data columns of a dump file get mapped to corresponding particle properties within OVITO during file import. This happens automatically according to the following rules, but you can manually override the mapping if necessary. For certain dump file columns, the file parser may perform an automatic conversion as described in the third table column.
LAMMPS column name |
OVITO particle property |
Comments |
---|---|---|
x, y, z |
|
|
xu, yu, zu |
|
|
xs, ys, zs |
|
Automatic conversion from reduced to Cartesian coordinates |
xsu, ysu, zsu |
|
Automatic conversion from reduced to Cartesian coordinates |
id |
|
|
vx, vy, vz |
|
Automatic computation of |
type |
|
|
element |
|
Named types (may be combined with numeric IDs from type column) |
mass |
|
|
radius |
|
|
diameter |
|
Automatic division by 2 |
mol |
|
|
q |
|
|
ix, iy, iz |
|
|
fx, fy, fz |
|
|
mux, muy, muz |
|
|
mu |
|
|
omegax, omegay, omegaz |
|
|
angmomx, angmomy, angmomz |
|
|
tqx, tqy, tqz |
|
|
spin |
|
|
quati, quatj, quatk, quatw |
|
Quaternion components X, Y, Z, W (see here) |
c_epot |
|
|
c_kpot |
|
|
c_stress[1..6] |
|
Symmetric tensor components XX, YY, ZZ, XY, XZ, YZ |
c_orient[1..4] |
|
Quaternion components X, Y, Z, W (see here) |
c_shape[1..3] |
|
Principal semi-axes (see here) |
c_diameter[1..3] |
|
Same as above but with automatic division by 2 (see example) |
shapex, shapey, shapez |
|
Same as above but with automatic division by 2 (see example) |
c_cna |
|
|
pattern |
|
|
selection |
|
Columns having any other name are mapped to a user-defined particle property with the same name.
Further notes
LAMMPS can perform 2d and 3d simulations (see dimension command) and OVITO can also treat a system as either two- or three-dimensional (see Simulation cell). However, the dimensionality of a simulation is not encoded in the dump file. OVITO assumes that the simulation is two-dimensional if the dump file contains no z-coordinates. You can override this after import if necessary.
Python parameters
The file reader accepts the following optional keyword parameters in a call to the import_file()
or load()
Python functions.
- import_file(location, columns=None, sort_particles=False)
- Parameters:
columns (list[str | None] | None) – A list of OVITO particle property names, one for each data column in the dump file. Overrides the mapping that otherwise gets set up automatically as described above. List entries may be set to
None
to skip individual file columns during parsing.sort_particles (bool) – Makes the file reader reorder the loaded particles before passing them to the pipeline. Sorting is based on the values of the
Particle Identifier
property loaded from the dump file.