From 484cb0216fa06be4c3fb63b37d1e29c51623d9ad Mon Sep 17 00:00:00 2001 From: Fredrik Gundersen Date: Thu, 20 Aug 2015 13:00:01 +0200 Subject: [PATCH] Added suport for new Threshold Pressure behavior --- opm/simulators/thresholdPressures.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/opm/simulators/thresholdPressures.hpp b/opm/simulators/thresholdPressures.hpp index 51ec4a52a..9a308bca6 100644 --- a/opm/simulators/thresholdPressures.hpp +++ b/opm/simulators/thresholdPressures.hpp @@ -19,7 +19,7 @@ #include #include - +#include #ifndef OPM_THRESHOLDPRESSURES_HEADER_INCLUDED #define OPM_THRESHOLDPRESSURES_HEADER_INCLUDED @@ -46,10 +46,16 @@ namespace Opm template - std::vector thresholdPressures(EclipseStateConstPtr eclipseState, const Grid& grid) + std::vector thresholdPressures(const ParseMode& parseMode ,EclipseStateConstPtr eclipseState, const Grid& grid) { SimulationConfigConstPtr simulationConfig = eclipseState->getSimulationConfig(); - const std::vector& thresholdPressureTable = simulationConfig->getThresholdPressureTable(); + const std::vector& thresholdPressureTable; + if(simulationConfig->hasThresholdPressure()){ + thresholdPressureTable = simulationConfig->getThresholdPressureTable(); + }else{ + std::string msg = "Inferring threshold pressure from the initial state is not supported."; + parseMode.handleError( ParseMode::UNSUPPORTED_INITIAL_THPRES , msg ); + } std::vector thpres_vals;