MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::indexing::IndexingService< dim > Class Template Reference

#include <IndexingService.h>

Collaboration diagram for coupling::indexing::IndexingService< dim >:

Public Member Functions

void initWithCells (tarch::la::Vector< dim, unsigned int > globalNumberCouplingCells, tarch::la::Vector< dim, unsigned int > numberProcesses, coupling::paralleltopology::ParallelTopologyType parallelTopologyType, unsigned int outerRegion, const unsigned int rank, MPI_Comm comm=MPI_COMM_WORLD)
void initWithCells (const tarch::la::Vector< dim, std::vector< unsigned int > > &subdomainWeights, tarch::la::Vector< dim, unsigned int > globalNumberCouplingCells, tarch::la::Vector< dim, unsigned int > numberProcesses, coupling::paralleltopology::ParallelTopologyType parallelTopologyType, unsigned int outerRegion, const unsigned int rank, MPI_Comm comm=MPI_COMM_WORLD)
void initWithMDSize (const tarch::la::Vector< 3, double > &globalMDDomainSize, const tarch::la::Vector< 3, double > &globalMDDomainOffset, const tarch::la::Vector< 3, unsigned int > &mdNumberProcesses, const tarch::la::Vector< 3, double > &couplingCellSize, coupling::paralleltopology::ParallelTopologyType parallelTopologyType, unsigned int outerRegion, unsigned int rank, MPI_Comm comm=MPI_COMM_WORLD)
void initWithMDSize (const tarch::la::Vector< dim, std::vector< unsigned int > > &subdomainWeights, const tarch::la::Vector< 3, double > &globalMDDomainSize, const tarch::la::Vector< 3, double > &globalMDDomainOffset, const tarch::la::Vector< 3, unsigned int > &mdNumberProcesses, const tarch::la::Vector< 3, double > &couplingCellSize, coupling::paralleltopology::ParallelTopologyType parallelTopologyType, unsigned int outerRegion, unsigned int rank, MPI_Comm comm=MPI_COMM_WORLD)
void finalize ()
std::vector< unsigned int > getRanksForGlobalIndex (const BaseIndex< dim > &globalCellIndex, unsigned int topologyOffset) const
unsigned int getUniqueRankForCouplingCell (const BaseIndex< dim > &globalCellIndex, unsigned int topologyOffset) const
MPI_Comm getComm () const
unsigned int getRank () const
bool isInitialized () const
tarch::la::Vector< dim, double > getGlobalMDDomainSize () const
tarch::la::Vector< dim, double > getGlobalMDDomainOffset () const
 returns the offset, i.e. the lower,left... corner coordinate, of the MD domain.
tarch::la::Vector< dim, double > getCouplingCellSize () const
 returns the vector size of each coupling cell.
unsigned int getScalarNumberProcesses () const
BaseIndex< dim > getCellIndex (tarch::la::Vector< dim, double > position) const

Static Public Member Functions

static IndexingServicegetInstance ()

Private Member Functions

unsigned int getUniqueRankForCouplingCell (tarch::la::Vector< dim, unsigned int > globalCellIndex, const tarch::la::Vector< dim, unsigned int > &globalNumberCouplingCells, unsigned int topologyOffset) const

Private Attributes

tarch::la::Vector< dim, unsigned int > _numberProcesses
unsigned int _scalarNumberProcesses
const coupling::paralleltopology::ParallelTopology< dim > * _parallelTopology
MPI_Comm _comm
unsigned int _rank
bool _isInitialized = false
bool _initedWithMDSize = false
tarch::la::Vector< dim, std::vector< unsigned int > > _subdomainOwnership
tarch::la::Vector< dim, double > _globalMDDomainSize
tarch::la::Vector< dim, double > _globalMDDomainOffset
tarch::la::Vector< dim, double > _couplingCellSize
coupling::paralleltopology::ParallelTopologyType _parallelTopologyType
friend IndexingServiceTest

Detailed Description

template<unsigned int dim>
class coupling::indexing::IndexingService< dim >

Singleton service class initialising lower and upper boundaries of all possible CellIndex specialisations.

Template Parameters
dimnumber of dimensions of the coupled simulation
Parameters
simpleMDConfigconfig object of SimpleMD instance used in coupling
mamicoConfigconfig object containg general information of coupling process
outerregion
Author
Felix Maurer

Member Function Documentation

◆ getCouplingCellSize()

template<unsigned int dim>
tarch::la::Vector< dim, double > coupling::indexing::IndexingService< dim >::getCouplingCellSize ( ) const
inline

returns the vector size of each coupling cell.

Returns
the size of the coupling cells (dimensional)

◆ getGlobalMDDomainOffset()

template<unsigned int dim>
tarch::la::Vector< dim, double > coupling::indexing::IndexingService< dim >::getGlobalMDDomainOffset ( ) const
inline

returns the offset, i.e. the lower,left... corner coordinate, of the MD domain.

Returns
the offset of the MD domain

◆ getGlobalMDDomainSize()

template<unsigned int dim>
tarch::la::Vector< dim, double > coupling::indexing::IndexingService< dim >::getGlobalMDDomainSize ( ) const
inline

returns the global domain size of the MD domain (excl. ghost layer which naturally is not part of MD).

Returns
the total size of the md simulation domain (dimensional)

◆ getRanksForGlobalIndex()

template<unsigned int dim>
std::vector< unsigned int > coupling::indexing::IndexingService< dim >::getRanksForGlobalIndex ( const BaseIndex< dim > & globalCellIndex,
unsigned int topologyOffset ) const

Determines all ranks that contain a certain global BaseIndex. Ripped from deprecated IndexConversion.

Parameters
globalCellIndexindex to be looked up
globalNumberCouplingCellsglobal number of cells in BaseIndex domain EXCLUDING global ghost layer cells.
Returns
vector of all cells which contain the index

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