diff --git a/opm/core/grid/GridHelpers.cpp b/opm/core/grid/GridHelpers.cpp index 2371aeff..40ac5b57 100644 --- a/opm/core/grid/GridHelpers.cpp +++ b/opm/core/grid/GridHelpers.cpp @@ -63,6 +63,12 @@ double faceArea(const UnstructuredGrid& grid, int face_index) return grid.face_areas[face_index]; } +int faceTag(const UnstructuredGrid& grid, + boost::iterator_range::const_iterator face) +{ + return grid.cell_facetag[face-cell2Faces(grid)[0].begin()]; +} + SparseTableView cell2Faces(const UnstructuredGrid& grid) { return SparseTableView(grid.cell_faces, grid.cell_facepos, numCells(grid)); diff --git a/opm/core/grid/GridHelpers.hpp b/opm/core/grid/GridHelpers.hpp index cba87232..f7ff2c85 100644 --- a/opm/core/grid/GridHelpers.hpp +++ b/opm/core/grid/GridHelpers.hpp @@ -181,6 +181,12 @@ const double* faceNormal(const UnstructuredGrid& grid, int face_index); /// \param face_index The index of the face in the grid. double faceArea(const UnstructuredGrid& grid, int face_index); +/// \brief Get Eclipse Cartesian tag of a face +/// \param grid The grid that the face is part of. +/// \param cell_face The face attached to a cell as obtained from cell2Faces() +/// \return 0, 1, 2, 3, 4, 5 for I-, I+, J-, J+, K-, K+ +int faceTag(const UnstructuredGrid& grid, boost::iterator_range::const_iterator cell_face); + /// \brief Maps the grid type to the associated type of the cell to faces mapping. /// /// Provides a type named Type.