My Project
Loading...
Searching...
No Matches
Opm::InterRegFlowMapSingleFIP Class Reference

Form CSR adjacency matrix representation of inter-region flow rate graph provided as a list of connections between regions on local MPI rank. More...

#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)
 Constructor.
 
void addConnection (const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates)
 Add flow rate connection between regions.
 
void compress ()
 Form CSR adjacency matrix representation of input graph from connections established in previous calls to addConnection().
 
void clear ()
 Clear all internal buffers, but preserve allocated capacity.
 
const data::InterRegFlowMap & getInterRegFlows () const
 Get read-only access to the underlying CSR representation.
 
std::size_t getLocalMaxRegionID () const
 Retrieve maximum FIP region ID on local MPI rank.
 
bool assignGlobalMaxRegionID (const std::size_t regID)
 Assign maximum FIP region ID across all MPI ranks.
 
template<class MessageBufferType >
void write (MessageBufferType &buffer) const
 Serialise internal representation to MPI message buffer.
 
template<class MessageBufferType >
void read (MessageBufferType &buffer)
 Reconstitute internal object representation from MPI message 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.

◆ 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 Opm::data::InterRegFlowMap & Opm::InterRegFlowMapSingleFIP::getInterRegFlows ( ) const

Get read-only access to the underlying CSR representation.

Mostly intended for summary output purposes.

◆ 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)
Add flow rate connection between regions.
Definition InterRegFlows.cpp:47

following a call to member function

read()
void read(MessageBufferType &buffer)
Reconstitute internal object representation from MPI message 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.

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