diff --git a/opm/simulators/linalg/ISTLSolver.hpp b/opm/simulators/linalg/ISTLSolver.hpp index 053a6fbc6..e118fb647 100644 --- a/opm/simulators/linalg/ISTLSolver.hpp +++ b/opm/simulators/linalg/ISTLSolver.hpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -377,10 +378,11 @@ std::unique_ptr blockJacobiAdjacency(const Grid& grid, void prepare(const Matrix& M, Vector& b) { OPM_TIMEBLOCK(istlSolverPrepare); + try { + initPrepare(M,b); - initPrepare(M,b); - - prepareFlexibleSolver(); + prepareFlexibleSolver(); + } OPM_CATCH_AND_RETHROW_AS_CRITICAL_ERROR("This is likely due to a faulty linear solver JSON specification. Check for errors related to missing nodes."); }