My Project
|
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 > ®ion) | |
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 |
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).
|
explicit |
Constructor.
[in] | region | Local rank's FIP region definition array. |
void Opm::InterRegFlowMapSingleFIP::addConnection | ( | const Cell & | source, |
const Cell & | destination, | ||
const data::InterRegFlowMap::FlowRates & | rates | ||
) |
Add flow rate connection between regions.
[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::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.
const Opm::data::InterRegFlowMap & Opm::InterRegFlowMapSingleFIP::getInterRegFlows | ( | ) | const |
Get read-only access to the underlying CSR representation.
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
|