From 2b610dfce759f45f560d0ec7556aa6930a81ace6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 22 Aug 2012 11:40:13 +0200 Subject: [PATCH] Assert that all cells are in range. This will (hopefully) prevent the issues fixed in commits aaae8e1 and 462c7cf from reoccurring. --- opm/core/grid/cpgpreprocess/preprocess.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opm/core/grid/cpgpreprocess/preprocess.c b/opm/core/grid/cpgpreprocess/preprocess.c index 84e9e8fe..dc274160 100644 --- a/opm/core/grid/cpgpreprocess/preprocess.c +++ b/opm/core/grid/cpgpreprocess/preprocess.c @@ -590,6 +590,9 @@ get_zcorn_sign(int nx, int ny, int nz, const int *actnum, c1 = i/2 + nx*(j/2 + ny*(k/2)); c2 = i/2 + nx*(j/2 + ny*((k+1)/2)); + assert (c1 < (nx * ny * nz)); + assert (c2 < (nx * ny * nz)); + if (((actnum == NULL) || (actnum[c1] && actnum[c2])) && (z2 < z1)) {