Opm::ECLRegionMapping Class Reference

#include <ECLRegionMapping.hpp>

Public Types

using IndexView = SimpleIteratorRange< AssembledConnections::Neighbours::const_iterator >
 

Public Member Functions

 ECLRegionMapping (const std::vector< int > &region, const std::vector< int > &regSubset=std::vector< int >())
 
const std::vector< int > & regionSubset () const
 
std::vector< int > activeRegions () const
 
IndexView getRegionIndices (const int region) const
 

Detailed Description

Mapping of region IDs to subsets of explicit cell ID collection.

The typical client code is

const auto map = ECLRegionMapping(/* ... */);
const auto& subset = map.regionSubset();
for (const auto& regID : map.activeRegions()) {
for (const auto& ix : map.getRegionIndices(regID)) {
use(regID, subset[ix]);
}
}
ECLRegionMapping(const std::vector< int > &region, const std::vector< int > &regSubset=std::vector< int >())
std::vector< typename std::result_of< F(typename C::const_iterator::value_type &) >::type > map(F f, const C &src)
Definition: Functional.hpp:84

Member Typedef Documentation

◆ IndexView

using Opm::ECLRegionMapping::IndexView = SimpleIteratorRange< AssembledConnections::Neighbours::const_iterator>

Convenience alias to simplify declaring return type of member function

IndexView getRegionIndices(const int region) const

.

Constructor & Destructor Documentation

◆ ECLRegionMapping()

Opm::ECLRegionMapping::ECLRegionMapping ( const std::vector< int > &  region,
const std::vector< int > &  regSubset = std::vector< int >() 
)

Constructor.

Parameters
[in]regionContainer of region IDs. Typically one of the explicit region ID vectors in an ECL result set such as SATNUM or PVTNUM. Assumed to be defined on all active cells of an ECL result set.
[in]regSubsetIndex subset of region IDs. This object instance partitions the linear indices in
[ 0 .. regSubset.size()-1 ]
according to the corresponding unique region ID in the set
{ region[ i ] }_{i \in regSubset}

If empty or defaulted, regSubset is treated as if it were specified as

[ 0 .. region.size() - 1]

. The common use case for this is working on the entire set of active cells implied by the region ID vector.

The typical use case of an explicit region subset is when sampling PVT or saturation function curves for graphical representation.

Member Function Documentation

◆ activeRegions()

std::vector< int > Opm::ECLRegionMapping::activeRegions ( ) const

Retrieve sorted list of unique region IDs in the subset defined by

{ region[i] }_{i \in regionSubset()}
const std::vector< int > & regionSubset() const

.

◆ getRegionIndices()

IndexView Opm::ECLRegionMapping::getRegionIndices ( const int  region) const

Retrive linear indices into

that correspond to particular region ID.

Parameters
[in]regionNumeric region ID. Must be one of the unique region IDs implied by
std::vector< int > activeRegions() const
. If it is not one of those IDs, function throws an instance of
std::logic_error
.
Returns
Linear index view into .

◆ regionSubset()

const std::vector< int > & Opm::ECLRegionMapping::regionSubset ( ) const

Retrieve index subset.

Identical to constructor argument regSubset if supplied, otherwise the vector

[ 0 .. region.size()-1 ]

.


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