write_data

mdhelper.lammps.topology.write_data(file: str | TextIOWrapper, positions: tuple[ndarray[float]], *, bonds: tuple[ndarray[int]] = None, angles: tuple[ndarray[int]] = None, dihedrals: tuple[ndarray[int]] = None, impropers: tuple[ndarray[int]] = None, dimensions: ndarray[float] = None, tilt: ndarray[float] = None, charges: ndarray[float] = None, masses: ndarray[float] = None) None[source]

Write topological data generated by create_atoms() to a LAMMPS data file in atom_style full.

Parameters:
filestr or _io.TextIOWrapper

LAMMPS data file.

positionstuple

Atomic positions. Each element of the tuple should contain atoms of the same atom type.

Shape: Tuple of arrays with shape \((*,\,3)\).

Reference units: \(\mathrm{Å}\).

bondstuple, keyword-only, optional

Pairs of indices of bonded atoms. Each element of the tuple should contain bonds of the same bond type.

Shape: Tuple of arrays with shape \((*,\,2)\).

anglestuple, keyword-only, optional

Triples of indices of atoms that form an angle. Each element of the tuple should contain angles of the same angle type.

Shape: Tuple of arrays with shape \((*,\,3)\).

dihedralstuple, keyword-only, optional

Quadruples of indices of atoms that form a dihedral. Each element of the tuple should contain dihedrals of the same dihedral type.

Shape: Tuple of arrays with shape \((*,\,4)\).

improperstuple, keyword-only, optional

Quadruples of indices of atoms that form an improper. Each element of the tuple should contain impropers of the same improper type.

Shape: Tuple of arrays with shape \((*,\,4)\).

dimensionsarray-like, keyword-only, optional

Box dimensions. If three values are provided, the box dimensions are assumed to be from \(0\) to the specified values. If six values are provided, the box dimensions go from the three values in the first column to the three values in the second column.

Shape: \((3,)\) or \((3,\,2)\).

Reference units: \(\mathrm{Å}\).

tiltarray-like, keyword-only, optional

Box \(xy\), \(xz\), and \(yz\) tilt factors.

Shape: \((3,)\).

chargesarray-like, keyword-only, optional

Atomic charges.

Shape: \((N,)\).

massesarray-like, keyword-only, optional

Atomic masses.

Shape: \((N,)\).