DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::Geom::AdjIndexInfo Struct Reference

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_pLGhostMappingmapping () 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).
 

Detailed Description

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:

  • markGlobal(): Adj_Unknown -> Adj_PointToGlobal
  • wireTargetMapping(m): requires !isLocal(); stores ghost mapping
  • toLocal(adj, n): Adj_PointToGlobal -> Adj_PointToLocal (requires wired)
  • toGlobal(adj, n): Adj_PointToLocal -> Adj_PointToGlobal (requires wired)
  • bootstrapToLocal(m,adj,n): markGlobal + wire + toLocal in one call (accepts Adj_Unknown or Adj_PointToGlobal)

Definition at line 27 of file AdjIndexInfo.hpp.

Member Function Documentation

◆ bootstrapToLocal()

template<class TAdj >
void DNDS::Geom::AdjIndexInfo::bootstrapToLocal ( const t_pLGhostMapping mapping,
TAdj &  adj,
index  nRows 
)
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.

Here is the call graph for this function:

◆ bootstrapToLocalOMP()

template<class TAdj >
void DNDS::Geom::AdjIndexInfo::bootstrapToLocalOMP ( const t_pLGhostMapping mapping,
TAdj &  adj,
index  nRows 
)
inline

OMP variant of bootstrapToLocal.

Definition at line 266 of file AdjIndexInfo.hpp.

Here is the call graph for this function:

◆ isBuilt()

bool DNDS::Geom::AdjIndexInfo::isBuilt ( ) const
inline

Definition at line 46 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ isGlobal()

bool DNDS::Geom::AdjIndexInfo::isGlobal ( ) const
inline

Definition at line 45 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ isLocal()

bool DNDS::Geom::AdjIndexInfo::isLocal ( ) const
inline

Definition at line 44 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ isWired()

bool DNDS::Geom::AdjIndexInfo::isWired ( ) const
inline

Definition at line 47 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ makeFatherOnlyMapping()

static t_pLGhostMapping DNDS::Geom::AdjIndexInfo::makeFatherOnlyMapping ( const ssp< GlobalOffsetsMapping > &  globalMapping,
index  fatherSize,
const MPIInfo mpi 
)
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).

Warning
Collective — calls MPI_Alltoall internally.

Definition at line 122 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ mapping()

const t_pLGhostMapping & DNDS::Geom::AdjIndexInfo::mapping ( ) const
inline

Read-only access to the stored mapping (for assertions/comparisons).

Definition at line 50 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ markGlobal()

void DNDS::Geom::AdjIndexInfo::markGlobal ( )
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.

◆ markLocal()

void DNDS::Geom::AdjIndexInfo::markLocal ( )
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.

◆ state()

MeshAdjState DNDS::Geom::AdjIndexInfo::state ( ) const
inline

Definition at line 43 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ toGlobal()

template<class TAdj >
void DNDS::Geom::AdjIndexInfo::toGlobal ( TAdj &  adj,
index  nRows 
)
inline

Bulk-convert all entries in [0, nRows) from local to global.

Definition at line 171 of file AdjIndexInfo.hpp.

◆ toGlobalOMP()

template<class TAdj >
void DNDS::Geom::AdjIndexInfo::toGlobalOMP ( TAdj &  adj,
index  nRows 
)
inline

OMP-parallelized variant of toGlobal.

Definition at line 220 of file AdjIndexInfo.hpp.

◆ toLocal()

template<class TAdj >
void DNDS::Geom::AdjIndexInfo::toLocal ( TAdj &  adj,
index  nRows 
)
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.

Here is the caller graph for this function:

◆ toLocalOMP()

template<class TAdj >
void DNDS::Geom::AdjIndexInfo::toLocalOMP ( TAdj &  adj,
index  nRows 
)
inline

OMP-parallelized variant of toLocal.

Definition at line 193 of file AdjIndexInfo.hpp.

Here is the caller graph for this function:

◆ wireTargetMapping()

void DNDS::Geom::AdjIndexInfo::wireTargetMapping ( const t_pLGhostMapping mapping)
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.

Parameters
mappingMust be non-null.

Definition at line 95 of file AdjIndexInfo.hpp.

Here is the call graph for this function:

The documentation for this struct was generated from the following file: