From 565fa4278eb11a675e80961a3f3e6dca583c8e6e Mon Sep 17 00:00:00 2001 From: osae Date: Thu, 10 Sep 2015 18:23:00 +0200 Subject: [PATCH] Add some comments and limit to 3 dimensions. --- opm/core/grid/GridHelpers.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/opm/core/grid/GridHelpers.cpp b/opm/core/grid/GridHelpers.cpp index 03528a18..afbaf9b4 100644 --- a/opm/core/grid/GridHelpers.cpp +++ b/opm/core/grid/GridHelpers.cpp @@ -59,13 +59,22 @@ const double* beginCellCentroids(const UnstructuredGrid& grid) double cellCenterDepth(const UnstructuredGrid& grid, int cell_index) { + // This method is an alternative to the method cellCentroidCoordinate(...) below. + // The cell center depth is computed as a raw average of cell corner depths. + // For cornerpoint grids, this is likely to give slightly different depths that seem + // to agree with eclipse. + assert(grid.dimensions == 3); + const int nd = 3; // Assuming 3-dimensional grid ... + const int nv = 8; // Assuming 2*4 vertices ... double zz = 0.0; + // Traverse the bottom and top cell-face for (int i=grid.cell_facepos[cell_index+1]-2; i