Opm::InterRegFlowMapSingleFIP Class Reference

#include <InterRegFlows.hpp>

Classes

struct  Cell
 Minimal characteristics of a cell from a simulation grid. More...
 

Public Member Functions

 InterRegFlowMapSingleFIP (const std::vector< int > &region)
 
void addConnection (const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates)
 
void compress ()
 
void clear ()
 Clear all internal buffers, but preserve allocated capacity. More...
 
const data::InterRegFlowMap & getInterRegFlows () const
 
std::size_t getLocalMaxRegionID () const
 Retrieve maximum FIP region ID on local MPI rank. More...
 
bool assignGlobalMaxRegionID (const std::size_t regID)
 
template<class MessageBufferType >
void write (MessageBufferType &buffer) const
 
template<class MessageBufferType >
void read (MessageBufferType &buffer)
 

Friends

class InterRegFlowMap
 

Detailed Description

Form CSR adjacency matrix representation of inter-region flow rate graph provided as a list of connections between regions on local MPI rank. Pertains to a single FIP definition array (e.g., FIPNUM).

Constructor & Destructor Documentation

◆ InterRegFlowMapSingleFIP()

Opm::InterRegFlowMapSingleFIP::InterRegFlowMapSingleFIP ( const std::vector< int > &  region)
explicit

Constructor

Parameters
[in]regionLocal rank's FIP region definition array.

Member Function Documentation

◆ addConnection()

void Opm::InterRegFlowMapSingleFIP::addConnection ( const Cell source,
const Cell destination,
const data::InterRegFlowMap::FlowRates &  rates 
)

Add flow rate connection between regions.

Parameters
[in]sourceCell from which the flow nominally originates.
[in]destinationCell into which flow nominally goes.
[in]ratesFlow rates associated to single connection.

If both cells are in the same region, or if neither cell is interior to this MPI rank, then this function does nothing. If one cell is interior to this MPI rank and the other isn't, then this function will include the flow rate contribution if and only if the cell with the smallest associate region ID is interior to this MPI rank.

◆ assignGlobalMaxRegionID()

bool Opm::InterRegFlowMapSingleFIP::assignGlobalMaxRegionID ( const std::size_t  regID)

Assign maximum FIP region ID across all MPI ranks.

Fails if global maximum is smaller than local maximum region ID.

Parameters
[in]regIDGlobal maximum FIP region ID for this FIP definition array across all MPI ranks.
Returns
Whether or not assignment succeeded.

◆ clear()

void Opm::InterRegFlowMapSingleFIP::clear ( )

Clear all internal buffers, but preserve allocated capacity.

◆ compress()

void Opm::InterRegFlowMapSingleFIP::compress ( )

Form CSR adjacency matrix representation of input graph from connections established in previous calls to addConnection().

Number of rows in the CSR representation is the maximum FIP region ID.

◆ getInterRegFlows()

const data::InterRegFlowMap & Opm::InterRegFlowMapSingleFIP::getInterRegFlows ( ) const

Get read-only access to the underlying CSR representation.

Mostly intended for summary output purposes.

◆ getLocalMaxRegionID()

std::size_t Opm::InterRegFlowMapSingleFIP::getLocalMaxRegionID ( ) const

Retrieve maximum FIP region ID on local MPI rank.

◆ read()

template<class MessageBufferType >
void Opm::InterRegFlowMapSingleFIP::read ( MessageBufferType buffer)
inline

Reconstitute internal object representation from MPI message buffer

This object (

*this

) is not usable in subsequent calls to

void addConnection(const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates)

following a call to member function

read()
void read(MessageBufferType &buffer)
Definition: InterRegFlows.hpp:145

.

Template Parameters
MessageBufferTypeLinear MPI message buffer. API should be similar to Dune::MessageBufferIF
Parameters
[in,out]bufferLinear MPI message buffer instance. Function reads a partially linearised representation of
*this
from the buffer contents and advances the buffer's read position.

◆ write()

template<class MessageBufferType >
void Opm::InterRegFlowMapSingleFIP::write ( MessageBufferType buffer) const
inline

Serialise internal representation to MPI message buffer

Template Parameters
MessageBufferTypeLinear MPI message buffer. API should be similar to Dune::MessageBufferIF
Parameters
[in,out]bufferLinear MPI message buffer instance. Function appends a partially linearised representation of
*this
to the buffer contents.

Friends And Related Function Documentation

◆ InterRegFlowMap

friend class InterRegFlowMap
friend

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