MDFrame
This type represents a snapshot of a molecular simulation.
MolecularDynamicsFiles.MDFrame — Typestruct MDFrameRepresents a snapshot of the molecular simulation.
Particles are stored in a table (DataFrame) with rows representing particles and columns representing particle properties.
Column names are in LAMMPS notation (see dump command documentation).
The particle table is sorted by the column with name :id, if it exists.
Commonly used particle properties can be accessed by specific MDFrame methods. The properties are (in LAMMPS notation): :id, :mol, :type, :x, :y, :z, :xs, :ys, :zs, :xu, :yu, :zu, :xsu, :ysu, :zsu, :ix, :iy, :iz, :vx, :vy, :vz, :element, :mass. Any other properties are considered 'extra' and are accessed by using the method extra_scalars.
Some of the methods for accessing particle properties generate the data if it's not present in the frame, for example: particle types may be generated from particle elements or masses.
Fields:
timestep: Timestep of the snapshotbox: Simulation box specificationparticles: Table containing particle data.system_properties: Dict containing other arbitrary system properties, like 'units' and 'time' of LAMMPS Dump or 'A' and 'R' of CFG.
MolecularDynamicsFiles.MDFrame — MethodMDFrame(
timestep::Int64,
box::SimulationBox,
particles::DataFrame,
system_properties::Dict{Symbol}
) -> MDFrame
Construct a MDFrame.
MolecularDynamicsFiles.timestep — Functiontimestep(frame::MDFrame) -> Int64
Return the timestep of the snapshot.
Base.length — Methodlength(frame::MDFrame) -> Int64
Return the number of particles in the system.
MolecularDynamicsFiles.id_tags — Functionid_tags(frame::MDFrame) -> Vector{Int64}
Return particle ids. Guaranteed to be sorted.
Corresponds to property :id.
MolecularDynamicsFiles.particle_types — Functionparticle_types(frame::MDFrame) -> Vector{Int64}
Return particle types.
Corresponds to property :type. If there's no particle type data in the frame, attempts to generate from 1) elements of particles 2) masses of particles.
MolecularDynamicsFiles.mol_tags — Functionmol_tags(frame::MDFrame) -> Vector{Int64}
Return ids of the molecules that the particles belong to.
Corresponds to property :mol.
MolecularDynamicsFiles.elements — Functionelements(frame::MDFrame) -> Vector{String}
Return particle element types.
Corresponds to property :element.
MolecularDynamicsFiles.masses — Functionmasses(frame::MDFrame) -> Vector{Float64}
Return particle masses.
Corresponds to property :mass.
MolecularDynamicsFiles.positions — Functionpositions(frame::MDFrame) -> Vector{SVector{3, Float64}}
Return unscaled wrapped positions of particles in the system.
Corresponds to properties :x, :y, :z. Performs conversion from other coordinate representations if needed and possible.
MolecularDynamicsFiles.scaled_positions — Functionscaled_positions(
frame::MDFrame
) -> Vector{SVector{3, Float64}}
Return scaled wrapped positions of particles in the system.
Corresponds to properties :xs, :ys, :zs. Performs conversion from other coordinate representations if needed and possible.
MolecularDynamicsFiles.unwrapped_positions — Functionunwrapped_positions(
frame::MDFrame
) -> Vector{SVector{3, Float64}}
Return unscaled unwrapped positions of particles in the system.
Corresponds to properties :xu, :yu, :zu. Performs conversion from other coordinate representations if needed and possible.
MolecularDynamicsFiles.scaled_unwrapped_positions — Functionscaled_unwrapped_positions(
frame::MDFrame
) -> Vector{SVector{3, Float64}}
Return scaled unwrapped positions of particles in the system.
Corresponds to properties :xsu, :ysu, :zsu. Performs conversion from other coordinate representations if needed and possible.
MolecularDynamicsFiles.images — Functionimages(frame::MDFrame) -> Vector{SVector{3, Int16}}
Return image coordinates of particles in the system.
Corresponds to properties :ix, :iy, :iz. Generates images from unwrapped coordinates if needed and possible.
MolecularDynamicsFiles.velocities — Functionvelocities(frame::MDFrame) -> Vector{SVector{3, Float64}}
Return velocities of particles in the system.
Corresponds to properties :vx, :vy, :vz.
MolecularDynamicsFiles.velocities_x — Functionvelocities_x(frame::MDFrame) -> Vector{Float64}
Return x component of velocities of particles in the system.
Corresponds to property :vx.
MolecularDynamicsFiles.velocities_y — Functionvelocities_y(frame::MDFrame) -> Vector{Float64}
Return y component of velocities of particles in the system.
Corresponds to property :vy.
MolecularDynamicsFiles.velocities_z — Functionvelocities_z(frame::MDFrame) -> Vector{Float64}
Return z component of velocities of particles in the system.
Corresponds to property :vz.
MolecularDynamicsFiles.extra_scalars — Functionextra_scalars(frame::MDFrame) -> Dict{Symbol, Vector}
Return extra scalar properties of the particles.
Properties are considered 'extra' if none of the other MDFrame methods return that property. The properties not considered 'extra' are: :id, :mol, :type, :x, :y, :z, :xs, :ys, :zs, :xu, :yu, :zu, :xsu, :ysu, :zsu, :ix, :iy, :iz, :vx, :vy, :vz, :element, :mass
MolecularDynamicsFiles.add_extra_scalar! — Functionadd_extra_scalar!(
frame::MDFrame,
name::Symbol,
values::AbstractVector{Float64}
) -> AbstractVector{Float64}
Add an extra scalar particle property.
name may not be one of :id, :mol, :type, :x, :y, :z, :xs, :ys, :zs, :xu, :yu, :zu, :xsu, :ysu, :zsu, :ix, :iy, :iz, :vx, :vy, :vz, :element, :mass. values must be of length length(frame). values[i] corresponds to the value of the added property of particle with id id_tags(frame)[i].
MolecularDynamicsFiles.system_properties — Functionsystem_properties(frame::MDFrame) -> Dict{Symbol}
Return other system properties, such as "units" and "time" of lammps dump or "A" and "R" of CFG.
MolecularDynamicsFiles.box — Functionbox(frame::MDFrame) -> SimulationBox
Return the simulation box of the frame.
MolecularDynamicsFiles.boxvectors — Functionboxvectors(frame::MDFrame) -> SMatrix{3, 3, Float64}
Return the basis vectors of the simulation box as a matrix. Simulation cell vectors are in the columns.
MolecularDynamicsFiles.boxorigin — Functionboxorigin(frame::MDFrame) -> SVector{3, Float64}
Return the origin of the simulation box.
MolecularDynamicsFiles.pbc — Methodpbc(frame::MDFrame) -> Tuple{Bool, Bool, Bool}
Return periodic boundary conditions.
MolecularDynamicsFiles.bc — Methodbc(frame::MDFrame) -> BoundaryConditions
Return boundary conditions.
MolecularDynamicsFiles.istriclinic — Methodistriclinic(frame::MDFrame) -> Bool
Return if the simulation box of the frame is triclinic.