Loading...
Searching...
No Matches
Opm::InterRegFlowMap Class Reference

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 > &regions, 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 > &regID)
| 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.

## Detailed Description

Inter-region flow accumulation maps for all region definition arrays.

## Constructor & Destructor Documentation

## InterRegFlowMap()

Opm::InterRegFlowMap::InterRegFlowMap | ( | const std::size_t | numCells,
|  | const std::vector< SingleRegion > & | regions,
|  | const std::size_t | declaredMaxRegID = 0 )

explicit

Constructor.

Parameters

  [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.

## Member Function Documentation

## addConnection()

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.

Parameters

  [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.

## assignGlobalMaxRegionID()

bool Opm::InterRegFlowMap::assignGlobalMaxRegionID | ( | const std::vector< 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] | regID | Global maximum FIP region ID for this FIP definition array across all MPI ranks.

Returns
  Whether or not assignment succeeded.

## compress()

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.

## createMapFromNames()

Opm::InterRegFlowMap Opm::InterRegFlowMap::createMapFromNames | ( | std::vector< std::string > | names | ) |

static

Special purpose constructor for global object being collected on the I/O rank.

Only knows about the FIP region set names.

Parameters

  [in] | names | Sorted sequence of FIP region names.

## getInterRegFlows()

std::vector< Opm::data::InterRegFlowMap > Opm::InterRegFlowMap::getInterRegFlows | ( |  | ) | const

Get read-only access to the underlying CSR representation.

Mostly intended for summary output purposes.

## names()

const std::vector< std::string > & Opm::InterRegFlowMap::names | ( |  | ) | const

Names of all applicable region definition arrays.

Mostly intended for summary output purposes.

## read()

template<class MessageBufferType>

void Opm::InterRegFlowMap::read | ( | MessageBufferType & | buffer | ) |

inline

Reconstitute internal object representation from MPI message buffer.

This object (

*this

) is not usable in subsequent calls to

addConnection()
Opm::InterRegFlowMap::addConnection
void addConnection(const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates)
Add flow rate connection between regions for all region definitions.
Definition InterRegFlows.cpp:156

following a call to member function

read()
Opm::InterRegFlowMap::read
void read(MessageBufferType &buffer)
Reconstitute internal object representation from MPI message buffer.
Definition InterRegFlows.hpp:323

.

Template Parameters

  MessageBufferType | Linear MPI message buffer. API should be similar to Dune::MessageBufferIF

Parameters

  [in,out] | buffer | Linear 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::InterRegFlowMap::write | ( | MessageBufferType & | buffer | ) | const

inline

Serialise internal representation to MPI message buffer.

Template Parameters

  MessageBufferType | Linear MPI message buffer. API should be similar to Dune::MessageBufferIF

Parameters

  [in,out] | buffer | Linear 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:

- opm/simulators/flow/InterRegFlows.hpp
- opm/simulators/flow/InterRegFlows.cpp