From 40d851e89f9b3011a8014a9146e9a63fc5d66b30 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/simulators/timestepping/AdaptiveTimeStepping_impl.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp index 3b6bac86e..0d330dc7c 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp +++ b/opm/simulators/timestepping/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 )