From 9f69e9fa51ba7a2c8c411d700a0ca1d48a931eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 24 Sep 2012 17:09:50 +0200 Subject: [PATCH] Guard against input error. If no valid threephase_model is input, throw instead of crashing. --- opm/core/fluid/BlackoilPropertiesFromDeck.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opm/core/fluid/BlackoilPropertiesFromDeck.cpp b/opm/core/fluid/BlackoilPropertiesFromDeck.cpp index 78e3c5db2..271f93951 100644 --- a/opm/core/fluid/BlackoilPropertiesFromDeck.cpp +++ b/opm/core/fluid/BlackoilPropertiesFromDeck.cpp @@ -66,6 +66,8 @@ namespace Opm = new SaturationPropsFromDeck(); satprops_.reset(ptr); ptr->init(deck, grid, sat_samples); + } else { + THROW("Unknown threephase_model: " << threephase_model); } } else { if (threephase_model == "stone2") { @@ -83,6 +85,8 @@ namespace Opm = new SaturationPropsFromDeck(); satprops_.reset(ptr); ptr->init(deck, grid, sat_samples); + } else { + THROW("Unknown threephase_model: " << threephase_model); } }