My Project
|
Form CSR adjacency matrix representation of inter-region flow rate graph provided as a list of connections between regions. More...
#include <InterRegFlowMap.hpp>
Public Member Functions | |
void | addConnection (const int r1, const int r2, const FlowRates &rates) |
Add flow rate connection between regions. | |
void | compress (const std::size_t numRegions) |
Form CSR adjacency matrix representation of input graph from connections established in previous calls to addConnection(). | |
Offset | numRegions () const |
Retrieve number of rows (source entities) in input graph. | |
std::optional< std::pair< ReadOnlyWindow, ReadOnlyWindow::ElmT > > | getInterRegFlows (const int r1, const int r2) const |
Retrieve accumulated inter-region flow rates for identified pair of regions. | |
template<class MessageBufferType > | |
void | write (MessageBufferType &buffer) const |
template<class MessageBufferType > | |
void | read (MessageBufferType &buffer) |
void | clear () |
Clear all internal buffers, but preserve allocated capacity. | |
Form CSR adjacency matrix representation of inter-region flow rate graph provided as a list of connections between regions.
void Opm::data::InterRegFlowMap::addConnection | ( | const int | r1, |
const int | r2, | ||
const FlowRates & | rates | ||
) |
Add flow rate connection between regions.
[in] | r1 | Primary (source) zero-based region index. Used as row index. |
[in] | r2 | Secondary (sink) zero-based region index. Used as column index. |
[in] | rates | Flow rates associated to single connection. |
If both region IDs are the same then this function does nothing.
void Opm::data::InterRegFlowMap::compress | ( | const std::size_t | numRegions | ) |
Form CSR adjacency matrix representation of input graph from connections established in previous calls to addConnection().
[in] | numRegions | Number of rows in resulting CSR matrix. If prior calls to addConnection() supply source entity IDs (row indices) greater than or equal to numRows , then method compress() will throw std::invalid_argument
|
std::optional< std::pair< Opm::data::InterRegFlowMap::ReadOnlyWindow, Opm::data::InterRegFlowMap::ReadOnlyWindow::ElmT > > Opm::data::InterRegFlowMap::getInterRegFlows | ( | const int | r1, |
const int | r2 | ||
) | const |
Retrieve accumulated inter-region flow rates for identified pair of regions.
[in] | r1 | Primary (source) zero-based region index. Used as row index. |
[in] | r2 | Secondary (sink) zero-based region index. Used as column index. |
Opm::data::InterRegFlowMap::Offset Opm::data::InterRegFlowMap::numRegions | ( | ) | const |
Retrieve number of rows (source entities) in input graph.
Corresponds to value of argument passed to compress(). Valid only after calling compress().