chemfiles::Topology
A topology contains the definition of all the particles in the system, and the liaisons between the particles (bonds, angles, dihedrals, ...).
Only the atoms and the bonds are stored, the angles and the dihedrals are computed automaticaly.
Public Functions
Topology
(size_t natoms)Construct a topology with capacity for natoms
atoms.
Topology
()Construct an empty topology.
operator[]
(size_t index)Get a reference to the atom at the position index
.
operator[]
(size_t index) constGet a const (non-modifiable) reference to the atom at the position index
.
append
(const Atom & _atom)Add an atom in the system.
remove
(size_t idx)Delete an atom in the system. If idx
is out of bounds, do nothing.
add_bond
(size_t atom_i, size_t atom_j)Add a bond in the system, between the atoms at index atom_i
and atom_j
.
remove_bond
(size_t atom_i, size_t atom_j)Remove a bond in the system, between the atoms at index atom_i
and atom_j
.
natoms
() constGet the number of atoms in the topology.
natom_types
() constGet the number of atom types in the topology.
resize
(size_t natoms)Reserve space for natoms
in the topology.
clear
()Clear the topology: this remove all atoms and all bonds, angles and dihedrals.
clear_bonds
()Clear the bonds (angles and dihedrals too) in the topology.
isbond
(size_t i, size_t j) constCheck wether the atoms at indexes i
and j
are bonded or not.
isangle
(size_t i, size_t j, size_t k) constCheck wether the atoms at indexes i
, j
and k
constitues an angle.
isdihedral
(size_t i, size_t j, size_t k, size_t m) constCheck wether the atoms at indexes i
j
, k
and m
constitues a dihedral angle
bonds
() constGet the bonds in the system.
angles
() constGet the angles in the system.
dihedrals
() constGet the dihedral angles in the system.
recalculate
()Recalculate the angles and dihedrals list from the bond list.