Opm::Linear::ForeignOverlapFromBCRSMatrix Class Reference

This class creates and manages the foreign overlap given an initial list of border indices and a BCRS matrix. More...

#include <foreignoverlapfrombcrsmatrix.hh>

Public Member Functions

 ForeignOverlapFromBCRSMatrix (const ForeignOverlapFromBCRSMatrix &)=delete
 
template<class BCRSMatrix >
 ForeignOverlapFromBCRSMatrix (const BCRSMatrix &A, const BorderList &borderList, const BlackList &blackList, unsigned overlapSize)
 Constructs the foreign overlap given a BCRS matrix and an initial list of border indices. More...
 
unsigned overlapSize () const
 Returns the size of the overlap region. More...
 
bool isBorder (Index localIdx) const
 Returns true iff a local index is a border index. More...
 
bool isBorderWith (Index localIdx, ProcessRank peerRank) const
 Returns true iff a local index is a border index shared with a given peer process. More...
 
ProcessRank masterRank (Index localIdx) const
 Return the rank of the master process of an index. More...
 
bool iAmMasterOf (Index localIdx) const
 Return true if the current rank is the "master" of an index. More...
 
const BorderListborderList () const
 Returns the list of indices which intersect the process border. More...
 
const OverlapWithPeerforeignOverlapWithPeer (ProcessRank peerRank) const
 Return the list of (local indices, border distance, number of processes) triples which are in the overlap of a given peer rank. More...
 
const std::map< ProcessRank, BorderDistance > & foreignOverlapByLocalIndex (Index localIdx) const
 Return the map of (peer rank, border distance) for a given local index. More...
 
bool peerHasIndex (ProcessRank peerRank, Index localIdx) const
 Returns true iff a local index is seen by a peer rank. More...
 
size_t numFront (ProcessRank peerRank) const
 Returns the number of front indices of a peer process in the local partition. More...
 
bool isFrontFor (ProcessRank peerRank, Index localIdx) const
 Returns whether a given local index is on the front of a given peer rank. More...
 
const PeerSetpeerSet () const
 Return the set of process ranks which share an overlap with the current process. More...
 
const PeerSetneighborPeerSet () const
 Return the set of process ranks which share a border index with the current process. More...
 
size_t numNative () const
 Returns the number of native indices. More...
 
size_t numLocal () const
 Returns the number of local indices. More...
 
bool isLocal (Index domesticIdx) const
 Returns true iff a domestic index is local. More...
 
Index nativeToLocal (Index nativeIdx) const
 Convert a native index to a local one. More...
 
Index localToNative (Index localIdx) const
 Convert a local index to a native one. More...
 
const BlackListblackList () const
 Returns the object which represents the black-listed native indices. More...
 
size_t numPeers (Index localIdx) const
 Return the number of peer ranks for which a given local index is visible. More...
 
bool isInOverlap (Index localIdx) const
 Returns true if a given local index is in the foreign overlap of any rank. More...
 
void print () const
 Print the foreign overlap for debugging purposes. More...
 

Protected Member Functions

template<class BCRSMatrix >
void extendForeignOverlap_ (const BCRSMatrix &A, SeedList &seedList, BorderDistance borderDistance, BorderDistance overlapSize)
 
void createLocalIndices_ ()
 
Index localToPeerIdx_ (Index localIdx, ProcessRank peerRank) const
 
template<class BCRSMatrix >
void addNonNeighborOverlapIndices_ (const BCRSMatrix &, SeedList &seedList, BorderDistance borderDist)
 
void computeMasterRanks_ ()
 
void groupForeignOverlapByRank_ ()
 

Protected Attributes

PeerSet peerSet_
 
PeerSet neighborPeerSet_
 
const BorderListborderList_
 
const BlackListblackList_
 
std::vector< IndexnativeToLocalIndices_
 
std::vector< IndexlocalToNativeIndices_
 
std::vector< ProcessRankmasterRank_
 
std::set< IndexlocalBorderIndices_
 
OverlapByIndex foreignOverlapByLocalIndex_
 
OverlapByRank foreignOverlapByRank_
 
unsigned overlapSize_
 
size_t numLocal_
 
size_t numNative_
 
ProcessRank myRank_
 

Detailed Description

This class creates and manages the foreign overlap given an initial list of border indices and a BCRS matrix.

The foreign overlap are all (row) indices which overlap with the some of the current process's local indices.

Constructor & Destructor Documentation

◆ ForeignOverlapFromBCRSMatrix() [1/2]

Opm::Linear::ForeignOverlapFromBCRSMatrix::ForeignOverlapFromBCRSMatrix ( const ForeignOverlapFromBCRSMatrix )
delete

◆ ForeignOverlapFromBCRSMatrix() [2/2]

template<class BCRSMatrix >
Opm::Linear::ForeignOverlapFromBCRSMatrix::ForeignOverlapFromBCRSMatrix ( const BCRSMatrix &  A,
const BorderList borderList,
const BlackList blackList,
unsigned  overlapSize 
)
inline

Member Function Documentation

◆ addNonNeighborOverlapIndices_()

◆ blackList()

const BlackList & Opm::Linear::ForeignOverlapFromBCRSMatrix::blackList ( ) const
inline

Returns the object which represents the black-listed native indices.

References blackList_.

◆ borderList()

const BorderList & Opm::Linear::ForeignOverlapFromBCRSMatrix::borderList ( ) const
inline

Returns the list of indices which intersect the process border.

References borderList_.

Referenced by ForeignOverlapFromBCRSMatrix().

◆ computeMasterRanks_()

void Opm::Linear::ForeignOverlapFromBCRSMatrix::computeMasterRanks_ ( )
inlineprotected

◆ createLocalIndices_()

void Opm::Linear::ForeignOverlapFromBCRSMatrix::createLocalIndices_ ( )
inlineprotected

◆ extendForeignOverlap_()

template<class BCRSMatrix >
void Opm::Linear::ForeignOverlapFromBCRSMatrix::extendForeignOverlap_ ( const BCRSMatrix &  A,
SeedList seedList,
BorderDistance  borderDistance,
BorderDistance  overlapSize 
)
inlineprotected

◆ foreignOverlapByLocalIndex()

const std::map< ProcessRank, BorderDistance > & Opm::Linear::ForeignOverlapFromBCRSMatrix::foreignOverlapByLocalIndex ( Index  localIdx) const
inline

Return the map of (peer rank, border distance) for a given local index.

References foreignOverlapByLocalIndex_, and isLocal().

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::sendIndicesToPeer_().

◆ foreignOverlapWithPeer()

const OverlapWithPeer & Opm::Linear::ForeignOverlapFromBCRSMatrix::foreignOverlapWithPeer ( ProcessRank  peerRank) const
inline

◆ groupForeignOverlapByRank_()

◆ iAmMasterOf()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::iAmMasterOf ( Index  localIdx) const
inline

Return true if the current rank is the "master" of an index.

If the index is at the interior of some process, we define this process as its master, if the index is on the boundary, then the master is defined as the process with the lowest rank.

References masterRank_, and myRank_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::iAmMasterOf().

◆ isBorder()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::isBorder ( Index  localIdx) const
inline

Returns true iff a local index is a border index.

References localBorderIndices_.

Referenced by addNonNeighborOverlapIndices_(), computeMasterRanks_(), and Opm::Linear::DomesticOverlapFromBCRSMatrix::isBorder().

◆ isBorderWith()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::isBorderWith ( Index  localIdx,
ProcessRank  peerRank 
) const
inline

Returns true iff a local index is a border index shared with a given peer process.

References foreignOverlapByLocalIndex_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::isBorderWith().

◆ isFrontFor()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::isFrontFor ( ProcessRank  peerRank,
Index  localIdx 
) const
inline

Returns whether a given local index is on the front of a given peer rank.

References foreignOverlapByLocalIndex_, and overlapSize_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::isFrontFor().

◆ isInOverlap()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::isInOverlap ( Index  localIdx) const
inline

Returns true if a given local index is in the foreign overlap of any rank.

References foreignOverlapByLocalIndex_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::isInOverlap().

◆ isLocal()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::isLocal ( Index  domesticIdx) const
inline

◆ localToNative()

Index Opm::Linear::ForeignOverlapFromBCRSMatrix::localToNative ( Index  localIdx) const
inline

Convert a local index to a native one.

References localToNativeIndices_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::domesticToNative().

◆ localToPeerIdx_()

Index Opm::Linear::ForeignOverlapFromBCRSMatrix::localToPeerIdx_ ( Index  localIdx,
ProcessRank  peerRank 
) const
inlineprotected

References borderList_.

Referenced by addNonNeighborOverlapIndices_().

◆ masterRank()

ProcessRank Opm::Linear::ForeignOverlapFromBCRSMatrix::masterRank ( Index  localIdx) const
inline

Return the rank of the master process of an index.

References masterRank_.

Referenced by computeMasterRanks_(), and Opm::Linear::DomesticOverlapFromBCRSMatrix::updateMasterRanks_().

◆ nativeToLocal()

Index Opm::Linear::ForeignOverlapFromBCRSMatrix::nativeToLocal ( Index  nativeIdx) const
inline

Convert a native index to a local one.

If a given native index is not in the set of local indices, this method returns -1.

References nativeToLocalIndices_.

Referenced by addNonNeighborOverlapIndices_(), extendForeignOverlap_(), ForeignOverlapFromBCRSMatrix(), and Opm::Linear::DomesticOverlapFromBCRSMatrix::nativeToDomestic().

◆ neighborPeerSet()

const PeerSet & Opm::Linear::ForeignOverlapFromBCRSMatrix::neighborPeerSet ( ) const
inline

Return the set of process ranks which share a border index with the current process.

References neighborPeerSet_.

Referenced by addNonNeighborOverlapIndices_().

◆ numFront()

size_t Opm::Linear::ForeignOverlapFromBCRSMatrix::numFront ( ProcessRank  peerRank) const
inline

Returns the number of front indices of a peer process in the local partition.

References foreignOverlapByRank_, and overlapSize_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::numFront().

◆ numLocal()

size_t Opm::Linear::ForeignOverlapFromBCRSMatrix::numLocal ( ) const
inline

◆ numNative()

size_t Opm::Linear::ForeignOverlapFromBCRSMatrix::numNative ( ) const
inline

Returns the number of native indices.

References numNative_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::numNative().

◆ numPeers()

size_t Opm::Linear::ForeignOverlapFromBCRSMatrix::numPeers ( Index  localIdx) const
inline

Return the number of peer ranks for which a given local index is visible.

References foreignOverlapByLocalIndex_.

◆ overlapSize()

unsigned Opm::Linear::ForeignOverlapFromBCRSMatrix::overlapSize ( ) const
inline

◆ peerHasIndex()

bool Opm::Linear::ForeignOverlapFromBCRSMatrix::peerHasIndex ( ProcessRank  peerRank,
Index  localIdx 
) const
inline

Returns true iff a local index is seen by a peer rank.

References foreignOverlapByLocalIndex_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::peerHasIndex().

◆ peerSet()

const PeerSet & Opm::Linear::ForeignOverlapFromBCRSMatrix::peerSet ( ) const
inline

Return the set of process ranks which share an overlap with the current process.

References peerSet_.

Referenced by Opm::Linear::DomesticOverlapFromBCRSMatrix::buildDomesticOverlap_().

◆ print()

void Opm::Linear::ForeignOverlapFromBCRSMatrix::print ( ) const
inline

Print the foreign overlap for debugging purposes.

References foreignOverlapByRank_.

Member Data Documentation

◆ blackList_

const BlackList& Opm::Linear::ForeignOverlapFromBCRSMatrix::blackList_
protected

Referenced by blackList(), and createLocalIndices_().

◆ borderList_

const BorderList& Opm::Linear::ForeignOverlapFromBCRSMatrix::borderList_
protected

Referenced by borderList(), and localToPeerIdx_().

◆ foreignOverlapByLocalIndex_

◆ foreignOverlapByRank_

OverlapByRank Opm::Linear::ForeignOverlapFromBCRSMatrix::foreignOverlapByRank_
protected

◆ localBorderIndices_

std::set<Index> Opm::Linear::ForeignOverlapFromBCRSMatrix::localBorderIndices_
protected

◆ localToNativeIndices_

std::vector<Index> Opm::Linear::ForeignOverlapFromBCRSMatrix::localToNativeIndices_
protected

◆ masterRank_

std::vector<ProcessRank> Opm::Linear::ForeignOverlapFromBCRSMatrix::masterRank_
protected

◆ myRank_

ProcessRank Opm::Linear::ForeignOverlapFromBCRSMatrix::myRank_
protected

◆ nativeToLocalIndices_

std::vector<Index> Opm::Linear::ForeignOverlapFromBCRSMatrix::nativeToLocalIndices_
protected

◆ neighborPeerSet_

PeerSet Opm::Linear::ForeignOverlapFromBCRSMatrix::neighborPeerSet_
protected

◆ numLocal_

size_t Opm::Linear::ForeignOverlapFromBCRSMatrix::numLocal_
protected

◆ numNative_

size_t Opm::Linear::ForeignOverlapFromBCRSMatrix::numNative_
protected

◆ overlapSize_

unsigned Opm::Linear::ForeignOverlapFromBCRSMatrix::overlapSize_
protected

◆ peerSet_

PeerSet Opm::Linear::ForeignOverlapFromBCRSMatrix::peerSet_
protected

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