Opm::RegionMapping< Region > Class Template Reference

Forward and reverse mappings between cells and regions/partitions (e.g., the ECLIPSE-style 'SATNUM', 'PVTNUM', or 'EQUILNUM' arrays). More...

#include <RegionMapping.hpp>

Public Types

typedef Region::value_type RegionId
 Type of forward (cell-to-region) mapping result. More...
 
typedef Region::size_type CellId
 Type of reverse (region-to-cell) mapping (element) result.
 
typedef std::vector< CellId >::const_iterator CellIter
 Type of reverse region-to-cell range bounds and iterators.
 
typedef boost::iterator_range< CellIterRange
 
typedef std::vector< CellId >::size_type Pos
 

Public Member Functions

 RegionMapping (const Region &reg)
 Constructor. More...
 
RegionId region (const CellId c) const
 Compute region number of given active cell. More...
 
const std::vector< RegionId > & activeRegions () const
 
Range cells (const RegionId r) const
 Extract active cells in particular region. More...
 

Detailed Description

template<class Region = std::vector<int>>
class Opm::RegionMapping< Region >

Forward and reverse mappings between cells and regions/partitions (e.g., the ECLIPSE-style 'SATNUM', 'PVTNUM', or 'EQUILNUM' arrays).

Template Parameters
RegionType of a forward region mapping. Expected to provide indexed access through operator[]() as well as inner types 'value_type', 'size_type', and 'const_iterator'.

Member Typedef Documentation

◆ RegionId

template<class Region = std::vector<int>>
typedef Region::value_type Opm::RegionMapping< Region >::RegionId

Type of forward (cell-to-region) mapping result.

Expected to be an integer.

Constructor & Destructor Documentation

◆ RegionMapping()

template<class Region = std::vector<int>>
Opm::RegionMapping< Region >::RegionMapping ( const Region &  reg)
inlineexplicit

Constructor.

Parameters
[in]regForward region mapping, restricted to active cells only.

Member Function Documentation

◆ cells()

template<class Region = std::vector<int>>
Range Opm::RegionMapping< Region >::cells ( const RegionId  r) const
inline

Extract active cells in particular region.

Parameters
[in]rRegion number
Returns
Range of active cells in region r. Empty if r is not an active region.

◆ region()

template<class Region = std::vector<int>>
RegionId Opm::RegionMapping< Region >::region ( const CellId  c) const
inline

Compute region number of given active cell.

Parameters
[in]cActive cell
Returns
Region to which c belongs.

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