lammps/dump format#

Aliases#

dump, lammps/dump

Implementation: LAMMPSDumpFormat

Overview#

LAMMPS text dump trajectory.

LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) is a classical molecular dynamics code.

The reader handles scaled, unscaled, wrapped, and image-flag coordinates, supports frame subsampling, and can use a LAMMPS input file to resolve additional atom-style information. Numeric atom types can be mapped to elements with type_map.

Quick examples#

The examples use the preferred alias lammps/dump; any alias listed above is equivalent.

import dpdata

# Geometry-only data
system = dpdata.System("input_file", fmt="lammps/dump")

# Write geometry-only data
system.to("lammps/dump", "output_path")

Conversions#

Convert from this format to System#

dpdata.System(file_name: 'str', type_map: 'list[str]' = None, begin: 'int' = 0, step: 'int' = 1, unwrap: 'bool' = False, input_file: 'str' = None, f_idx: 'int | list[int] | np.ndarray | None' = None, fmt: Literal['dump'] = None, **kwargs) dpdata.system.System
dpdata.System(file_name: 'str', type_map: 'list[str]' = None, begin: 'int' = 0, step: 'int' = 1, unwrap: 'bool' = False, input_file: 'str' = None, f_idx: 'int | list[int] | np.ndarray | None' = None, fmt: Literal['lammps/dump'] = None, **kwargs) dpdata.system.System
dpdata.System.from_dump(file_name: 'str', type_map: 'list[str]' = None, begin: 'int' = 0, step: 'int' = 1, unwrap: 'bool' = False, input_file: 'str' = None, f_idx: 'int | list[int] | np.ndarray | None' = None, **kwargs) dpdata.system.System
dpdata.System.from_lammps_dump(file_name: 'str', type_map: 'list[str]' = None, begin: 'int' = 0, step: 'int' = 1, unwrap: 'bool' = False, input_file: 'str' = None, f_idx: 'int | list[int] | np.ndarray | None' = None, **kwargs) dpdata.system.System

Read the data from a lammps dump file.

Parameters:
file_namestr

The dump file name

type_mapList[str], optional

The atom type list

beginint, optional

The begin step

stepint, optional

The step

unwrapbool, optional

Whether to unwrap the coordinates

input_filestr, optional

The input file name

f_idxint or array-like of int, optional

Specific non-negative frame indices to load. The requested order and duplicate indices are preserved. Cannot be combined with non-default begin or step values.

**kwargsdict

Additional format arguments accepted for API compatibility.

Returns:
System

converted system

Convert from System to this format#

dpdata.System.to(fmt: Literal['dump'], file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)
dpdata.System.to(fmt: Literal['lammps/dump'], file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)
dpdata.System.to_dump(file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)
dpdata.System.to_lammps_dump(file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)

Dump the system in LAMMPS dump format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

timestepint

The timestep number for the dump

**kwargsdict

other parameters

Convert from LabeledSystem to this format#

dpdata.LabeledSystem.to(fmt: Literal['dump'], file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)
dpdata.LabeledSystem.to(fmt: Literal['lammps/dump'], file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)
dpdata.LabeledSystem.to_dump(file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)
dpdata.LabeledSystem.to_lammps_dump(file_name: 'FileType', frame_idx=0, timestep=0, **kwargs)

Dump the system in LAMMPS dump format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

timestepint

The timestep number for the dump

**kwargsdict

other parameters