File globalindexer.hxx#
Typedefs
-
template<class T>
using IndexerPtr = std::shared_ptr<GlobalIndexer<T>>#
-
using InterpolationWeights = std::vector<ParallelTransform::PositionsAndWeights>#
-
template<class T>
class GlobalIndexer# - #include <globalindexer.hxx>
An object which accepts index objects produced by iterating over fields and returns a global index. This index can be used when constructing PETSc arrays. Guard regions used for communication between processes will have the indices of the part of the interior region they are mirroring. Boundaries required by the stencil will have unique indices. If no stencil is provided then only the interior region will be assigned global indices. By default, the indexer is fully initialised so that guard cells are communicated (ensuring they hold the appropriate global indices). However, by passing
autoInitialise = false
this behaviour can be turned off and the user can then manually call theinitialise()
method later. This can be useful for mocking/faking the class when testing.Public Functions
-
GlobalIndexer() = default#
-
inline explicit GlobalIndexer(Mesh *localmesh, OperatorStencil<ind_type> stencil = OperatorStencil<ind_type>(), bool autoInitialise = true)#
-
inline virtual ~GlobalIndexer()#
-
inline void initialiseTest()#
Call this immediately after construction when running unit tests.
-
inline void initialise()#
Finish setting up the indexer, communicating indices across processes and, if possible, calculating the sparsity pattern of any matrices.
-
inline int getGlobal(const ind_type &ind) const#
Convert the local index object to a global index which can be used in PETSc vectors and matrices.
-
inline bool isLocal(const ind_type &ind) const#
Check whether the local index corresponds to an element which is stored locally.
-
inline int getGlobalStart() const#
-
inline bool sparsityPatternAvailable() const#
-
inline int size() const#
Private Functions
-
inline virtual void registerFieldForTest(T &f)#
This gets called by initialiseTest and is used to register fields with fake parallel meshes.
-
inline void calculateSparsity() const#
-
GlobalIndexer() = default#