pymatgen.io.lammps.outputs module

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

Bases: monty.json.MSONable

Object for representing dump data for a single snapshot.

Base constructor.

Parameters
  • timestep (int) – Current timestep.

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

  • box (LammpsBox) – Simulation box.

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

as_dict()[source]

A JSON serializable dict representation of an object.

classmethod from_dict(d)[source]
Parameters

d – Dict representation.

Returns

MSONable class.

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.