opm-common
Loading...
Searching...
No Matches
Opm::NNCCollection Class Reference

Public Member Functions

 NNCCollection (NNCDataContainer nnc_global)
 Constructs an NNCCollection pre-populated with nnc_global as the global (grid 0) same-grid NNC.
void addNNC (std::size_t grid1, std::size_t grid2, NNCDataContainerDiffGrid nnc)
 Add a cross-grid NNC between grid1 and grid2.
void addNNC (std::size_t grid, NNCDataContainer nnc)
 Add a same-grid NNC for the given grid index.
void addNNC (NNCDataContainer nnc)
 Add the global (main-grid) NNC. Equivalent to addNNC(0, nnc).
const NNCDataContainerDiffGridgetNNC (std::size_t grid1, std::size_t grid2) const
 Returns a const reference to the cross-grid NNC for the (grid1, grid2) pair.
NNCDataContainerDiffGridgetNNC (std::size_t grid1, std::size_t grid2)
 Returns a mutable reference to the cross-grid NNC for the (grid1, grid2) pair.
bool hasCrossGridNNC (std::size_t grid1, std::size_t grid2) const
bool empty () const
const NNCDataContainergetNNC (std::size_t grid) const
 Returns a const reference to the same-grid NNC for grid.
NNCDataContainergetNNC (std::size_t grid)
 Returns a mutable reference to the same-grid NNC for grid.
bool hasSameGridNNC (std::size_t grid) const
const NNCDataContainergetGlobalNNC () const
 Returns a const reference to the global (grid 0) same-grid NNC.
NNCDataContainergetGlobalNNC ()
 Returns a mutable reference to the global (grid 0) same-grid NNC.
bool hasGlobalNNC () const
bool hasNNCForGrid (std::size_t grid_index) const
 Returns true if the given grid has any NNC involvement: same-grid NNCs, or cross-grid NNCs with any other grid.
const std::map< std::size_t, NNCDataContainer > & same_grid_nnc () const
 Returns a view of all same-grid NNCs as (grid_index, NNC) pairs.
const std::map< std::pair< std::size_t, std::size_t >, NNCDataContainerDiffGrid > & diff_grid_nnc () const
 Returns a view of all cross-grid NNCs keyed by normalised (g1,g2) pairs.
bool operator== (const NNCCollection &other) const

Static Public Member Functions

static NNCCollection fromLGROutputContainers (const std::vector< std::vector< NNCdata > > &outputNnc, const std::vector< std::vector< NNCdata > > &outputNncGlobalLocal, const std::vector< std::vector< std::vector< NNCdata > > > &outputAmalgamatedNnc)
 Build an NNCCollection from the three output containers produced by EclGenericWriter::exportNncStructure_().

Member Function Documentation

◆ addNNC() [1/3]

void Opm::NNCCollection::addNNC ( NNCDataContainer nnc)

Add the global (main-grid) NNC. Equivalent to addNNC(0, nnc).

Adds nnc as the global (grid 0) same-grid NNC.

Equivalent to addNNC(0, nnc).

◆ addNNC() [2/3]

void Opm::NNCCollection::addNNC ( std::size_t grid,
NNCDataContainer nnc )

Add a same-grid NNC for the given grid index.

Adds a same-grid NNC for grid.

Throws std::runtime_error if an entry for this grid index already exists.

◆ addNNC() [3/3]

void Opm::NNCCollection::addNNC ( std::size_t grid1,
std::size_t grid2,
NNCDataContainerDiffGrid nnc )

Add a cross-grid NNC between grid1 and grid2.

Adds a cross-grid NNC between grid1 and grid2.

The key is normalised to (min, max) and cell indices are swapped accordingly. Throws std::runtime_error if an entry for this grid pair already exists.

◆ fromLGROutputContainers()

NNCCollection Opm::NNCCollection::fromLGROutputContainers ( const std::vector< std::vector< NNCdata > > & outputNnc,
const std::vector< std::vector< NNCdata > > & outputNncGlobalLocal,
const std::vector< std::vector< std::vector< NNCdata > > > & outputAmalgamatedNnc )
static

Build an NNCCollection from the three output containers produced by EclGenericWriter::exportNncStructure_().

Builds an NNCCollection from the three output containers produced by EclGenericWriter::exportNncStructure_().

Parameters
outputNncSame-grid NNCs, indexed by grid level. outputNnc[level] holds the NNCs internal to grid level (0 = main grid).
outputNncGlobalLocalGlobal-to-local NNCs, indexed by local level offset. outputNncGlobalLocal[i] holds connections between the main grid (level 0) and the refined level i+1.
outputAmalgamatedNncLGR-to-LGR NNCs, indexed by (smallerLevel-1, largerLevel-smallerLevel-1). outputAmalgamatedNnc[i][j] holds connections between level i+1 and level i+j+2.
Returns
An NNCCollection populated with all three NNC types.

Index convention (matches the layout written by exportNncStructure_):

outputNnc[level] → same-grid NNCs for grid level (0 = main grid).

outputNncGlobalLocal[i] → cross-grid NNCs between main grid (level 0) and level i+1.

outputAmalgamatedNnc[i][j] → cross-grid NNCs between level i+1 and level i+j+2.

◆ getGlobalNNC() [1/2]

NNCDataContainer & Opm::NNCCollection::getGlobalNNC ( )

Returns a mutable reference to the global (grid 0) same-grid NNC.

Throws std::runtime_error if no global NNC has been added.

◆ getGlobalNNC() [2/2]

const NNCDataContainer & Opm::NNCCollection::getGlobalNNC ( ) const

Returns a const reference to the global (grid 0) same-grid NNC.

Throws std::runtime_error if no global NNC has been added.

◆ getNNC() [1/2]

const NNCDataContainer & Opm::NNCCollection::getNNC ( std::size_t grid) const

Returns a const reference to the same-grid NNC for grid.

Throws std::runtime_error if no entry exists.

◆ getNNC() [2/2]

const NNCDataContainerDiffGrid & Opm::NNCCollection::getNNC ( std::size_t grid1,
std::size_t grid2 ) const

Returns a const reference to the cross-grid NNC for the (grid1, grid2) pair.

Grid order is normalised automatically. Throws std::runtime_error if no entry exists.


The documentation for this class was generated from the following files:
  • opm/input/eclipse/EclipseState/Grid/NNC.hpp
  • opm/input/eclipse/EclipseState/Grid/NNC.cpp