My Project
|
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. | |
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. | |
const VertexProperties & | getVertex (int gID) const |
Return properties of vertex of given ID. | |
int | numEdges (int gID) const |
Number of vertices for given vertex. | |
const EdgeList & | edgeList (int gID) const |
List of neighbors for given vertex. | |
int | contractVertices (int gID1, int gID2) |
Contract two vertices. | |
void | addWell (const std::set< int > &well, bool checkIntersection=true) |
Register the well to the list of wells. | |
const auto & | getWells () const |
Return the list of wells. | |
void | addNeighboringCellsToWells () |
Contract a layer of verices around each well into it. | |
void | addNeighboringCellsToWells (int layers) |
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.
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.
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
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.
|
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.