My Project
|
Inter-region flow accumulation maps for all region definition arrays. More...
#include <InterRegFlows.hpp>
Classes | |
struct | SingleRegion |
Minimal representation of a single named region defintion. More... | |
Public Types | |
using | Cell = InterRegFlowMapSingleFIP::Cell |
Characteristics of a cell from a simulation grid. | |
Public Member Functions | |
InterRegFlowMap ()=default | |
Default constructor. | |
InterRegFlowMap (const std::size_t numCells, const std::vector< SingleRegion > ®ions, const std::size_t declaredMaxRegID=0) | |
Constructor. | |
InterRegFlowMap (const InterRegFlowMap &rhs)=default | |
InterRegFlowMap (InterRegFlowMap &&rhs) noexcept=default | |
InterRegFlowMap & | operator= (const InterRegFlowMap &rhs)=default |
InterRegFlowMap & | operator= (InterRegFlowMap &&rhs) noexcept=default |
void | addConnection (const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates) |
Add flow rate connection between regions for all region definitions. | |
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 std::vector< std::string > & | names () const |
Names of all applicable region definition arrays. | |
std::vector< data::InterRegFlowMap > | getInterRegFlows () const |
Get read-only access to the underlying CSR representation. | |
std::vector< std::size_t > | getLocalMaxRegionID () const |
Retrieve maximum FIP region ID on local MPI rank. | |
bool | assignGlobalMaxRegionID (const std::vector< std::size_t > ®ID) |
Assign maximum FIP region ID across all MPI ranks. | |
bool | readIsConsistent () const |
Whether or not previous read() operation succeeded. | |
bool | wantInterRegflowSummary () const |
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. | |
Static Public Member Functions | |
static InterRegFlowMap | createMapFromNames (std::vector< std::string > names) |
Special purpose constructor for global object being collected on the I/O rank. | |
Inter-region flow accumulation maps for all region definition arrays.
|
explicit |
Constructor.
[in] | numCells | Number of cells on local MPI rank, including overlap cells if applicable. |
[in] | regions | All applicable region definition arrays. |
[in] | declaredMaxRegID | Declared maximum region ID in the run-typically from the TABDIMS and/or REGDIMS keywords. Used for sizing internal data structures if greater than zero. |
void Opm::InterRegFlowMap::addConnection | ( | const Cell & | source, |
const Cell & | destination, | ||
const data::InterRegFlowMap::FlowRates & | rates | ||
) |
Add flow rate connection between regions for all region definitions.
[in] | source | Cell from which the flow nominally originates. |
[in] | destination | Cell into which flow nominally goes. |
[in] | rates | Flow 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.
Assign maximum FIP region ID across all MPI ranks.
Fails if global maximum is smaller than local maximum region ID.
[in] | regID | Global maximum FIP region ID for this FIP definition array across all MPI ranks. |
void Opm::InterRegFlowMap::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.
|
static |
Special purpose constructor for global object being collected on the I/O rank.
Only knows about the FIP region set names.
[in] | names | Sorted sequence of FIP region names. |
std::vector< Opm::data::InterRegFlowMap > Opm::InterRegFlowMap::getInterRegFlows | ( | ) | const |
Get read-only access to the underlying CSR representation.
Mostly intended for summary output purposes.
const std::vector< std::string > & Opm::InterRegFlowMap::names | ( | ) | const |
Names of all applicable region definition arrays.
Mostly intended for summary output purposes.
|
inline |
Reconstitute internal object representation from MPI message buffer.
This object (
) is not usable in subsequent calls to
following a call to member function
.
MessageBufferType | Linear MPI message buffer. API should be similar to Dune::MessageBufferIF |
[in,out] | buffer | Linear MPI message buffer instance. Function reads a partially linearised representation of *this
|
|
inline |
Serialise internal representation to MPI message buffer.
MessageBufferType | Linear MPI message buffer. API should be similar to Dune::MessageBufferIF |
[in,out] | buffer | Linear MPI message buffer instance. Function appends a partially linearised representation of *this
|