uf3.data.io.parse_lammps_dump

parse_lammps_dump(fname: str, lammps_aliases: Dict[int, str], timesteps: Optional[List[int]] = None) pandas.core.series.Series[source]

Read LAMMPS text dump file. Expects the following items in the thermo_style: id type x y z

Other items, such as fx and custom computes, are added via ase.Atoms.new_array().

Compatible with large files because the function reads line-by-line and, optionally, saves only specified timesteps.

TODO: refactor to break up into smaller, reusable functions

Parameters
  • fname (str) – filename of dump file.

  • lammps_aliases (dict) – map of LAMMSPS type to species.

  • timesteps (list, np.ndarray) – Optional subset of timesteps to parse. Note: function expects timesteps to match dump chronologically. This behavior is intended to accommodate LAMMPS runs with reset_timestep commands.

Returns

Map of timestep to ase.Atoms, allowing repeated entries in case of reset_timestep.

Return type

snapshots (pandas.Series)