oILAB
Loading...
Searching...
No Matches
lammps_writer Namespace Reference

Functions

 compute_triclinic_box (ell1, ell2, zlo=-20.0, zhi=20.0)
 
 write_lammps_data (filename, positions, atom_types, charges, ell1, ell2, atom_style="atomic", molecule_ids=None, z_padding=20.0, comment="LAMMPS data file")
 
 summarize_configuration (positions, atom_types, ell1, ell2)
 

Function Documentation

◆ compute_triclinic_box()

lammps_writer.compute_triclinic_box (   ell1,
  ell2,
  zlo = -20.0,
  zhi = 20.0 
)
Convert two 2D Cartesian box vectors into LAMMPS triclinic box parameters.

Assumes the user has already rotated the system, if desired.

Parameters
----------
ell1, ell2 : array-like
    2D Cartesian simulation cell vectors.
zlo, zhi : float
    Lower and upper z bounds.

Returns
-------
dict
    Dictionary with xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz.

Definition at line 4 of file lammps_writer.py.

◆ summarize_configuration()

lammps_writer.summarize_configuration (   positions,
  atom_types,
  ell1,
  ell2 
)
Print a compact summary of the configuration.

Definition at line 152 of file lammps_writer.py.

◆ write_lammps_data()

lammps_writer.write_lammps_data (   filename,
  positions,
  atom_types,
  charges,
  ell1,
  ell2,
  atom_style = "atomic",
  molecule_ids = None,
  z_padding = 20.0,
  comment = "LAMMPS data file" 
)
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.