chemfiles::FrameA frame contains data from one simulation step.
The Frame class holds data from one step of a simulation: the current topology, the positions, and maybe the velocities of the particles in the system.
Public Functions
Frame()Default constructor, reserving space for 100 atoms.
Frame(size_t natoms)Constructor reserving some space for natoms.
Frame(Topology top, bool has_velocities = false)Constructor called to build a frame that can hold the data from a specific topology.
positions()Get a modifiable reference to the positions.
positions() constGet a const (non modifiable) reference to the positions.
positions(const Array3D & pos)Set the positions.
has_velocities() constDoes this frame have velocity data ?
velocities()Get a modifiable reference to the velocities.
velocities() constGet a const (non modifiable) reference to the velocities.
velocities(const Array3D & vel)Set the velocities.
raw_positions(float pos[][3], size_t size) constGet a copy of the positions, as a C-style array. The array is assumed to have a shape (size x 3); i.e. pos[size][3]. The size should be equal to the number of particles in the system.
raw_velocities(float vel[][3], size_t size) constGet a copy of the velocities, as a C-style array. The array is assumed to have a shape (size x 3); i.e. vel[size][3]. The size should be equal to the number of particles in the system.
natoms() constGet the number of particles in the system.
topology()Get a modifiable reference to the internal topology.
topology() constGet a const (non-modifiable) reference to the internal topology.
topology(const Topology & top)Set the system topology.
cell() constGet a const (non-modifiable) reference to the unit cell of the system.
cell(const UnitCell & c)Set the unit cell fo the system.
resize(size_t size, bool resize_velocities = false)Resize the internal arrays, and initialize them with 0. The resize_velocities parameter should be true to resize also the velocities array.
step() constGet the current simulation step.
step(size_t s)Set the current simulation step.
guess_topology(bool bonds = true)Try to guess the bonds, angles and dihedrals in the system. If bonds is true, guess everything; else only guess the angles and dihedrals from the bond list.