CHFL_FRAME
ΒΆchfl_frame
(size_t natoms)Create an empty frame with initial capacity of natoms
. It will be resized by the library as needed.
natoms
- the size of the wanted frame
chfl_frame_atoms_count
(const CHFL_FRAME * frame, size_t * natoms)Get the current number of atoms in the frame.
frame
- The frame to analyse
natoms
- the number of atoms in the frame
chfl_frame_resize
(CHFL_FRAME * frame, size_t natoms)Resize the positions and the velocities in frame, to make space for N 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 of absence of velocities.
frame
- The frame
natoms
- The new number of atoms.
chfl_frame_positions
(CHFL_FRAME * frame, float(**) data[3], size_t * size)Get a pointer to the positions array from a frame.
The positions are stored as a N x 3 array, this function set a pointer to point to the first element of this array, and give the value of N. If the frame is resized (by writing to it, or calling chfl_frame_resize
), the pointer is invalidated.
frame
- The frame
data
- A pointer to a pointer to float[3] array, which will point to the data
size
- A pointer to the an integer to be filled with the array size
chfl_frame_velocities
(CHFL_FRAME * frame, float(**) data[3], size_t * size)Get a pointer to the velocities array from a frame.
The velocities are stored as a N x 3
array, this function set a pointer to point to the first element of this array, and give the value of N. If the frame is resized (by writing to it, or calling chfl_frame_resize
), the pointer is invalidated.
If the frame do not have velocity, this will return an error. Use chfl_frame_add_velocities
to add velocities to a frame before calling this function.
frame
- The frame
data
- A pointer to a pointer to float[3] array, which will point to the data
size
- A pointer to the an integer to be filled with the array size
chfl_frame_has_velocities
(const CHFL_FRAME * frame, bool * has_velocities)Ask wether this frame contains velocity data or not.
frame
- The frame
has_velocities
- A boolean, will be true if the frame have velocities, false otherwise.
chfl_frame_add_velocities
(CHFL_FRAME * frame)Add velocity storage to this frame.
The storage is initialized with the result of chfl_frame_atoms_count
as number of atoms. If the frame already have velocities, this does nothing.
frame
- The frame
chfl_frame_set_cell
(CHFL_FRAME * frame, const CHFL_CELL * cell)Set the UnitCell of a Frame.
frame
- The frame
cell
- The new cell
chfl_frame_set_topology
(CHFL_FRAME * frame, const CHFL_TOPOLOGY * topology)Set the Topology of a Frame.
frame
- The frame
topology
- The new topology
chfl_frame_step
(const CHFL_FRAME * frame, size_t * step)Get the Frame step, i.e. the frame number in the trajectory.
frame
- The frame
step
- This will contains the step number
chfl_frame_set_step
(CHFL_FRAME * frame, size_t step)Set the Frame step.
frame
- The frame
step
- The new frame step
chfl_frame_guess_topology
(CHFL_FRAME * frame)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.
frame
- The Frame to analyse
chfl_frame_free
(CHFL_FRAME * frame)Destroy a frame, and free the associated memory.
frame
- The frame to destroy