Gromacs  2027.0-dev-20261118-bc88ada
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions
MTopLookUp Class Reference

#include <gromacs/topology/include/gromacs/topology/mtop_lookup.h>

Description

Class for quickly looking up properties of atoms based on global atom index

This class stores the index of the molecule block for the last lookup, which enables faster lookup for series of indices belonging to the same molecule block.

Classes

struct  AtomAndResidueNameAndNumber
 Struct for returning atom and residue name and index. More...
 
struct  MolblockAtomIndex
 Struct for returning the molecular topology indices of a global atom index. More...
 

Public Member Functions

 MTopLookUp (const gmx_mtop_t &mtop)
 Constructor. More...
 
MolblockAtomIndex getMolblockAtomIndex (const int globalAtomIndex)
 Look up the molecule block and other indices of a global atom index. More...
 
int getMoleculeIndex (const int globalAtomIndex)
 Returns the global molecule index of a global atom index. More...
 
const t_atom & getAtomParameters (const int globalAtomIndex)
 Returns the atom data for an atom based on global atom index. More...
 
AtomAndResidueNameAndNumber getAtomAndResidueNameAndNumber (const int globalAtomIndex)
 Look up the atom and residue name and residue number and index of a global atom index. More...
 
int getGlobalResidueIndex (const int globalAtomIndex)
 Look up global residue index for a global atom index. More...
 
const t_resinfo & getResidueInfo (const int globalAtomIndex)
 Returns residue information for an atom based on global atom index. More...
 
const t_pdbinfo & getAtomPdbInfo (const int globalAtomIndex)
 Returns PDB information for an atom based on global atom index. More...
 
const gmx_mtop_t & mtop () const
 Returns a reference to the molecular topology.
 

Constructor & Destructor Documentation

MTopLookUp::MTopLookUp ( const gmx_mtop_t &  mtop)
inline

Constructor.

Parameters
[in]mtopA reference to the molecule topology

Member Function Documentation

AtomAndResidueNameAndNumber MTopLookUp::getAtomAndResidueNameAndNumber ( const int  globalAtomIndex)
inline

Look up the atom and residue name and residue number and index of a global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms. Note that this function does a (somewhat expensive) lookup. If you want to look up data sequentially for all atoms in a molecule or the system, use one of the mtop loop functionalities.

Parameters
[in]globalAtomIndexThe global atom index to look up
Returns
a struct with atom and residue information
const t_atom& MTopLookUp::getAtomParameters ( const int  globalAtomIndex)
inline

Returns the atom data for an atom based on global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms.

Parameters
[in]globalAtomIndexThe global atom index to look up
const t_pdbinfo& MTopLookUp::getAtomPdbInfo ( const int  globalAtomIndex)
inline

Returns PDB information for an atom based on global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms.

Parameters
[in]globalAtomIndexThe global atom index to look up
int MTopLookUp::getGlobalResidueIndex ( const int  globalAtomIndex)
inline

Look up global residue index for a global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms. Note that this function does a (somewhat expensive) lookup. If you want to look up data sequentially for all atoms in a molecule or the system, use one of the mtop loop functionalities.

Parameters
[in]globalAtomIndexThe global atom index to look up
MolblockAtomIndex MTopLookUp::getMolblockAtomIndex ( const int  globalAtomIndex)
inline

Look up the molecule block and other indices of a global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms.

Parameters
[in]globalAtomIndexThe global atom index to look up
Returns
the molecular topology indices
int MTopLookUp::getMoleculeIndex ( const int  globalAtomIndex)
inline

Returns the global molecule index of a global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms.

Parameters
[in]globalAtomIndexThe global atom index to look up
const t_resinfo& MTopLookUp::getResidueInfo ( const int  globalAtomIndex)
inline

Returns residue information for an atom based on global atom index.

The atom index has to be in range: 0 <= globalAtomIndex < mtop->natoms.

Parameters
[in]globalAtomIndexThe global atom index to look up

The documentation for this class was generated from the following file: