ferrodispcalc.io package#

Submodules#

ferrodispcalc.io.core module#

class ferrodispcalc.io.core.Traj(input_stru: str | list[Structure] | list[Atoms] | Structure | Atoms, format: str = None, type_map: list[str] = None)[source]#

Bases: object

ferrodispcalc.io.lammps module#

class ferrodispcalc.io.lammps.LAMMPSdata[source]#

Bases: object

class ferrodispcalc.io.lammps.LAMMPSdump(file_name: str, type_map: list[str] = None)[source]#

Bases: object

LAMMPSdump calss is used to read the lammps dump file.

Attributes:#

file_name: str

The name of the lammps dump file.

type_map: list[str]

The list of atom types. The index of the list is the atom type in the lammps dump file.

Example:#

>>> from ferrodispcalc.io import LAMMPSdump
>>> from ferrodispcalc.type_map import UniPero
>>> lmp = LAMMPSdump('dump.lammpstrj', UniPero)
>>> stru = lmp.get_first_frame() # get the first frame, in pymatgen format.
>>> nframes = lmp.get_nframes() # get the number of frames in the lammps dump file.

Methods:#

get_first_frame():

get the first frame, in pymatgen format.

get_nframes():

get the number of frames.

get_natoms():

get the number of atoms.

get_first_frame() Atoms[source]#

Get the first frame in the lammps dump file. Return the structure in ASE/atoms format.

Parameters:#

None

Returns:#

Structure:

The structure in pymatgen format.

get_natoms() int[source]#

Get the number of atoms in the lammps dump file.

Returns:#

int: The number of atoms.

get_next_frame() Atoms[source]#

Read the next frame in the lammps dump file iteratively.

get_nframes() int[source]#

Get the number of frames in the lammps dump file.

Parameters:#

None

Returns:#

int:

The number of frames.

Module contents#