Opm::GraphOfGrid< Grid > Class Template Reference

A class storing a graph representation of the grid. More...

#include <GraphOfGrid.hpp>

Public Member Functions

 GraphOfGrid (const Grid &grid_, const double *transmissibilities=nullptr, const Dune::EdgeWeightMethod edgeWeightMethod=Dune::EdgeWeightMethod::defaultTransEdgeWgt, int level=-1)
 
const Grid & getGrid () const
 
int size () const
 Number of graph vertices. More...
 
auto begin () const
 
auto end () const
 
auto find (int gID) const
 Get iterator to the vertex with this global ID or ID of the well containing it. More...
 
const VertexProperties & getVertex (int gID) const
 Return properties of vertex of given ID. More...
 
int numEdges (int gID) const
 Number of vertices for given vertex. More...
 
const EdgeList & edgeList (int gID) const
 List of neighbors for given vertex. More...
 
int contractVertices (int gID1, int gID2)
 Contract two vertices. More...
 
void addWell (const std::set< int > &well, bool checkIntersection=true)
 Register the well to the list of wells. More...
 
const auto & getWells () const
 Return the list of wells. More...
 
void addNeighboringCellsToWells ()
 Contract a layer of verices around each well into it. More...
 
void addNeighboringCellsToWells (int layers)
 

Detailed Description

template<typename Grid>
class Opm::GraphOfGrid< Grid >

A class storing a graph representation of the grid.

Stores the list of all cell global IDs and for each cell a list of global IDs of its neighbors. In addition, weights of graph vertices and edges are stored.

Features edge contractions, which adds weights of merged vertices and of edges to every shared neighbor. Intended use is for loadbalancing to ensure that no well is split between processes.

Constructor & Destructor Documentation

◆ GraphOfGrid()

template<typename Grid >
Opm::GraphOfGrid< Grid >::GraphOfGrid ( const Grid &  grid_,
const double *  transmissibilities = nullptr,
const Dune::EdgeWeightMethod  edgeWeightMethod = Dune::EdgeWeightMethod::defaultTransEdgeWgt,
int  level = -1 
)
inlineexplicit

Member Function Documentation

◆ addNeighboringCellsToWells() [1/2]

template<typename Grid >
void Opm::GraphOfGrid< Grid >::addNeighboringCellsToWells ( )

Contract a layer of verices around each well into it.

Representing a well by one node guarantees that the well won't be split over several processes. Giving the well an extra layer of cells distances that well from the subdomain boundary.

Referenced by Opm::GraphOfGrid< Grid >::addNeighboringCellsToWells().

◆ addNeighboringCellsToWells() [2/2]

template<typename Grid >
void Opm::GraphOfGrid< Grid >::addNeighboringCellsToWells ( int  layers)
inline

◆ addWell()

template<typename Grid >
void Opm::GraphOfGrid< Grid >::addWell ( const std::set< int > &  well,
bool  checkIntersection = true 
)

Register the well to the list of wells.

If checkIntersection==true, it checks if any of well's cells is in another well(s) and merges them together. checkIntersection==false skips those (possibly expensive) checks but leaves it to user to guarantee that wells are disjoint and that all cell global IDs are in the graph

◆ begin()

template<typename Grid >
auto Opm::GraphOfGrid< Grid >::begin ( ) const
inline

◆ contractVertices()

template<typename Grid >
int Opm::GraphOfGrid< Grid >::contractVertices ( int  gID1,
int  gID2 
)

Contract two vertices.

Vertex weights are added, and edges are merged. Edge weights for their common neighbors are added up. Returns global ID of the resulting vertex, which is smaller ID. If either gID is in a well, well's ID can be returned if it is smaller.

◆ edgeList()

template<typename Grid >
const EdgeList & Opm::GraphOfGrid< Grid >::edgeList ( int  gID) const
inline

List of neighbors for given vertex.

References Opm::GraphOfGrid< Grid >::find().

◆ end()

template<typename Grid >
auto Opm::GraphOfGrid< Grid >::end ( ) const
inline

◆ find()

template<typename Grid >
auto Opm::GraphOfGrid< Grid >::find ( int  gID) const
inline

Get iterator to the vertex with this global ID or ID of the well containing it.

Referenced by Opm::GraphOfGrid< Grid >::edgeList(), Opm::GraphOfGrid< Grid >::getVertex(), and Opm::GraphOfGrid< Grid >::numEdges().

◆ getGrid()

template<typename Grid >
const Grid & Opm::GraphOfGrid< Grid >::getGrid ( ) const
inline

◆ getVertex()

template<typename Grid >
const VertexProperties & Opm::GraphOfGrid< Grid >::getVertex ( int  gID) const
inline

Return properties of vertex of given ID.

If no such vertex exists, returns vertex with process -1, weight 0, and empty edgeList. If the vertex is in a well, return the well's vertex.

References Opm::GraphOfGrid< Grid >::find().

◆ getWells()

template<typename Grid >
const auto & Opm::GraphOfGrid< Grid >::getWells ( ) const
inline

Return the list of wells.

◆ numEdges()

template<typename Grid >
int Opm::GraphOfGrid< Grid >::numEdges ( int  gID) const
inline

Number of vertices for given vertex.

References Opm::GraphOfGrid< Grid >::find().

◆ size()

template<typename Grid >
int Opm::GraphOfGrid< Grid >::size ( ) const
inline

Number of graph vertices.


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