chemfiles::
Frame
¶A frame contains data from one simulation step The Frame class holds data from one step of a simulation: the current topology, the positions, and the velocities of the particles in the system. If some information is missing (topology or velocity or unit cell), the corresponding data is filled with a default value. Specifically:
[optional]: http://en.cppreference.com/w/cpp/experimental/optional
Public Functions
Frame
()¶Default constructor.
Frame
(size_t natoms)¶Constructor reserving some space for `natoms`.
Frame
(Topology topology, UnitCell cell = UnitCell ())¶Constructor reserving space for `topology.natoms()`, and using `cell` as unit cell. `cell` default to an `INFINITE` unit cell.
clone
() const¶Get a clone (exact copy) of this frame.
This replace the implicit copy constructor (which is disabled) to make an explicit copy of the frame.
positions
()¶Get a modifiable reference to the positions.
positions
() const¶Get a const (non modifiable) reference to the positions.
velocities
()¶Get an optional modifiable reference to the velocities.
velocities
() const¶Get an optional const (non modifiable) reference to the velocities.
add_velocities
()¶Add velocities to this frame. If velocities are already defined, this functions does nothing.
set_topology
(const Topology &topology)¶Set the system topology.
cell
() const¶Get a const (non-modifiable) reference to the unit cell of the system.
resize
(size_t natoms)¶Resize the frame to store data for `natoms` atoms. If the new size is bigger than the old one, missing data is initializd to 0. Pre-existing values are conserved. This function only resize the velocities if the data is present.
reserve
(size_t natoms)¶Reserve size in the frame to store data for `natoms` atoms. This function only reserve storage for the the velocities if the data is present.
add_atom
(Atom atom, Vector3D position, Vector3D velocity = Vector3D())¶Add an `atom` at the given `position` and optionally with the given `velocity`. The `velocity` value will only be used if this frame contains velocity data.
natoms
() const¶Get the number of atoms in the system.
remove
(size_t i)¶Remove the atom at index `i` in the system. `i` must be lower than `natoms()`.
step
() const¶Get the current simulation step.
set_step
(size_t s)¶Set the current simulation step.
guess_topology
()¶Guess the bonds, angles and dihedrals in the system. The bonds are guessed using a distance-based algorithm, and then angles and dihedrals are guessed from the bonds.