topo_metrics.io.lammps_data#

Classes#

LammpsDataComponents

Components extracted from a LAMMPS data file.

Functions#

load_lammps_data(→ LammpsDataComponents)

Load a LAMMPS data file into ASE plus a periodic bond graph.

Module Contents#

class topo_metrics.io.lammps_data.LammpsDataComponents[source]#

Components extracted from a LAMMPS data file.

ase_atoms: ase.Atoms[source]#

ASE atoms object with cell/pbc/positions populated.

edges: numpy.typing.NDArray[numpy.int_][source]#

[i, j, sx, sy, sz] (1-based indices).

Type:

Neighbourlist with image shifts

symbols: list[str][source]#

Per-node symbols/types used for Topology node types.

cart_coords: numpy.typing.NDArray[numpy.floating][source]#

Cartesian coordinates, shape (N, 3).

frac_coords: numpy.typing.NDArray[numpy.floating] | list[None][source]#

Fractional coordinates, shape (N, 3) if periodic, else list[None].

topo_metrics.io.lammps_data.load_lammps_data(filename: pathlib.Path | str, *, atom_style: str = 'atomic', units: str = 'metal', sort_by_id: bool = True, prefer_bonds: bool = True, cutoff: float = 0.0, pair_cutoffs: dict[tuple[str, str], float] | None = None, contract_neighborlist: bool = False, remove_types: Iterable[object] | None = None, remove_degree2: bool = False, omit_node_types: bool = False) LammpsDataComponents[source]#

Load a LAMMPS data file into ASE plus a periodic bond graph.

This reader uses ASE’s LAMMPS-data support to obtain an ase.Atoms object. If a Bonds section is present, bonds are used to construct the neighbourlist; otherwise, a neighbour list can be inferred by cutoff using topo_metrics.neighbours.graph_edges_by_cutoff().

The neighbour list uses the convention [i, j, sx, sy, sz] where indices are 1-based and the image shift (sx, sy, sz) is chosen assuming the minimum image convention (MIC).