Opm::UgGridHelpers Namespace Reference

Classes

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

Functions

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...
 
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...
 
const double * faceCentroid (const UnstructuredGrid &grid, int face_index)
 Get the cell centroid of a face. More...
 
FaceCentroidTraits
< UnstructuredGrid >
::IteratorType 
beginFaceCentroids (const UnstructuredGrid &grid)
 Get an iterator over the face centroids positioned at the first cell. 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...
 
int faceTag (const UnstructuredGrid &grid, boost::iterator_range< const int * >::const_iterator cell_face)
 Get Eclipse Cartesian tag 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...
 
int dimensions (const Dune::CpGrid &)
 
double faceArea (const Dune::CpGrid &, int)
 

Function Documentation

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.

Referenced by tpfa_htrans_compute().

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

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

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

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

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

Get the cartesion dimension of the underlying structured grid.

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

Get the cell to faces mapping of a grid.

Referenced by Opm::Equil::phasePressures(), tpfa_eff_trans_compute(), tpfa_htrans_compute(), and tpfa_trans_compute().

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.

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.
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. coordinate The coordinate index.

Referenced by Opm::Details::PhasePressure::assign(), Opm::Equil::computeRs(), and Opm::Equil::phaseSaturations().

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.
int Opm::UgGridHelpers::dimensions ( const Dune::CpGrid &  )
int Opm::UgGridHelpers::dimensions ( const UnstructuredGrid grid)
const double* Opm::UgGridHelpers::endCellVolumes ( const UnstructuredGrid grid)

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

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

Get the face to vertices mapping of a grid.

Referenced by Opm::Equil::phasePressures().

double Opm::UgGridHelpers::faceArea ( const Dune::CpGrid &  ,
int   
)
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.
FaceCellTraits<UnstructuredGrid>::Type Opm::UgGridHelpers::faceCells ( const UnstructuredGrid grid)
FaceCentroidTraits< UnstructuredGrid >::ValueType Opm::UgGridHelpers::faceCentroid ( const UnstructuredGrid grid,
int  face_index 
)

Get the cell centroid of a face.

Get a coordinate of a specific face centroid.

Parameters
gridThe grid whose cell centroid we query.
face_indexThe index of the corresponding face.
gridThe grid.
face_indexThe index of the specific face.
coordinateThe coordinate index.

Referenced by tpfa_htrans_compute().

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.

Referenced by tpfa_htrans_compute().

int Opm::UgGridHelpers::faceTag ( const UnstructuredGrid grid,
boost::iterator_range< const int * >::const_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 as obtained from cell2Faces()
Returns
0, 1, 2, 3, 4, 5 for I-, I+, J-, J+, K-, K+
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 Opm::computeWDP(), Opm::estimateCellVelocity(), WellsManagerDetail::getCubeDim(), Opm::initStateBasic(), and tpfa_htrans_compute().

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.
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.

Referenced by Opm::thresholdPressures().

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 Opm::computeWDP(), Opm::estimateCellVelocity(), WellsManagerDetail::getCubeDim(), and tpfa_htrans_compute().

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
int Opm::UgGridHelpers::numCellFaces ( const UnstructuredGrid grid)

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

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

Get the number of cells of a grid.

Referenced by Opm::initStateEquil(), tpfa_eff_trans_compute(), tpfa_htrans_compute(), and tpfa_trans_compute().

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

Get the number of faces of a grid.

Referenced by Opm::thresholdPressures(), tpfa_eff_trans_compute(), and tpfa_trans_compute().

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.

Referenced by Opm::Equil::phasePressures().