Gromacs  2020.4
 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.
 
int atomTypeFromName (const std::string &str) const
 Get atom type index for atom type name if present in the database, or NOTSET. More...
 
size_t size () const
 Get number of defined atom types.
 
const char * atomNameFromAtomType (int nt) const
 Get name of atom from internal atom type number. More...
 
real atomMassFromAtomType (int nt) const
 Get normal mass of atom from internal atom type number. More...
 
real atomChargeFromAtomType (int nt) const
 Get normal charge of atom from internal atom type number. More...
 
int atomParticleTypeFromAtomType (int nt) const
 Get particle type for atom type nt. More...
 
int bondAtomTypeFromAtomType (int nt) const
 Get bond atom parameter of atom from internal atom type number. More...
 
int atomNumberFromAtomType (int nt) const
 Get atomic number of atom from internal atom type number. More...
 
real atomNonBondedParamFromAtomType (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...
 
void printTypes (FILE *out)
 Print data to file. More...
 
int setType (int nt, t_symtab *tab, 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 (t_symtab *tab, const t_atom &a, const std::string &name, const InteractionOfType &nb, int bondAtomType, int atomNumber)
 Add new atom type to database. More...
 
void renumberTypes (gmx::ArrayRef< InteractionsOfType > plist, gmx_mtop_t *mtop, int *wallAtomType, bool verbose)
 Renumber existing atom type entries. More...
 
void copyTot_atomtypes (t_atomtypes *atypes) const
 Copy information to other structure. More...
 

Member Function Documentation

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

Add new atom type to database.

Parameters
[in]tabSymbol table.
[in]aAtom information.
[in]nameAtom name.
[in]nbNonbonded parameters.
[in]bondAtomTypeWhat kind of bonded interactions are there.
[in]atomNumberAtomic number of the entry.
Returns
Number of entries in database.
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 charge for the atom or NOTSET.
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 mass for the atom or NOTSET.
const char * PreprocessingAtomTypes::atomNameFromAtomType ( int  nt) const

Get name of atom from internal atom type number.

Parameters
[in]ntInternal number of atom type.
Returns
The type name.
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 value of the parameter or NOTSET.
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 atomic number type or NOTSET.
int PreprocessingAtomTypes::atomParticleTypeFromAtomType ( int  nt) const

Get particle type for atom type nt.

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

Get 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 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
Atomtype as integer.
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 bond atom parameter or NOTSET.
void PreprocessingAtomTypes::copyTot_atomtypes ( t_atomtypes *  atypes) const

Copy information to other structure.

Parameters
[in,out]atypesOther datastructure to copy to.
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::printTypes ( FILE *  out)

Print data to file.

Parameters
[in]outFile pointer.
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.
int PreprocessingAtomTypes::setType ( int  nt,
t_symtab *  tab,
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]tabSymbol table.
[in]aAtom information.
[in]nameAtom name.
[in]nbNonbonded parameters.
[in]bondAtomTypeWhat kind of bonded interactions are there.
[in]atomNumberAtomic number of the entry.
Returns
Number of the type set or NOTSET

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