core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::decomp::BlockIndexer< Dim > Class Template Reference

#include <block_indexer.hpp>

Public Member Functions

 BlockIndexer ()=default
 
 BlockIndexer (IVec< Dim > origin, IVec< Dim > size, int ghostWidth)
 
void init (IVec< Dim > origin, IVec< Dim > size, int ghostWidth)
 
int ghostWidth () const
 
const IVec< Dim > & originInclGhost () const
 
const IVec< Dim > & sizeInclGhost () const
 
const IVec< Dim > & sizeInner () const
 
Index numCellsInclGhost () const
 Total number of cells in the extended (inner + ghost) array.
 
Index globalToLocal (const IVec< Dim > &g) const
 Global multi-index -> local linear index in the extended array (x-fastest).
 
Index localMdToLocal (const IVec< Dim > &l) const
 Local multi-index (in extended array, ghost included) -> local linear index (x-fastest).
 
IVec< Dim > localToLocalMd (Index idx) const
 Local linear index -> local multi-index (extended array coordinates, 0 at ghost corner).
 
IVec< Dim > localToGlobalMd (Index idx) const
 Local linear index -> global multi-index.
 
bool isInner (const IVec< Dim > &l) const
 True if a local multi-index lies in the inner (non-ghost) region.
 
template<typename Func >
void forEachInner (Func &&func) const
 Visit every inner cell (func receives const IVec<Dim>& local multi-index).
 
template<typename Func >
void forEachAll (Func &&func) const
 Visit every cell including ghosts.
 

Detailed Description

template<int Dim>
class peclet::core::decomp::BlockIndexer< Dim >

Definition at line 14 of file block_indexer.hpp.

Constructor & Destructor Documentation

◆ BlockIndexer() [1/2]

template<int Dim>
peclet::core::decomp::BlockIndexer< Dim >::BlockIndexer ( )
default

◆ BlockIndexer() [2/2]

template<int Dim>
peclet::core::decomp::BlockIndexer< Dim >::BlockIndexer ( IVec< Dim >  origin,
IVec< Dim >  size,
int  ghostWidth 
)
inline

Member Function Documentation

◆ init()

template<int Dim>
void peclet::core::decomp::BlockIndexer< Dim >::init ( IVec< Dim >  origin,
IVec< Dim >  size,
int  ghostWidth 
)
inline

◆ ghostWidth()

◆ originInclGhost()

template<int Dim>
const IVec< Dim > & peclet::core::decomp::BlockIndexer< Dim >::originInclGhost ( ) const
inline

Definition at line 29 of file block_indexer.hpp.

◆ sizeInclGhost()

template<int Dim>
const IVec< Dim > & peclet::core::decomp::BlockIndexer< Dim >::sizeInclGhost ( ) const
inline

Definition at line 30 of file block_indexer.hpp.

◆ sizeInner()

template<int Dim>
const IVec< Dim > & peclet::core::decomp::BlockIndexer< Dim >::sizeInner ( ) const
inline

Definition at line 31 of file block_indexer.hpp.

◆ numCellsInclGhost()

template<int Dim>
Index peclet::core::decomp::BlockIndexer< Dim >::numCellsInclGhost ( ) const
inline

Total number of cells in the extended (inner + ghost) array.

Definition at line 34 of file block_indexer.hpp.

◆ globalToLocal()

template<int Dim>
Index peclet::core::decomp::BlockIndexer< Dim >::globalToLocal ( const IVec< Dim > &  g) const
inline

Global multi-index -> local linear index in the extended array (x-fastest).

Definition at line 42 of file block_indexer.hpp.

◆ localMdToLocal()

template<int Dim>
Index peclet::core::decomp::BlockIndexer< Dim >::localMdToLocal ( const IVec< Dim > &  l) const
inline

Local multi-index (in extended array, ghost included) -> local linear index (x-fastest).

Definition at line 52 of file block_indexer.hpp.

◆ localToLocalMd()

template<int Dim>
IVec< Dim > peclet::core::decomp::BlockIndexer< Dim >::localToLocalMd ( Index  idx) const
inline

Local linear index -> local multi-index (extended array coordinates, 0 at ghost corner).

Definition at line 62 of file block_indexer.hpp.

◆ localToGlobalMd()

template<int Dim>
IVec< Dim > peclet::core::decomp::BlockIndexer< Dim >::localToGlobalMd ( Index  idx) const
inline

Local linear index -> global multi-index.

Definition at line 72 of file block_indexer.hpp.

◆ isInner()

template<int Dim>
bool peclet::core::decomp::BlockIndexer< Dim >::isInner ( const IVec< Dim > &  l) const
inline

True if a local multi-index lies in the inner (non-ghost) region.

Definition at line 82 of file block_indexer.hpp.

◆ forEachInner()

template<int Dim>
template<typename Func >
void peclet::core::decomp::BlockIndexer< Dim >::forEachInner ( Func &&  func) const
inline

Visit every inner cell (func receives const IVec<Dim>& local multi-index).

Definition at line 92 of file block_indexer.hpp.

◆ forEachAll()

template<int Dim>
template<typename Func >
void peclet::core::decomp::BlockIndexer< Dim >::forEachAll ( Func &&  func) const
inline

Visit every cell including ghosts.

Definition at line 103 of file block_indexer.hpp.


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