My Project
Loading...
Searching...
No Matches
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.
 
unsigned overlapSize () const
 Returns the size of the overlap region.
 
bool isBorder (Index localIdx) const
 Returns true iff a local index is a border index.
 
bool isBorderWith (Index localIdx, ProcessRank peerRank) const
 Returns true iff a local index is a border index shared with a given peer process.
 
ProcessRank masterRank (Index localIdx) const
 Return the rank of the master process of an index.
 
bool iAmMasterOf (Index localIdx) const
 Return true if the current rank is the "master" of an index.
 
const BorderListborderList () const
 Returns the list of indices which intersect the process border.
 
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.
 
const std::map< ProcessRank, BorderDistance > & foreignOverlapByLocalIndex (Index localIdx) const
 Return the map of (peer rank, border distance) for a given local index.
 
bool peerHasIndex (ProcessRank peerRank, Index localIdx) const
 Returns true iff a local index is seen by a peer rank.
 
size_t numFront (ProcessRank peerRank) const
 Returns the number of front indices of a peer process in the local partition.
 
bool isFrontFor (ProcessRank peerRank, Index localIdx) const
 Returns whether a given local index is on the front of a given peer rank.
 
const PeerSetpeerSet () const
 Return the set of process ranks which share an overlap with the current process.
 
const PeerSetneighborPeerSet () const
 Return the set of process ranks which share a border index with the current process.
 
size_t numNative () const
 Returns the number of native indices.
 
size_t numLocal () const
 Returns the number of local indices.
 
bool isLocal (Index domesticIdx) const
 Returns true iff a domestic index is local.
 
Index nativeToLocal (Index nativeIdx) const
 Convert a native index to a local one.
 
Index localToNative (Index localIdx) const
 Convert a local index to a native one.
 
const BlackListblackList () const
 Returns the object which represents the black-listed native indices.
 
size_t numPeers (Index localIdx) const
 Return the number of peer ranks for which a given local index is visible.
 
bool isInOverlap (Index localIdx) const
 Returns true if a given local index is in the foreign overlap of any rank.
 
void print () const
 Print the foreign overlap for debugging purposes.
 

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.

Member Function Documentation

◆ 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.

◆ 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.


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