Frame

Chemfiles.FrameType

A Frame holds data for one step of a simulation. As not all formats provide all the types of information, some fields may be initialized to a default value. A Frame may contain the following data:

  • Positions for all the atoms in the system;
  • Velocities for all the atoms in the system;
  • The Topology of the system;
  • The UnitCell of the system.
source
Base.angleMethod
angle(frame::Frame, i::Integer, j::Integer, k::Integer)

Calculate the angle made by three atoms.

source
Base.lengthMethod
length(frame::Frame)

Get the number of atoms in the frame.

source
Base.resize!Method
resize!(frame::Frame, natoms::Integer)

Resize the positions and the velocities in the frame, to make space for natoms atoms. This function may invalidate any pointer to the positions or the velocities if the new size is bigger than the old one. In all the cases, previous data is conserved. This function conserve the presence or absence of velocities.

source
Base.sizeMethod
size(frame::Frame)

Get the number of atoms in the frame.

source
Base.stepMethod
step(frame::Frame)

Get the frame step, i.e. the frame number in the trajectory.

source
Chemfiles.add_atom!Function
add_atom!(
    frame::Frame,
    atom::Atom,
    position::Vector{Float64},
    velocity::Vector{Float64} = Float64[0.0,0.0,0.0]
)

Add an atom and the corresponding position and velocity data to a frame.

source
Chemfiles.add_bond!Function
add_bond!(frame::Frame, i::Integer, j::Integer, order=nothing)

Add an additional bond to the Frame's Topology.

source
Chemfiles.add_velocities!Method
add_velocities!(frame::Frame)

Add velocities to this frame. The storage is initialized with the result of size(frame) as the number of atoms. If the frame already has velocities, this does nothing.

source
Chemfiles.dihedralMethod
dihedral(frame::Frame, i::Integer, j::Integer, k::Integer, m::Integer)

Calculate the dihedral (torsional) angle made by four unbranched atoms.

source
Chemfiles.distanceMethod
distance(frame::Frame, i::Integer, j::Integer)

Calculate the distance between two atoms.

source
Chemfiles.guess_bonds!Method
guess_bonds!(frame::Frame)

Guess the bonds, angles, and dihedrals in the frame using a distance criteria.

source
Chemfiles.out_of_planeMethod
out_of_plane(frame::Frame, i::Integer, j::Integer, k::Integer, m::Integer)

Calculate the out-of-plane (improper) angle made by four atoms.

source
Chemfiles.positionsMethod
positions(frame::Frame)

Get the positions in a Frame as an array. The positions are readable and writable from this array. If the frame is resized (by writing to it, or calling resize!), the array is invalidated.

source
Chemfiles.remove_atom!Method
remove_atom!(frame::Frame, index::Integer)

Remove the atom at index from the frame.

This function modifies all the atoms indexes after index, and invalidates any array obtained using positions or velocities.

source
Chemfiles.velocitiesMethod
velocities(frame::Frame)

Get the velocities in a Frame as an array. The velocities are readable and writable from this array. If the frame is resized (by writing to it, or calling resize!), the array is invalidated.

If the frame do not have velocity, this function will error. You can use add_velocities! to add velocities to a frame before calling this function.

source