Gromacs
2024.3
|
#include <gromacs/domdec/localatomset.h>
A local atom set collects local, global and collective indices of the home atoms on a rank. The indices of the home atoms are automatically updated during domain decomposition, thus gmx::LocalAtomSet::localIndex enables iteration over local atoms properties like coordinates or forces. TODO: add a LocalAtomSet iterator.
To generate a LocalAtomSet call gmx::LocalAtomSetManger::add and keep the handle to the LocalAtomSet returned from this call.
Public Member Functions | |
ArrayRef< const int > | collectiveIndex () const |
Maps indices on rank [0..numAtomsLocal_) to global atom indicices. More... | |
ArrayRef< const int > | globalIndex () const |
Global indices of the atoms in this set. More... | |
ArrayRef< const int > | localIndex () const |
Local indices of the atoms. More... | |
std::size_t | numAtomsLocal () const |
The number of atoms from this group index on this rank. More... | |
std::size_t | numAtomsGlobal () const |
The number of all atoms from this group index on all ranks together. More... | |
Friends | |
class | LocalAtomSetManager |
ArrayRef< const int > gmx::LocalAtomSet::collectiveIndex | ( | ) | const |
Maps indices on rank [0..numAtomsLocal_) to global atom indicices.
ArrayRef< const int > gmx::LocalAtomSet::globalIndex | ( | ) | const |
Global indices of the atoms in this set.
ArrayRef< const int > gmx::LocalAtomSet::localIndex | ( | ) | const |
Local indices of the atoms.
For example, the i-th local atom coordinate of this set is x[atomSet.localIndex()[i]].
When using in a loop other than a range-based for loop, performance may improve if the ArrayRef is stored in a local variable before the loop is entered. Updated within domain-decomposition.
std::size_t gmx::LocalAtomSet::numAtomsGlobal | ( | ) | const |
The number of all atoms from this group index on all ranks together.
std::size_t gmx::LocalAtomSet::numAtomsLocal | ( | ) | const |
The number of atoms from this group index on this rank.