Gromacs  2025-dev-20240717-76b059a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
InteractionList Struct Reference

#include <gromacs/topology/idef.h>

Description

List of listed interactions.

Defines a list of atoms with their interactions.

TODO: Consider storing the function type as well. TODO: Consider providing per interaction access.

Public Member Functions

int size () const
 
bool empty () const
 
template<std::size_t numAtoms>
void push_back (const int parameterType, const std::array< int, numAtoms > &atoms)
 Adds one interaction to the list. More...
 
void push_back (const int parameterType, const int numAtoms, const int *atoms)
 Adds one interaction to the list. More...
 
void append (const InteractionList &ilist)
 Appends interaction list ilist at the back of the list. More...
 
void clear ()
 Clears the list.
 

Public Attributes

std::vector< int > iatoms
 List of interactions. More...
 

Member Function Documentation

void InteractionList::append ( const InteractionList ilist)
inline

Appends interaction list ilist at the back of the list.

Parameters
[in]ilistInteraction list to append.
bool InteractionList::empty ( ) const
inline
Returns
Whether the list is empty.
template<std::size_t numAtoms>
void InteractionList::push_back ( const int  parameterType,
const std::array< int, numAtoms > &  atoms 
)
inline

Adds one interaction to the list.

Parameters
[in]parameterTypeType.
[in]atomsArray of atoms indices.
void InteractionList::push_back ( const int  parameterType,
const int  numAtoms,
const int *  atoms 
)
inline

Adds one interaction to the list.

Parameters
[in]parameterTypeType.
[in]numAtomsNumber of atoms.
[in]atomsAtoms indices.
int InteractionList::size ( ) const
inline
Returns
The total number of elements in iatoms.

Member Data Documentation

std::vector<int> InteractionList::iatoms

List of interactions.

Specifies which atoms are involved in an interaction of a certain type. The layout of this array is as follows:

+-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
|type1|at1|at2|at3|type2|at1|at2|type1|at1|at2|at3|type3|at1|at2|
+-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...

So for interaction type type1 3 atoms are needed, and for type2 and type3 only 2. The type identifier is used to select the function to calculate the interaction and its actual parameters. This type identifier is an index in a params[] and functype[] array.


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