Write a LAMMPS data file for atomistic simulations.
This function generates a triclinic simulation box from the in-plane
lattice vectors (ell1, ell2) and writes atomic data in either
'atomic' or 'full' atom_style format.
Parameters
----------
filename : str
Output file name.
positions : list[(x, y, z)]
Cartesian atomic positions.
atom_types : list[int]
Integer atom types (1-based), consistent with LAMMPS conventions.
charges : list[float]
Atomic charges. Used only when atom_style='full'. Ignored otherwise.
ell1, ell2 : array-like
2D Cartesian lattice vectors defining the in-plane periodic cell.
These are converted internally into a triclinic LAMMPS box.
atom_style : str, optional
LAMMPS atom style. Supported options:
- 'atomic' : writes (id, type, x, y, z)
- 'full' : writes (id, molecule-ID, type, charge, x, y, z)
molecule_ids : list[int] or None, optional
Molecule (or layer) IDs for each atom, required for certain
many-body or interlayer potentials (e.g., ilp/tmd).
If None and atom_style='full', all atoms are assigned molecule ID = 1.
z_padding : float, optional
Half-width of the simulation box in the z-direction. The box is
constructed as [ -z_padding, z_padding ]. This should be large
enough to avoid spurious interactions between periodic images
in z when using boundary p p p.
comment : str, optional
Header comment written at the top of the data file.
Definition at line 51 of file lammps_writer.py.