|
opm-common
|
Public Member Functions | |
| NNCCollection () | |
| Default constructor: the global grid (grid 0) always exists, initially with an empty NNC container. More... | |
| NNCCollection (NNCDataContainer nnc_global) | |
Constructs an NNCCollection pre-populated with nnc_global as the global (grid 0) same-grid NNC. More... | |
| void | addNNC (std::size_t grid1, std::size_t grid2, NNCDataContainerDiffGrid nnc) |
| Add a cross-grid NNC between grid1 and grid2. More... | |
| void | addNNC (std::size_t grid, NNCDataContainer nnc) |
| Add a same-grid NNC for the given grid index. More... | |
| void | addNNC (NNCDataContainer nnc) |
| Add the global (main-grid) NNC. Equivalent to addNNC(0, nnc). More... | |
| const NNCDataContainerDiffGrid & | getNNC (std::size_t grid1, std::size_t grid2) const |
| Returns a const reference to the cross-grid NNC for the (grid1, grid2) pair. More... | |
| NNCDataContainerDiffGrid & | getNNC (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 |
| Returns true if the collection holds no NNC data of any kind. More... | |
| const NNCDataContainer & | getNNC (std::size_t grid) const |
Returns a const reference to the same-grid NNC for grid. More... | |
| NNCDataContainer & | getNNC (std::size_t grid) |
Returns a mutable reference to the same-grid NNC for grid. | |
| bool | hasSameGridNNC (std::size_t grid) const |
| const NNCDataContainer & | getGlobalNNC () const |
| Returns a const reference to the global (grid 0) same-grid NNC. More... | |
| NNCDataContainer & | getGlobalNNC () |
| Returns a mutable reference to the global (grid 0) same-grid NNC. More... | |
| bool | hasGlobalNNC () const |
| Returns true if the global grid has actual same-grid NNC data. More... | |
| bool | hasNNCForGrid (std::size_t grid_index) const |
| Returns true if the given grid has any NNC involvement: same-grid NNCs with data, or cross-grid NNCs with any other grid. More... | |
| 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_(). More... | |
| Opm::NNCCollection::NNCCollection | ( | ) |
Default constructor: the global grid (grid 0) always exists, initially with an empty NNC container.
|
explicit |
Constructs an NNCCollection pre-populated with nnc_global as the global (grid 0) same-grid NNC.
| void Opm::NNCCollection::addNNC | ( | std::size_t | grid1, |
| std::size_t | grid2, | ||
| NNCDataContainerDiffGrid | nnc | ||
| ) |
| void Opm::NNCCollection::addNNC | ( | std::size_t | grid, |
| NNCDataContainer | nnc | ||
| ) |
| void Opm::NNCCollection::addNNC | ( | NNCDataContainer | nnc | ) |
|
inline |
Returns true if the collection holds no NNC data of any kind.
Cannot use m_sameGridNNCs.empty() because grid 0 is always present (inserted by the constructor) even when no NNCs have been added. Instead, each same-grid container is checked for actual entries.
|
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_().
| outputNnc | Same-grid NNCs, indexed by grid level. outputNnc[level] holds the NNCs internal to grid level (0 = main grid). |
| outputNncGlobalLocal | Global-to-local NNCs, indexed by local level offset. outputNncGlobalLocal[i] holds connections between the main grid (level 0) and the refined level i+1. |
| outputAmalgamatedNnc | LGR-to-LGR NNCs, indexed by (smallerLevel-1, largerLevel-smallerLevel-1). outputAmalgamatedNnc[i][j] holds connections between level i+1 and level i+j+2. |
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.
| const NNCDataContainer & Opm::NNCCollection::getGlobalNNC | ( | ) | const |
Returns a const reference to the global (grid 0) same-grid NNC.
Grid 0 is always present (inserted by the constructor); never throws.
| NNCDataContainer & Opm::NNCCollection::getGlobalNNC | ( | ) |
Returns a mutable reference to the global (grid 0) same-grid NNC.
Grid 0 is always present (inserted by the constructor); never throws.
| 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.
| 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.
|
inline |
Returns true if the global grid has actual same-grid NNC data.
Grid 0 always exists in the collection; this checks whether it is non-empty (i.e. NNCs were explicitly added for the global grid).
|
inline |
Returns true if the given grid has any NNC involvement: same-grid NNCs with data, or cross-grid NNCs with any other grid.