Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
PreprocessingBondAtomType Class Reference

#include <gromacs/gmxpreprocess/gpp_bond_atomtype.h>

Description

Storage for all bonded atomtypes during simulation preprocessing.

Public Member Functions

size_t size () const
 Get number of defined bond atom types.
 
std::optional< std::string > atomNameFromBondAtomType (int nt) const
 Get name of atom from internal bond atom type number. More...
 
std::optional< int > bondAtomTypeFromName (const std::string &str) const
 Get bond atom type index for atom type name if present in the database, or NOTSET. More...
 
int addBondAtomType (const std::string &name)
 Add a unique type to the database. More...
 
bool isSet (int nt) const
 If a value is within the range of the current types or not. More...
 

Member Function Documentation

int PreprocessingBondAtomType::addBondAtomType ( const std::string &  name)

Add a unique type to the database.

Parameters
[in]nameAtom name.
Returns
Index to the type in the database. If the type shares a name with an existing type, return the index of that type.
std::optional< std::string > PreprocessingBondAtomType::atomNameFromBondAtomType ( int  nt) const

Get name of atom from internal bond atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The optional type name.
std::optional< int > PreprocessingBondAtomType::bondAtomTypeFromName ( const std::string &  str) const

Get bond atom type index for atom type name if present in the database, or NOTSET.

Todo:
The code should be changed to instead use a gmx::compat version of std::optional to return a handle to the element being searched, or an empty optional construct if the entry has not been found.
Parameters
[in]strInput string to search type for.
Returns
Optional atomtype as integer.
bool PreprocessingBondAtomType::isSet ( int  nt) const

If a value is within the range of the current types or not.

Parameters
[in]ntValue to check.
Returns
True if value is in range.

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