Function manipulating CHFL_FRAMEΒΆ

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.

Return
A pointer to the frame, or NULL in case of error
Parameters
  • natoms -

    the size of the wanted frame

int chfl_frame_atoms_count(const CHFL_FRAME * frame, size_t * natoms)

Get the current number of atoms in the frame.

Return
The status code
Parameters
  • frame -

    The frame to analyse

  • natoms -

    the number of atoms in the frame

int 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.

Return
The status code
Parameters
  • frame -

    The frame

  • natoms -

    The new number of atoms.

int 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.

Return
The status code
Parameters
  • 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

int 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.

Return
The status code
Parameters
  • 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

int chfl_frame_has_velocities(const CHFL_FRAME * frame, bool * has_velocities)

Ask wether this frame contains velocity data or not.

Return
The status code
Parameters
  • frame -

    The frame

  • has_velocities -

    A boolean, will be true if the frame have velocities, false otherwise.

int 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.

Return
The status code
Parameters
  • frame -

    The frame

int chfl_frame_set_cell(CHFL_FRAME * frame, const CHFL_CELL * cell)

Set the UnitCell of a Frame.

Return
The status code
Parameters
  • frame -

    The frame

  • cell -

    The new cell

int chfl_frame_set_topology(CHFL_FRAME * frame, const CHFL_TOPOLOGY * topology)

Set the Topology of a Frame.

Return
The status code
Parameters
  • frame -

    The frame

  • topology -

    The new topology

int chfl_frame_step(const CHFL_FRAME * frame, size_t * step)

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

Return
The status code
Parameters
  • frame -

    The frame

  • step -

    This will contains the step number

int chfl_frame_set_step(CHFL_FRAME * frame, size_t step)

Set the Frame step.

Return
The status code
Parameters
  • frame -

    The frame

  • step -

    The new frame step

int 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.

Return
The status code
Parameters
  • frame -

    The Frame to analyse

int chfl_frame_free(CHFL_FRAME * frame)

Destroy a frame, and free the associated memory.

Return
The status code
Parameters
  • frame -

    The frame to destroy