From 125c57346116e904e457a8cc68bdbe4f2299ab93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 24 May 2013 09:21:41 +0200 Subject: [PATCH] Added assert to guard against wrong usage. --- opm/core/simulator/BlackoilState.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opm/core/simulator/BlackoilState.hpp b/opm/core/simulator/BlackoilState.hpp index 153c2eed5..caf570e5c 100644 --- a/opm/core/simulator/BlackoilState.hpp +++ b/opm/core/simulator/BlackoilState.hpp @@ -22,6 +22,7 @@ #include #include +#include #include namespace Opm @@ -62,6 +63,7 @@ namespace Opm const int n = cells.size(); std::vector smin(num_phases_*n); std::vector smax(num_phases_*n); + ASSERT(n > 0); props.satRange(n, &cells[0], &smin[0], &smax[0]); const double* svals = (es == MinSat) ? &smin[0] : &smax[0]; for (int ci = 0; ci < n; ++ci) {