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;