TrajectoryFrame¶
- class mdcraft.core.TrajectoryFrame(frame: int, time: float, *, timestep: int = None, dimensions: ndarray[float64] = None, n_atoms: int = None, ids: ndarray[uint32] = None, positions: ndarray[float64] = None, forces: ndarray[float64] = None, velocities: ndarray[float64] = None, **kwargs)[source]¶
Bases:
objectTrajectory frame.
This class holds the data of a single frame in a trajectory.
- Parameters:
- frameint
Frame number.
- timefloat
Simulation time.
Reference unit: \(\mathrm{ps}\).
- timestepint, keyword-only, optional
Timestep number.
- dimensionsnumpy.ndarray, keyword-only, optional
Simulation box dimensions (or lattice parameters).
Reference units: \(\mathrm{nm}\) for lengths and degrees (\(^\circ\)) for angles.
- n_atomsint, keyword-only, optional
Number of atoms.
- idsnumpy.ndarray, keyword-only, optional
Atom indices or identifiers.
- positionsnumpy.ndarray, keyword-only, optional
Atom positions.
Reference unit: \(\mathrm{nm}\).
- forcesnumpy.ndarray, keyword-only, optional
Forces exerted on the atoms.
Reference unit: \(\mathrm{kJ/(mol\cdot nm)}\).
- velocitiesnumpy.ndarray, keyword-only, optional
Atom velocities.
Reference unit: \(\mathrm{nm/ps}\).
- **kwargsdict
Additional or non-standard per-atom attributes to be stored in the extra attribute.
Examples:
Topology information, like masses and charges.
LAMMPS-specific attributes, like image flags.
Custom attributes, like LAMMPS computes, fixes, and variables.
Note
All additional attributes are in the original simulation units specified and will likely not be consistent with the internal set of units used by MDCraft.
- Attributes:
- extradict
Additional or non-standard per-atom attributes.
Examples:
Attribute
Source(s)
Per-atom data type
"molecule_ids"LAMMPS dump:
molattribute
int
"types"LAMMPS dump:
typeattribute
int
"labels"LAMMPS dump:
typelabelattribute
str
"elements"LAMMPS dump:
elementattribute
str
"masses"LAMMPS dump:
massattribute
float
"charges"LAMMPS dump:
chargeattribute
float
"image_flags"LAMMPS dump:
ix,iy, andizattributes
numpy.ndarray[int]
"dipole_moments"LAMMPS dump:
mux,muy, andmuzattributes
numpy.ndarray[float]
"dipole_moments_magnitudes"LAMMPS dump:
muattribute
float
"angular_velocities"LAMMPS dump:
omegax,omegay, andomegazattributes
numpy.ndarray[float]
"angular_momenta"LAMMPS dump:
angmomx,angmomy, andangmomzattributes
numpy.ndarray[float]
"torques"LAMMPS dump:
tqx,tqy, andtqzattributes
numpy.ndarray[float]
custom
LAMMPS dump: attributes beginning with
c_,d_,d2_,f_,i_,i2_, andv_
any
Methods
- property dimensions: ndarray[float64]¶
Simulation box dimensions (or lattice parameters).
Sources:
LAMMPS dump:
ITEM: BOX BOUNDS [...]header.
Reference units: \(\mathrm{nm}\) for lengths and degrees (\(^\circ\)) for angles.
- property forces: ndarray[float64]¶
Forces exerted on the atoms.
Sources:
LAMMPS dump:
fx,fy, andfzattributes.
Reference unit: \(\mathrm{kJ/(mol\cdot nm)}\).
- property ids: ndarray[uint32]¶
Atom indices or identifiers.
Sources:
LAMMPS dump:
idattribute or enumeration.
- property positions: ndarray[float64]¶
Atom positions.
Sources:
LAMMPS dump:
x[su],y[su], andz[su]attributes.
Reference unit: \(\mathrm{nm}\).