From 842667eab2889db0d920481d82154b307d76a551 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Fri, 21 Feb 2014 11:50:36 +0100 Subject: [PATCH] Added free method to get the sum of the the faces that are attached to every cell. --- opm/core/grid/GridHelpers.cpp | 5 +++++ opm/core/grid/GridHelpers.hpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/opm/core/grid/GridHelpers.cpp b/opm/core/grid/GridHelpers.cpp index a7339054..d90a7ade 100644 --- a/opm/core/grid/GridHelpers.cpp +++ b/opm/core/grid/GridHelpers.cpp @@ -17,6 +17,11 @@ int dimensions(const UnstructuredGrid& grid) { return grid.dimensions; } +int numCellFaces(const UnstructuredGrid& grid) +{ + return grid.cell_facepos[grid.number_of_cells]; +} + const int* globalCell(const UnstructuredGrid& grid) { return grid.global_cell; diff --git a/opm/core/grid/GridHelpers.hpp b/opm/core/grid/GridHelpers.hpp index 939275ba..ad3fa563 100644 --- a/opm/core/grid/GridHelpers.hpp +++ b/opm/core/grid/GridHelpers.hpp @@ -100,6 +100,9 @@ int numFaces(const UnstructuredGrid& grid); /// \brief Get the dimensions of a grid int dimensions(const UnstructuredGrid& grid); +/// \brief Get the number of faces, where each face counts as many times as there are adjacent faces +int numCellFaces(const UnstructuredGrid& grid); + /// \brief Get the cartesion dimension of the underlying structured grid. const int* cartDims(const UnstructuredGrid& grid);