Gromacs
2026.0-dev-20250318-75a6c20
|
#include <gromacs/domdec/ga2la.h>
Global to local atom mapping.
Used for efficient mapping from global atom indices to local atom indices in the domain decomposition.
Classes | |
struct | Entry |
Structure for the local atom info. More... | |
Public Types | |
using | DirectList = std::vector< Entry > |
using | HashedList = gmx::HashedMap< Entry > |
Public Member Functions | |
gmx_ga2la_t (int numAtomsTotal, int numAtomsLocal) | |
Constructor. More... | |
void | insert (int a_gl, const Entry &value) |
Inserts an entry, there should not already be an entry for a_gl . More... | |
void | erase (int a_gl) |
Delete the entry for global atom a_gl. | |
const Entry * | find (int a_gl) const |
Returns a pointer to the entry when present, nullptr otherwise. | |
const int * | findHome (int a_gl) const |
Returns the local atom index if it is a home atom, nullptr otherwise. | |
Entry & | at (int a_gl) |
Returns a reference to the entry for a_gl. More... | |
void | clear (bool resizeHashTable) |
Clear all the entries in the list. More... | |
gmx_ga2la_t::gmx_ga2la_t | ( | int | numAtomsTotal, |
int | numAtomsLocal | ||
) |
Constructor.
[in] | numAtomsTotal | The total number of atoms in the system |
[in] | numAtomsLocal | An estimate of the number of home+communicated atoms |
|
inline |
Returns a reference to the entry for a_gl.
A non-release assert checks that a_gl is present.
void gmx_ga2la_t::clear | ( | bool | resizeHashTable | ) |
Clear all the entries in the list.
Note that this might use OpenMP threading, so it should not be called from within an OpenMP region.
[in] | resizeHashTable | When true the hash table is optimized based on the current number of entries stored |
|
inline |
Inserts an entry, there should not already be an entry for a_gl
.
[in] | a_gl | The global atom index |
[in] | value | The value to set for this index |