Gromacs  2020.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Friends

#include <gromacs/domdec/localatomset.h>

Description

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
 

Member Function Documentation

ArrayRef< const int > gmx::LocalAtomSet::collectiveIndex ( ) const

Maps indices on rank [0..numAtomsLocal_) to global atom indicices.

Returns
the collective index.
ArrayRef< const int > gmx::LocalAtomSet::globalIndex ( ) const

Global indices of the atoms in this set.

Note
For best performance, store and use a local copy of the arrayref.
Returns
the global index.
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.

Note
For best performance, store and use a local copy of the ArrayRef.
Returns
the local index.
std::size_t gmx::LocalAtomSet::numAtomsGlobal ( ) const

The number of all atoms from this group index on all ranks together.

Note
For best performance, store and use a local copy.
std::size_t gmx::LocalAtomSet::numAtomsLocal ( ) const

The number of atoms from this group index on this rank.

Note
For best performance, store and use a local copy of the ArrayRef.

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