chfl_topology type

type chfl_topology

A chfl_topology contains the definition of all the atoms in the system, and the liaisons between the atoms (bonds, angles, dihedrals, …). It will also contain all the residues information if it is available.

The initialization routine for chfl_topology are:

Type fields:
subroutine chfl_topology%init([status])

Initialize this topology with a new empty topology.

Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%from_frame(frame[, status])

Initialize this topology with a copy of the topology of frame.

Parameters:frame [chfl_frame] :: the frame
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%copy(topology[, status])

Initialize this topology with a copy of topology.

Parameters:topology [chfl_topology] :: topology to copy
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%atoms_count(natoms[, status])

Get the number of atoms in the topology in natoms.

Parameters:natoms [integer] :: number of atoms in the topology
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%resize(natoms[, status])

Resize the topology to hold natoms atoms. If the new number of atoms is bigger than the current number, new atoms will be created with an empty name and type. If it is lower than the current number of atoms, the last atoms will be removed, together with the associated bonds, angles and dihedrals.

Parameters:natoms [integer] :: new size of the topology
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%add_atom(atom[, status])

Add a copy of atom at the end of the topology.

Parameters:atom [chfl_atom] :: atom to be added
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%remove(i[, status])

Remove the atom at index i from the topology.

This shifts all the atoms indexes after i by 1 (n becomes n-1).

Parameters:i [integer] :: index of the atom to remove
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%bonds_count(nbonds[, status])

Get the number of bonds in the topology in nbonds.

Parameters:nbonds [integer] :: number of bonds
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%angles_count(nangles[, status])

Get the number of angles in the topology in nangles.

Parameters:nangles [integer] :: number of angles
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%dihedrals_count(ndihedrals[, status])

Get the number of dihedral angles in the topology in ndihedrals.

Parameters:ndihedrals [integer] :: number of dihedral angles
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%impropers_count(nimpropers[, status])

Get the number of improper dihedral angles in the topology in nimpropers.

Parameters:nimpropers [integer] :: number of improper dihedral angles
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%bonds(data, nbonds[, status])

Get the list of bonds in the topology in the pre-allocated array data of size 2 x nbonds.

data size must be passed in the nbonds parameter, and be equal to the result of chfl_topology%bonds_count().

Parameters:
  • data (2, nbonds) [integer] :: 2 x nbonds array to be filled with the bonds in the system
  • nbonds [integer] :: size of the array. This should be equal to the value given by chfl_topology%bonds_count().
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%angles(data, nangles[, status])

Get the list of angles in the topology in the pre-allocated array data of size 3 x nangles.

data size must be passed in the nangles parameter, and be equal to the result of chfl_topology%angles_count().

Parameters:
  • data (3, nangles) [integer] :: 3 x nangles array to be filled with the angles in the system
  • nangles [integer] :: size of the array. This should be equal to the value given by chfl_topology%angles_count().
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%dihedrals(data, ndihedrals[, status])

Get the list of dihedral angles in the topology in the pre-allocated array data of size 4 x ndihedrals.

data size must be passed in the ndihedrals parameter, and be equal to the result of chfl_topology%dihedrals_count().

Parameters:
  • data (4, ndihedrals) [integer] :: 4 x ndihedrals array to be filled with the dihedral angles in the system
  • ndihedrals [integer] :: size of the array. This should be equal to the value given by chfl_topology%dihedrals_count().
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%impropers(data, nimpropers[, status])

Get the list of improper dihedral angles in the topology in the pre-allocated array data of size 4 x nimpropers.

data size must be passed in the nimpropers parameter, and be equal to the result of chfl_topology%impropers_count().

Parameters:
  • data (4, nimpropers) [integer] :: 4 x nimpropers array to be filled with the dihedral angles in the system
  • nimpropers [integer] :: size of the array. This should be equal to the value given by chfl_topology%impropers_count().
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%add_bond(i, j[, status])

Add a bond between the atoms at indexes i and j in the topology

Parameters:
  • i [integer] :: atomic index of the first atom of the bond
  • j [integer] :: atomic index of the second atom of the bond
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%remove_bond(i, j[, status])

Remove any existing bond between the atoms at indexes i and j in the topology.

This function does nothing if there is no bond between i and j.

Parameters:
  • i [integer] :: The atomic index of the first atom
  • j [integer] :: The atomic index of the second atom
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%residues_count(natoms[, status])

Get the number of residues in the topology in nresidues.

Parameters:natoms [integer] :: number of residues
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%add_residue(residue[, status])

Add a copy of residue to this topology.

The residue id must not already be in the topology, and the residue must contain only atoms that are not already in another residue.

Parameters:residue [chfl_residue] :: residue to add in the topology
Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.
subroutine chfl_topology%residues_linked(first, second, are_linked[, status])

Check if the two residues first and second from the topology are linked together, i.e. if there is a bond between one atom in the first residue and one atom in the second one, and store the result in result.

Parameters:
  • first [chfl_residue] :: first residue
  • second [chfl_residue] :: second residue
  • are_linked [logical,kind=1] :: .true. if the residues are linked, .false. otherwise
Options:

status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.

subroutine chfl_topology%free([status])

Destroy a topology, and free the associated memory

Options:status [integer,optional, kind=chfl_status] :: status code of the operation. If it is not equal to CHFL_SUCCESS, you can learn more about the error by using chfl_last_error.