matscipy.io.lammpsdata
Helper class LAMMPSData to read/write LAMMPS text files.
Functions
|
Check proper dataset name. |
|
Compute number of columns from dtype. |
|
Read molecules information from LAMMPS data file. |
Classes
|
Main class to interact with LAMMPS text files. |
- matscipy.io.lammpsdata.read_molecules_from_lammps_data(fd: str | PathLike | TextIOBase, style='full')
Read molecules information from LAMMPS data file.
- Parameters:
fd – File descriptor, i.e. file path or text stream.
style – LAMMPS atomic style.
- Returns:
An object containing the molecule connectivity data.
- Return type:
Notes
For the connectivity data to make sense with atoms ids read by ASE, the
sort_by_id
flag ofread()
must be set toTrue
.
- matscipy.io.lammpsdata.check_legal_name(func)
Check proper dataset name.
- matscipy.io.lammpsdata.column_size(dtype: dtype)
Compute number of columns from dtype.
- class matscipy.io.lammpsdata.LAMMPSData(style='atomic', image_flags=False)
Bases:
object
Main class to interact with LAMMPS text files.
Methods
read
(fd)Read data from text file or stream.
write
(fd)Write data to text file or stream.
- __init__(style='atomic', image_flags=False)
Initialize data object with atom style.
- write(fd: str | PathLike | TextIOBase)
Write data to text file or stream.
- read(fd: str | PathLike | TextIOBase)
Read data from text file or stream.