Gromacs  2025-dev-20240614-602a366
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
PreprocessingAtomTypes Class Reference

#include <gromacs/gmxpreprocess/gpp_atomtype.h>

Description

Storage of all atom types used during preprocessing of a simulation input.

Public Member Functions

 PreprocessingAtomTypes (PreprocessingAtomTypes &&old) noexcept
 Move constructor.
 
PreprocessingAtomTypesoperator= (PreprocessingAtomTypes &&old) noexcept
 Move assignment constructor.
 
std::optional< int > atomTypeFromName (const std::string &str) const
 Get atom type index for atom type name if present in the database, or empty optional. More...
 
size_t size () const
 Get number of defined atom types.
 
std::optional< const std::string > atomNameFromAtomType (int nt) const
 Get name of atom from internal atom type number. More...
 
std::optional< realatomMassFromAtomType (int nt) const
 Get normal mass of atom from internal atom type number. More...
 
std::optional< realatomChargeFromAtomType (int nt) const
 Get normal charge of atom from internal atom type number. More...
 
std::optional< ParticleType > atomParticleTypeFromAtomType (int nt) const
 Get particle type for atom type nt. More...
 
std::optional< int > bondAtomTypeFromAtomType (int nt) const
 Get bond atom parameter of atom from internal atom type number. More...
 
std::optional< int > atomNumberFromAtomType (int nt) const
 Get atomic number of atom from internal atom type number. More...
 
std::optional< realatomNonBondedParamFromAtomType (int nt, int param) const
 Get the value of param of type nt. More...
 
bool isSet (int nt) const
 If a value is within the range of the current types or not. More...
 
std::optional< int > setType (int nt, const t_atom &a, const std::string &name, const InteractionOfType &nb, int bondAtomType, int atomNumber)
 Set the values of an existing atom type nt. More...
 
int addType (const t_atom &a, const std::string &name, const InteractionOfType &nb, int bondAtomType, int atomNumber)
 Add a unique type to the database. More...
 
void renumberTypes (gmx::ArrayRef< InteractionsOfType > plist, gmx_mtop_t *mtop, int *wallAtomType, bool verbose)
 Renumber existing atom type entries. More...
 

Member Function Documentation

int PreprocessingAtomTypes::addType ( const t_atom &  a,
const std::string &  name,
const InteractionOfType nb,
int  bondAtomType,
int  atomNumber 
)

Add a unique type to the database.

Parameters
[in]aAtom information.
[in]nameAtom name.
[in]nbNonbonded parameters.
[in]bondAtomTypeWhat kind of bonded interactions are there.
[in]atomNumberAtomic number of the entry.
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< real > PreprocessingAtomTypes::atomChargeFromAtomType ( int  nt) const

Get normal charge of atom from internal atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The optional charge for the atom.
std::optional< real > PreprocessingAtomTypes::atomMassFromAtomType ( int  nt) const

Get normal mass of atom from internal atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The optional mass for the atom.
std::optional< const std::string > PreprocessingAtomTypes::atomNameFromAtomType ( int  nt) const

Get name of atom from internal atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The optional type name.
std::optional< real > PreprocessingAtomTypes::atomNonBondedParamFromAtomType ( int  nt,
int  param 
) const

Get the value of param of type nt.

Parameters
[in]paramThe parameter value to find.
[in]ntThe number of the type.
Returns
The optional value of the parameter.
std::optional< int > PreprocessingAtomTypes::atomNumberFromAtomType ( int  nt) const

Get atomic number of atom from internal atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The optional atomic number type.
std::optional< ParticleType > PreprocessingAtomTypes::atomParticleTypeFromAtomType ( int  nt) const

Get particle type for atom type nt.

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

Get atom type index for atom type name if present in the database, or empty optional.

Todo:
The code should be changed to instead use a gmx::compat version of std::optional to return an iterator 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.
std::optional< int > PreprocessingAtomTypes::bondAtomTypeFromAtomType ( int  nt) const

Get bond atom parameter of atom from internal atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The optional bond atom parameter.
bool PreprocessingAtomTypes::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.
void PreprocessingAtomTypes::renumberTypes ( gmx::ArrayRef< InteractionsOfType plist,
gmx_mtop_t *  mtop,
int *  wallAtomType,
bool  verbose 
)

Renumber existing atom type entries.

Parameters
[in]plistList of parameters.
[in]mtopGlobal topology.
[in,out]wallAtomTypeAtom types of wall atoms, which may also be renumbered
[in]verboseIf we want to print additional info.
std::optional< int > PreprocessingAtomTypes::setType ( int  nt,
const t_atom &  a,
const std::string &  name,
const InteractionOfType nb,
int  bondAtomType,
int  atomNumber 
)

Set the values of an existing atom type nt.

Parameters
[in]ntType that should be set.
[in]aAtom information.
[in]nameAtom name.
[in]nbNonbonded parameters.
[in]bondAtomTypeWhat kind of bonded interactions are there.
[in]atomNumberAtomic number of the entry.
Returns
Optional number of the type set.

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