Function manipulating CHFL_TOPOLOGYΒΆ

CHFL_TOPOLOGY * chfl_topology(void)

Create a new empty topology.

Return
A pointer to the new topology, or NULL in case of error

CHFL_TOPOLOGY * chfl_topology_from_frame(const CHFL_FRAME * frame)

Get a copy of the topology of a frame.

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

    The frame

int chfl_topology_atoms_count(const CHFL_TOPOLOGY * topology, size_t * natoms)

Get the current number of atoms in the topology.

Return
The status code
Parameters
  • topology -

    The topology to analyse

  • natoms -

    Will contain the number of atoms in the frame

int chfl_topology_append(CHFL_TOPOLOGY * topology, const CHFL_ATOM * atom)

Add an atom at the end of a topology.

Return
The status code
Parameters
  • topology -

    The topology

  • atom -

    The atom to be added

int chfl_topology_remove(CHFL_TOPOLOGY * topology, size_t i)

Remove an atom from a topology by index. This modify all the other atoms indexes.

Return
The status code
Parameters
  • topology -

    The topology

  • i -

    The atomic index

int chfl_topology_isbond(const CHFL_TOPOLOGY * topology, size_t i, size_t j, bool * result)

Tell if the atoms i and j are bonded together.

Return
The status code
Parameters
  • topology -

    The topology

  • i -

    index of the first atom in the topology

  • j -

    index of the second atom in the topology

  • result -

    true if the atoms are bonded, false otherwise

int chfl_topology_isangle(const CHFL_TOPOLOGY * topology, size_t i, size_t j, size_t k, bool * result)

Tell if the atoms i, j and k constitues an angle.

Return
The status code
Parameters
  • topology -

    The topology

  • i -

    index of the first atom in the topology

  • j -

    index of the second atom in the topology

  • k -

    index of the third atom in the topology

  • result -

    true if the atoms constitues an angle, false otherwise

int chfl_topology_isdihedral(const CHFL_TOPOLOGY * topology, size_t i, size_t j, size_t k, size_t m, bool * result)

Tell if the atoms i, j, k and m constitues a dihedral angle.

Return
The status code
Parameters
  • topology -

    The topology

  • i -

    index of the first atom in the topology

  • j -

    index of the second atom in the topology

  • k -

    index of the third atom in the topology

  • m -

    index of the fourth atom in the topology

  • result -

    true if the atoms constitues a dihedral angle, false otherwise

int chfl_topology_bonds_count(const CHFL_TOPOLOGY * topology, size_t * nbonds)

Get the number of bonds in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • nbonds -

    After the call, contains the number of bond

int chfl_topology_angles_count(const CHFL_TOPOLOGY * topology, size_t * nangles)

Get the number of angles in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • nangles -

    After the call, contains the number of angles

int chfl_topology_dihedrals_count(const CHFL_TOPOLOGY * topology, size_t * ndihedrals)

Get the number of dihedral angles in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • ndihedrals -

    After the call, contains the number of dihedral angles

int chfl_topology_bonds(const CHFL_TOPOLOGY * topology, size_t(*) data[2], size_t nbonds)

Get the list of bonds in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • data -

    A nbonds x 2 array to be filled with the bonds in the system

  • nbonds -

    The size of the array. This should equal the value given by the chfl_topology_bonds_count function

int chfl_topology_angles(const CHFL_TOPOLOGY * topology, size_t(*) data[3], size_t nangles)

Get the list of angles in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • data -

    A nangles x 3 array to be filled with the angles in the system

  • nangles -

    The size of the array. This should equal the value given by the chfl_topology_angles_count function

int chfl_topology_dihedrals(const CHFL_TOPOLOGY * topology, size_t(*) data[4], size_t ndihedrals)

Get the list of dihedral angles in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • data -

    A ndihedrals x 4 array to be filled with the dihedral angles in the system

  • ndihedrals -

    The size of the array. This should equal the value given by the chfl_topology_dihedrals_count function

int chfl_topology_add_bond(CHFL_TOPOLOGY * topology, size_t i, size_t j)

Add a bond between the atoms i and j in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • i -

    index of the first atom in the topology

  • j -

    index of the second atom in the topology

int chfl_topology_remove_bond(CHFL_TOPOLOGY * topology, size_t i, size_t j)

Remove any existing bond between the atoms i and j in the system.

Return
The status code
Parameters
  • topology -

    The topology

  • i -

    index of the first atom in the topology

  • j -

    index of the second atom in the topology

int chfl_topology_free(CHFL_TOPOLOGY * topology)

Destroy a topology, and free the associated memory.

Return
The status code
Parameters
  • topology -

    The topology to destroy