Opm::UgGridHelpers Namespace Reference

Classes

struct  Cell2FacesTraits
 Maps the grid type to the associated type of the cell to faces mapping. More...
 
struct  Cell2FacesTraits< Dune::CpGrid >
 
struct  Cell2FacesTraits< Dune::PolyhedralGrid< dim, dimworld > >
 
struct  Cell2FacesTraits< UnstructuredGrid >
 
struct  CellCentroidTraits
 Traits of the cell centroids of a grid. More...
 
struct  CellCentroidTraits< Dune::CpGrid >
 
struct  CellCentroidTraits< Dune::PolyhedralGrid< dim, dimworld > >
 
struct  CellCentroidTraits< UnstructuredGrid >
 
class  CellVolumeIterator
 An iterator over the cell volumes. More...
 
struct  CellVolumeIteratorTraits
 The mapping of the grid type to type of the iterator over the cell volumes. More...
 
struct  CellVolumeIteratorTraits< Dune::CpGrid >
 
struct  CellVolumeIteratorTraits< Dune::PolyhedralGrid< dim, dimworld > >
 
struct  CellVolumeIteratorTraits< UnstructuredGrid >
 
class  CpGridCentroidIterator
 An iterator over the cell volumes. More...
 
struct  Face2VerticesTraits
 Maps the grid type to the associated type of the face to vertices mapping. More...
 
struct  Face2VerticesTraits< Dune::CpGrid >
 
struct  Face2VerticesTraits< Dune::PolyhedralGrid< dim, dimworld > >
 
struct  Face2VerticesTraits< UnstructuredGrid >
 
class  FaceCellsProxy
 
struct  FaceCellTraits
 Traits of the face to attached cell mappping of a grid. More...
 
struct  FaceCellTraits< Dune::CpGrid >
 
struct  FaceCellTraits< Dune::PolyhedralGrid< dim, dimworld > >
 
struct  FaceCellTraits< UnstructuredGrid >
 
struct  FaceCentroidTraits
 Traits of the face centroids of a grid. More...
 
struct  FaceCentroidTraits< Dune::CpGrid >
 
struct  FaceCentroidTraits< Dune::PolyhedralGrid< dim, dimworld > >
 
struct  FaceCentroidTraits< UnstructuredGrid >
 
class  SparseTableView
 Allows viewing a sparse table consisting out of C-array. More...
 

Typedefs

typedef Dune::FieldVector< double, 3 > Vector
 

Functions

int numCells (const Dune::CpGrid &grid)
 Get the number of cells of a grid. More...
 
int numFaces (const Dune::CpGrid &grid)
 Get the number of faces of a grid. More...
 
int dimensions (const Dune::CpGrid &grid)
 Get the dimensions of a grid. More...
 
int numCellFaces (const Dune::CpGrid &grid)
 Get the number of faces, where each face counts as many times as there are adjacent faces. More...
 
const int * cartDims (const Dune::CpGrid &grid)
 Get the cartesion dimension of the underlying structured grid. More...
 
const int * globalCell (const Dune::CpGrid &)
 Get the local to global index mapping. More...
 
CellCentroidTraits< Dune::CpGrid >::IteratorType beginCellCentroids (const Dune::CpGrid &grid)
 
double cellCentroidCoordinate (const Dune::CpGrid &grid, int cell_index, int coordinate)
 Get a coordinate of a specific cell centroid. More...
 
const double * cellCentroid (const Dune::CpGrid &grid, int cell_index)
 Get the centroid of a cell. More...
 
double cellCenterDepth (const Dune::CpGrid &grid, int cell_index)
 Get vertical position of cell center ("zcorn" average). More...
 
Vector faceCenterEcl (const Dune::CpGrid &grid, int cell_index, int face_tag)
 Get a coordinate of a specific face center. More...
 
Vector faceAreaNormalEcl (const Dune::CpGrid &grid, int face_index)
 Get a area weighted normal vector of a specific face. More...
 
double cellVolume (const Dune::CpGrid &grid, int cell_index)
 Get the volume of a cell. More...
 
CellVolumeIterator beginCellVolumes (const Dune::CpGrid &grid)
 Get an iterator over the cell volumes of a grid positioned at the first cell. More...
 
CellVolumeIterator endCellVolumes (const Dune::CpGrid &grid)
 Get an iterator over the cell volumes of a grid positioned one after the last cell. More...
 
FaceCentroidTraits< Dune::CpGrid >::IteratorType beginFaceCentroids (const Dune::CpGrid &grid)
 Get an iterator over the face centroids positioned at the first cell. More...
 
const FaceCentroidTraits< Dune::CpGrid >::ValueType & faceCentroid (const Dune::CpGrid &grid, int face_index)
 Get a coordinate of a specific face centroid. More...
 
Dune::cpgrid::Cell2FacesContainer cell2Faces (const Dune::CpGrid &grid)
 Get the cell to faces mapping of a grid. More...
 
FaceCellTraits< Dune::CpGrid >::Type faceCells (const Dune::CpGrid &grid)
 Get the face to cell mapping of a grid. More...
 
Face2VerticesTraits< Dune::CpGrid >::Type face2Vertices (const Dune::CpGrid &grid)
 Get the face to vertices mapping of a grid. More...
 
const double * vertexCoordinates (const Dune::CpGrid &grid, int index)
 Get the coordinates of a vertex of the grid. More...
 
const double * faceNormal (const Dune::CpGrid &grid, int face_index)
 
double faceArea (const Dune::CpGrid &grid, int face_index)
 
int faceTag (const Dune::CpGrid &grid, const Dune::cpgrid::Cell2FacesRow::iterator &cell_face)
 Get Eclipse Cartesian tag of a face. More...
 
int numCells (const UnstructuredGrid &grid)
 Get the number of cells of a grid. More...
 
int numFaces (const UnstructuredGrid &grid)
 Get the number of faces of a grid. More...
 
int dimensions (const UnstructuredGrid &grid)
 Get the dimensions of a grid. More...
 
int numCellFaces (const UnstructuredGrid &grid)
 Get the number of faces, where each face counts as many times as there are adjacent faces. More...
 
const int * cartDims (const UnstructuredGrid &grid)
 Get the cartesion dimension of the underlying structured grid. More...
 
const int * globalCell (const UnstructuredGrid &grid)
 Get the local to global index mapping. More...
 
CellCentroidTraits< UnstructuredGrid >::IteratorType beginCellCentroids (const UnstructuredGrid &grid)
 Get an iterator over the cell centroids positioned at the first cell. More...
 
double cellCenterDepth (const UnstructuredGrid &grid, int cell_index)
 Get vertical position of cell center ("zcorn" average.) More...
 
Dune::FieldVector< double, 3 > faceCenterEcl (const UnstructuredGrid &grid, int cell_index, int face_tag)
 Get a coordinate of a specific face center. More...
 
Dune::FieldVector< double, 3 > faceAreaNormalEcl (const UnstructuredGrid &grid, int face_index)
 Get a area weighted normal vector of a specific face. More...
 
double cellCentroidCoordinate (const UnstructuredGrid &grid, int cell_index, int coordinate)
 Get a coordinate of a specific cell centroid. More...
 
const double * cellCentroid (const UnstructuredGrid &grid, int cell_index)
 Get the centroid of a cell. More...
 
double cellVolume (const UnstructuredGrid &grid, int cell_index)
 Get the volume of a cell. More...
 
const double * beginCellVolumes (const UnstructuredGrid &grid)
 Get an iterator over the cell volumes of a grid positioned at the first cell. More...
 
const double * endCellVolumes (const UnstructuredGrid &grid)
 Get an iterator over the cell volumes of a grid positioned after the last cell. More...
 
FaceCentroidTraits< UnstructuredGrid >::IteratorType beginFaceCentroids (const UnstructuredGrid &grid)
 Get an iterator over the face centroids positioned at the first cell. More...
 
FaceCentroidTraits< UnstructuredGrid >::ValueType faceCentroid (const UnstructuredGrid &grid, int face_index)
 Get a coordinate of a specific face centroid. More...
 
const double * faceNormal (const UnstructuredGrid &grid, int face_index)
 Get the normal of a face. More...
 
double faceArea (const UnstructuredGrid &grid, int face_index)
 Get the area of a face. More...
 
Cell2FacesTraits< UnstructuredGrid >::Type cell2Faces (const UnstructuredGrid &grid)
 Get the cell to faces mapping of a grid. More...
 
Face2VerticesTraits< UnstructuredGrid >::Type face2Vertices (const UnstructuredGrid &grid)
 Get the face to vertices mapping of a grid. More...
 
const double * vertexCoordinates (const UnstructuredGrid &grid, int index)
 Get the coordinates of a vertex of the grid. More...
 
FaceCellTraits< UnstructuredGrid >::Type faceCells (const UnstructuredGrid &grid)
 Get the face to cell mapping of a grid. More...
 
template<class T >
T * increment (T *cc, int i, int dim)
 Increment an iterator over an array that reresents a dense row-major matrix with dims columns. More...
 
template<class T >
increment (const T &t, int i, int)
 Increment an iterator over an array that reresents a dense row-major matrix with dims columns. More...
 
template<class T >
double getCoordinate (T *cc, int i)
 Get the i-th corrdinate of a centroid. More...
 
template<class T >
double getCoordinate (T t, int i)
 Get the i-th corrdinate of an array. More...
 

Typedef Documentation

◆ Vector

typedef Dune::FieldVector<double, 3> Opm::UgGridHelpers::Vector

Function Documentation

◆ beginCellCentroids() [1/2]

CellCentroidTraits< Dune::CpGrid >::IteratorType Opm::UgGridHelpers::beginCellCentroids ( const Dune::CpGrid grid)

Referenced by tpfa_htrans_compute().

◆ beginCellCentroids() [2/2]

CellCentroidTraits< UnstructuredGrid >::IteratorType Opm::UgGridHelpers::beginCellCentroids ( const UnstructuredGrid grid)

Get an iterator over the cell centroids positioned at the first cell.

The return type needs to be usable with the functions increment, and getCoordinate.

◆ beginCellVolumes() [1/2]

CellVolumeIterator Opm::UgGridHelpers::beginCellVolumes ( const Dune::CpGrid grid)

Get an iterator over the cell volumes of a grid positioned at the first cell.

◆ beginCellVolumes() [2/2]

const double * Opm::UgGridHelpers::beginCellVolumes ( const UnstructuredGrid grid)

Get an iterator over the cell volumes of a grid positioned at the first cell.

Will create an EclipseGrid representation (i.e. based on ZCORN and COORD) of the current UnstructuredGrid instance. When creating the UnstructuredGrid the detailed cornerpoint information is discarded, and it is difficult to go backwards to recreated ZCORN and COORD.

The current implementation is based on retaining a copy of the zcorn keyword after the Minpvprocessor has modified it.

We then create a new EclipseGrid instance based on the original input grid, but we "replace" the ZCORN and ACTNUM keywords with the updated versions.

If the tolerance in the call to create_grid_cornerpoint( ) is finite the grid processing code might collapse cells, the z coordinate transformations from this process will not be correctly represented in the EclipseGrid created by this method.

◆ beginFaceCentroids() [1/2]

FaceCentroidTraits< Dune::CpGrid >::IteratorType Opm::UgGridHelpers::beginFaceCentroids ( const Dune::CpGrid grid)

Get an iterator over the face centroids positioned at the first cell.

◆ beginFaceCentroids() [2/2]

FaceCentroidTraits< UnstructuredGrid >::IteratorType Opm::UgGridHelpers::beginFaceCentroids ( const UnstructuredGrid grid)

Get an iterator over the face centroids positioned at the first cell.

◆ cartDims() [1/2]

const int * Opm::UgGridHelpers::cartDims ( const Dune::CpGrid grid)

Get the cartesion dimension of the underlying structured grid.

◆ cartDims() [2/2]

const int * Opm::UgGridHelpers::cartDims ( const UnstructuredGrid grid)

Get the cartesion dimension of the underlying structured grid.

◆ cell2Faces() [1/2]

Dune::cpgrid::Cell2FacesContainer Opm::UgGridHelpers::cell2Faces ( const Dune::CpGrid grid)

Get the cell to faces mapping of a grid.

Referenced by tpfa_eff_trans_compute(), tpfa_htrans_compute(), and tpfa_trans_compute().

◆ cell2Faces() [2/2]

Cell2FacesTraits< UnstructuredGrid >::Type Opm::UgGridHelpers::cell2Faces ( const UnstructuredGrid grid)

Get the cell to faces mapping of a grid.

◆ cellCenterDepth() [1/2]

double Opm::UgGridHelpers::cellCenterDepth ( const Dune::CpGrid grid,
int  cell_index 
)

Get vertical position of cell center ("zcorn" average).

grid The grid.

cell_index The index of the specific cell.

◆ cellCenterDepth() [2/2]

double Opm::UgGridHelpers::cellCenterDepth ( const UnstructuredGrid grid,
int  cell_index 
)

Get vertical position of cell center ("zcorn" average.)

grid The grid.

cell_index The index of the specific cell.

◆ cellCentroid() [1/2]

const double * Opm::UgGridHelpers::cellCentroid ( const Dune::CpGrid grid,
int  cell_index 
)

Get the centroid of a cell.

Parameters
gridThe grid whose cell centroid we query.
cell_indexThe index of the corresponding cell.

◆ cellCentroid() [2/2]

const double * Opm::UgGridHelpers::cellCentroid ( const UnstructuredGrid grid,
int  cell_index 
)

Get the centroid of a cell.

Parameters
gridThe grid whose cell centroid we query.
cell_indexThe index of the corresponding cell.

◆ cellCentroidCoordinate() [1/2]

double Opm::UgGridHelpers::cellCentroidCoordinate ( const Dune::CpGrid grid,
int  cell_index,
int  coordinate 
)

Get a coordinate of a specific cell centroid.

grid The grid.

cell_index The index of the specific cell. \breif coordinate The coordinate index.

◆ cellCentroidCoordinate() [2/2]

double Opm::UgGridHelpers::cellCentroidCoordinate ( const UnstructuredGrid grid,
int  cell_index,
int  coordinate 
)

Get a coordinate of a specific cell centroid.

grid The grid.

cell_index The index of the specific cell. \breif coordinate The coordinate index.

◆ cellVolume() [1/2]

double Opm::UgGridHelpers::cellVolume ( const Dune::CpGrid grid,
int  cell_index 
)

Get the volume of a cell.

Parameters
gridThe grid the cell belongs to.
cell_indexThe index of the cell.

◆ cellVolume() [2/2]

double Opm::UgGridHelpers::cellVolume ( const UnstructuredGrid grid,
int  cell_index 
)

Get the volume of a cell.

Parameters
gridThe grid the cell belongs to.
cell_indexThe index of the cell.

◆ dimensions() [1/2]

int Opm::UgGridHelpers::dimensions ( const Dune::CpGrid grid)

Get the dimensions of a grid.

Referenced by tpfa_htrans_compute().

◆ dimensions() [2/2]

int Opm::UgGridHelpers::dimensions ( const UnstructuredGrid grid)

Get the dimensions of a grid.

◆ endCellVolumes() [1/2]

CellVolumeIterator Opm::UgGridHelpers::endCellVolumes ( const Dune::CpGrid grid)

Get an iterator over the cell volumes of a grid positioned one after the last cell.

◆ endCellVolumes() [2/2]

const double * Opm::UgGridHelpers::endCellVolumes ( const UnstructuredGrid grid)

Get an iterator over the cell volumes of a grid positioned after the last cell.

◆ face2Vertices() [1/2]

Face2VerticesTraits< Dune::CpGrid >::Type Opm::UgGridHelpers::face2Vertices ( const Dune::CpGrid grid)

Get the face to vertices mapping of a grid.

◆ face2Vertices() [2/2]

Face2VerticesTraits< UnstructuredGrid >::Type Opm::UgGridHelpers::face2Vertices ( const UnstructuredGrid grid)

Get the face to vertices mapping of a grid.

◆ faceArea() [1/2]

double Opm::UgGridHelpers::faceArea ( const Dune::CpGrid grid,
int  face_index 
)

◆ faceArea() [2/2]

double Opm::UgGridHelpers::faceArea ( const UnstructuredGrid grid,
int  face_index 
)

Get the area of a face.

Parameters
gridThe grid that the face is part of.
face_indexThe index of the face in the grid.

◆ faceAreaNormalEcl() [1/2]

Vector Opm::UgGridHelpers::faceAreaNormalEcl ( const Dune::CpGrid grid,
int  face_index 
)

Get a area weighted normal vector of a specific face.

calculated without introducing a center point

For cornerpoint grids this is supposed to give

values closer to Ecl.

Parameters
gridThe grid.
face_indexThe index of the specific face.

◆ faceAreaNormalEcl() [2/2]

Dune::FieldVector< double, 3 > Opm::UgGridHelpers::faceAreaNormalEcl ( const UnstructuredGrid grid,
int  face_index 
)

Get a area weighted normal vector of a specific face.

calculated without introducing a center point

For cornerpoint grids this is supposed to give

values closer to Ecl.

Parameters
gridThe grid.
face_indexThe index of the specific face.

◆ faceCells() [1/2]

FaceCellTraits< Dune::CpGrid >::Type Opm::UgGridHelpers::faceCells ( const Dune::CpGrid grid)

Get the face to cell mapping of a grid.

Referenced by tpfa_htrans_compute().

◆ faceCells() [2/2]

FaceCellTraits< UnstructuredGrid >::Type Opm::UgGridHelpers::faceCells ( const UnstructuredGrid grid)

Get the face to cell mapping of a grid.

◆ faceCenterEcl() [1/2]

Vector Opm::UgGridHelpers::faceCenterEcl ( const Dune::CpGrid grid,
int  cell_index,
int  face_tag 
)

Get a coordinate of a specific face center.

calculated as the raw average of the cell corners

Parameters
gridThe grid.
cell_indexThe index of the specific cell.
face_tagThe logical cartesian index of the face

◆ faceCenterEcl() [2/2]

Dune::FieldVector< double, 3 > Opm::UgGridHelpers::faceCenterEcl ( const UnstructuredGrid grid,
int  cell_index,
int  face_tag 
)

Get a coordinate of a specific face center.

calculated as the raw average of the cell corners

Parameters
gridThe grid.
cell_indexThe index of the specific cell.
face_tagThe logical cartesian index of the face

◆ faceCentroid() [1/2]

const FaceCentroidTraits< Dune::CpGrid >::ValueType & Opm::UgGridHelpers::faceCentroid ( const Dune::CpGrid grid,
int  face_index 
)

Get a coordinate of a specific face centroid.

Parameters
gridThe grid.
face_indexThe index of the specific face.
coordinateThe coordinate index.

Referenced by tpfa_htrans_compute().

◆ faceCentroid() [2/2]

FaceCentroidTraits< UnstructuredGrid >::ValueType Opm::UgGridHelpers::faceCentroid ( const UnstructuredGrid grid,
int  face_index 
)

Get a coordinate of a specific face centroid.

Parameters
gridThe grid.
face_indexThe index of the specific face.

◆ faceNormal() [1/2]

const double * Opm::UgGridHelpers::faceNormal ( const Dune::CpGrid grid,
int  face_index 
)

Referenced by tpfa_htrans_compute().

◆ faceNormal() [2/2]

const double * Opm::UgGridHelpers::faceNormal ( const UnstructuredGrid grid,
int  face_index 
)

Get the normal of a face.

Parameters
gridThe grid that the face is part of.
face_indexThe index of the face in the grid.

◆ faceTag()

int Opm::UgGridHelpers::faceTag ( const Dune::CpGrid grid,
const Dune::cpgrid::Cell2FacesRow::iterator cell_face 
)

Get Eclipse Cartesian tag of a face.

Parameters
gridThe grid that the face is part of.
cell_faceThe face attached to a cell. Usually obtained from face2Cells.
Returns
0, 1, 2, 3, 4, 5 for I-, I+, J-, J+, K-, K+

Referenced by Dune::PolyhedralGrid< dim, dimworld, coord_t >::init().

◆ getCoordinate() [1/2]

template<class T >
double Opm::UgGridHelpers::getCoordinate ( T *  cc,
int  i 
)

Get the i-th corrdinate of a centroid.

Parameters
ccThe array with the coordinates.
iThe index of the coordinate.
Template Parameters
TThe type of the coordinate of the centroid.

Referenced by tpfa_htrans_compute().

◆ getCoordinate() [2/2]

template<class T >
double Opm::UgGridHelpers::getCoordinate ( t,
int  i 
)

Get the i-th corrdinate of an array.

Parameters
tThe iterator over the centroids

i The index of the coordinate.

Template Parameters
TThe type of the iterator representing the centroid. Its value_type has to provide an operator[] to access the coordinates.

◆ globalCell() [1/2]

const int * Opm::UgGridHelpers::globalCell ( const Dune::CpGrid )

Get the local to global index mapping.

The global index is the index of the active cell in the underlying structured grid.

◆ globalCell() [2/2]

const int * Opm::UgGridHelpers::globalCell ( const UnstructuredGrid grid)

Get the local to global index mapping.

The global index is the index of the active cell in the underlying structured grid.

◆ increment() [1/2]

template<class T >
T Opm::UgGridHelpers::increment ( const T &  t,
int  i,
int   
)

Increment an iterator over an array that reresents a dense row-major matrix with dims columns.

Parameters
ccThe iterator.
iThe nzumber of rows to increment

◆ increment() [2/2]

template<class T >
T * Opm::UgGridHelpers::increment ( T *  cc,
int  i,
int  dim 
)

Increment an iterator over an array that reresents a dense row-major matrix with dims columns.

Parameters
ccThe iterator.
iThe nzumber of rows to increment
dimThe number of columns of the matrix.

Referenced by Dune::Point2PointCommunicator< MsgBuffer >::getMessageTag(), and tpfa_htrans_compute().

◆ numCellFaces() [1/2]

int Opm::UgGridHelpers::numCellFaces ( const Dune::CpGrid grid)

Get the number of faces, where each face counts as many times as there are adjacent faces.

Referenced by Dune::GridFactory< PolyhedralGrid< dim, dimworld, coord_t > >::createGrid().

◆ numCellFaces() [2/2]

int Opm::UgGridHelpers::numCellFaces ( const UnstructuredGrid grid)

Get the number of faces, where each face counts as many times as there are adjacent faces.

◆ numCells() [1/2]

◆ numCells() [2/2]

int Opm::UgGridHelpers::numCells ( const UnstructuredGrid grid)

Get the number of cells of a grid.

◆ numFaces() [1/2]

int Opm::UgGridHelpers::numFaces ( const Dune::CpGrid grid)

Get the number of faces of a grid.

Referenced by tpfa_eff_trans_compute(), and tpfa_trans_compute().

◆ numFaces() [2/2]

int Opm::UgGridHelpers::numFaces ( const UnstructuredGrid grid)

Get the number of faces of a grid.

◆ vertexCoordinates() [1/2]

const double * Opm::UgGridHelpers::vertexCoordinates ( const Dune::CpGrid grid,
int  index 
)

Get the coordinates of a vertex of the grid.

Parameters
gridThe grid the vertex is part of.
indexThe index identifying the vertex.

◆ vertexCoordinates() [2/2]

const double * Opm::UgGridHelpers::vertexCoordinates ( const UnstructuredGrid grid,
int  index 
)

Get the coordinates of a vertex of the grid.

Parameters
gridThe grid the vertex is part of.
indexThe index identifying the vertex.