pymatgen.io.lammps.outputs module

This module implements classes and methods for processing LAMMPS output files (log and dump).

class LammpsDump(timestep, natoms, box, data)[source]

Bases: MSONable

Object for representing dump data for a single snapshot.

Base constructor.

Parameters:
  • timestep (int) – Current time step.

  • natoms (int) – Total number of atoms in the box.

  • box (LammpsBox) – Simulation box.

  • data (pd.DataFrame) – Dumped atomic data.

as_dict()[source]

Returns: MSONable dict

classmethod from_dict(d)[source]
Parameters:

d (dict) – Dict representation

Returns:

LammpsDump

classmethod from_string(string)[source]

Constructor from string parsing.

Parameters:

string (str) – Input string.

parse_lammps_dumps(file_pattern)[source]

Generator that parses dump file(s).

Parameters:

file_pattern (str) – Filename to parse. The timestep wildcard (e.g., dump.atom.’*’) is supported and the files are parsed in the sequence of timestep.

Yields:

LammpsDump for each available snapshot.

parse_lammps_log(filename='log.lammps')[source]

Parses log file with focus on thermo data. Both one and multi line formats are supported. Any incomplete runs (no “Loop time” marker) will not be parsed.

Notes

SHAKE stats printed with thermo data are not supported yet. They are ignored in multi line format, while they may cause issues with dataframe parsing in one line format.

Parameters:

filename (str) – Filename to parse.

Returns:

[pd.DataFrame] containing thermo data for each completed run.