From f8e61c0267db892aec33956846abbdea6f400311 Mon Sep 17 00:00:00 2001 From: Robert Kloefkorn Date: Tue, 14 Oct 2014 15:18:36 +0200 Subject: [PATCH] also catch std::runtime_error, i.e. convergence of linear solver failed. --- opm/core/simulator/AdaptiveTimeStepping_impl.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opm/core/simulator/AdaptiveTimeStepping_impl.hpp b/opm/core/simulator/AdaptiveTimeStepping_impl.hpp index 3b6bac86..0d330dc7 100644 --- a/opm/core/simulator/AdaptiveTimeStepping_impl.hpp +++ b/opm/core/simulator/AdaptiveTimeStepping_impl.hpp @@ -76,10 +76,14 @@ namespace Opm { std::cout << "Overall linear iterations used: " << linearIterations << std::endl; } } - catch (Opm::NumericalProblem) - { + catch (Opm::NumericalProblem e) { + std::cerr << e.what() << std::endl; // since linearIterations is < 0 this will restart the solver } + catch (std::runtime_error e) { + std::cerr << e.what() << std::endl; + // also catch linear solver not converged + } // (linearIterations < 0 means on convergence in solver) if( linearIterations >= 0 )