From 12032203b3c63138d34dab4b4591fccdb9e4cb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 7 Aug 2019 12:03:43 +0200 Subject: [PATCH] Improve out-of-range check for extra components. --- ebos/ecloutputblackoilmodule.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index f4bcf0640..32e679558 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -1146,7 +1146,7 @@ public: Scalar getSolventSaturation(unsigned elemIdx) const { - if (sSol_.size() > 0) + if (sSol_.size() > elemIdx) return sSol_[elemIdx]; return 0; @@ -1154,7 +1154,7 @@ public: Scalar getPolymerConcentration(unsigned elemIdx) const { - if (cPolymer_.size() > 0) + if (cPolymer_.size() > elemIdx) return cPolymer_[elemIdx]; return 0; @@ -1162,7 +1162,7 @@ public: Scalar getFoamConcentration(unsigned elemIdx) const { - if (cFoam_.size() > 0) + if (cFoam_.size() > elemIdx) return cFoam_[elemIdx]; return 0;