|
DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
|
Per-adjacency index state tracking. More...
#include <AdjIndexInfo.hpp>
Public Member Functions | |
| MeshAdjState | state () const |
| bool | isLocal () const |
| bool | isGlobal () const |
| bool | isBuilt () const |
| bool | isWired () const |
| const t_pLGhostMapping & | mapping () const |
| Read-only access to the stored mapping (for assertions/comparisons). | |
| void | markGlobal () |
| Mark this adjacency as containing global indices. | |
| void | markLocal () |
| Mark this adjacency as containing local indices. | |
| void | wireTargetMapping (const t_pLGhostMapping &mapping) |
| Attach the target entity's ghost mapping. | |
| template<class TAdj > | |
| void | toLocal (TAdj &adj, index nRows) |
| Bulk-convert all entries in [0, nRows) from global to local. | |
| template<class TAdj > | |
| void | toGlobal (TAdj &adj, index nRows) |
| Bulk-convert all entries in [0, nRows) from local to global. | |
| template<class TAdj > | |
| void | toLocalOMP (TAdj &adj, index nRows) |
| OMP-parallelized variant of toLocal. | |
| template<class TAdj > | |
| void | toGlobalOMP (TAdj &adj, index nRows) |
| OMP-parallelized variant of toGlobal. | |
| template<class TAdj > | |
| void | bootstrapToLocal (const t_pLGhostMapping &mapping, TAdj &adj, index nRows) |
| Wire target mapping and convert to local in one step. | |
| template<class TAdj > | |
| void | bootstrapToLocalOMP (const t_pLGhostMapping &mapping, TAdj &adj, index nRows) |
| OMP variant of bootstrapToLocal. | |
Static Public Member Functions | |
| static t_pLGhostMapping | makeFatherOnlyMapping (const ssp< GlobalOffsetsMapping > &globalMapping, index fatherSize, const MPIInfo &mpi) |
| Create a ghost mapping with no ghost entries (father-only). | |
Per-adjacency index state tracking.
Records whether an adjacency array's entries are global or local indices, and holds a shared reference to the ghost mapping of the target entity kind (the entity that the indices refer to).
For example, cell2node points to nodes, so its AdjIndexInfo holds a reference to the node ghost mapping (coords.trans.pLGhostMapping).
All fields are private. State transitions are enforced by methods:
Definition at line 27 of file AdjIndexInfo.hpp.
|
inline |
Wire target mapping and convert to local in one step.
Solves the chicken-and-egg problem where the mapping becomes available at the same time the adjacency needs converting. Accepts Adj_Unknown or Adj_PointToGlobal. Sets state to Adj_PointToLocal on completion.
Definition at line 254 of file AdjIndexInfo.hpp.
|
inline |
OMP variant of bootstrapToLocal.
Definition at line 266 of file AdjIndexInfo.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Create a ghost mapping with no ghost entries (father-only).
The resulting OffsetAscendIndexMapping maps owned globals to [0, fatherSize) via search_indexAppend, and returns false for anything off-rank (encoded as -1 - globalIndex by toLocal).
Useful for wiring adjacencies that will never have ghost data (e.g., boundary mesh cell2node).
Definition at line 122 of file AdjIndexInfo.hpp.
|
inline |
Read-only access to the stored mapping (for assertions/comparisons).
Definition at line 50 of file AdjIndexInfo.hpp.
|
inline |
Mark this adjacency as containing global indices.
Valid from Adj_Unknown or Adj_PointToGlobal (idempotent). Use after building or receiving an adjacency whose entries are global entity indices.
Definition at line 61 of file AdjIndexInfo.hpp.
|
inline |
Mark this adjacency as containing local indices.
Valid from Adj_Unknown only. Requires target mapping to be wired (needed for future toGlobal calls). Use when an adjacency is populated directly with local indices, bypassing the normal global->local pipeline.
Definition at line 75 of file AdjIndexInfo.hpp.
|
inline |
|
inline |
Bulk-convert all entries in [0, nRows) from local to global.
Definition at line 171 of file AdjIndexInfo.hpp.
|
inline |
OMP-parallelized variant of toGlobal.
Definition at line 220 of file AdjIndexInfo.hpp.
|
inline |
Bulk-convert all entries in [0, nRows) from global to local.
Entries that cannot be found in the ghost mapping are encoded as (-1 - globalIndex), matching the convention of UnstructuredMesh::IndexGlobal2Local.
Definition at line 147 of file AdjIndexInfo.hpp.
|
inline |
OMP-parallelized variant of toLocal.
Definition at line 193 of file AdjIndexInfo.hpp.
|
inline |
Attach the target entity's ghost mapping.
Callable when state is Adj_Unknown or Adj_PointToGlobal. Calling while Adj_PointToLocal is a logic error: indices are already local w.r.t. some (possibly different) mapping, and replacing the mapping silently would make toGlobal() produce garbage.
| mapping | Must be non-null. |
Definition at line 95 of file AdjIndexInfo.hpp.