Lammps Data File class

class pylam.LammpsDataFile(filename=None, atom_style='full')[source]

Class supporting LAMMPS data file.

Parameters:
  • filename (str) – data file to read initially
  • atom_style (str) – supported: atomic, charge, molecular and full
Returns:

Lammps data file object

Return type:

LammpsDataFile

header = None

Header section data -> LammpsDataHeader

masses = None

Masses section data -> LammpsDataMasses

coeffs = None

Coefficients section data -> LammpsDataCoeffs

atoms = None

Atoms section data -> LammpsDataAtoms

velos = None

Velocities section data -> LammpsDataVelocities

bonds = None

Bonds section data -> LammpsDataBonds

angles = None

Angles section data -> LammpsDataAngles

dihedrals = None

Dihedrals section data -> LammpsDataDihedrals

impropers = None

Impropers section data -> LammpsDataImpropers

write(filename)[source]

Write a LAMMPS data file.

Parameters:filename – LAMMPS data file name
Lx

Box length in X dim.

Ly

Box length in Y dim.

Lz

Box length in Z dim.

Vol

Box volume

Masses

class pylam.LammpsDataMasses[source]

Class for parsing, storage & administration of the Masses sections in the LAMMPS data file.

Coefficients

class pylam.LammpsDataCoeffs[source]

Class for storage & administration of the Coefficients sections in the LAMMPS data file.

Each individual section is stored in a LammpsDataCoeffsSection object.

coeffsSections = ['Pair Coeffs', 'PairIJ Coeffs', 'Bond Coeffs', 'Angle Coeffs', 'Dihedral Coeffs', 'Improper Coeffs', 'BondBond Coeffs', 'BondAngle Coeffs', 'MiddleBondTorsion Coeffs', 'EndBondTorsion Coeffs', 'AngleTorsion Coeffs', 'AngleAngleTorsion Coeffs', 'BondBond13 Coeffs', 'AngleAngle Coeffs']

List of supported Coefficients section names

Note

This is the only position where a section name needs to be declared!

class pylam.LammpsDataCoeffsSection(coeffsType)[source]

Class for parsing, storage & administration of a Coefficients section in the LAMMPS data file.

Parameters:coeffsType (str) – Coeffs section name (see LammpsDataCoeffs.coeffsSections )

Atoms

class pylam.LammpsDataAtoms(atom_style)[source]

Class for parsing, storage & administration of the Atoms section in the LAMMPS data file.

Each individual atom is stored in an object, like LammpsDataAtomAtomic, which type depends on the atom_style, and is derived from LammpsDataAtomTemplate.

Parameters:atom_style (str) – supported: atomic, charge, molecular and full
parseLine(line)[source]

Creates a new atom by parsing a string.

Parameters:line (str) – data line of the Atoms section
ids

Returns a list of all atom IDs.

class pylam.LammpsDataAtomTemplate(line=None)[source]

Storage class template for an atom.

class pylam.LammpsDataAtomAtomic(line=None)[source]

Basis: LammpsDataAtomTemplate

Storage class for an atom of style atomic.

Supported properties: id, atom-type, x, y, z

Velocities

class pylam.LammpsDataVelocities[source]

Class for parsing, storage & administration of the Velocities section in the LAMMPS data file.