From 18dfe1783bac268dd57bbd9e62b06cf72c514eb0 Mon Sep 17 00:00:00 2001 From: Rohith Nair Date: Sun, 11 Jun 2017 22:32:46 +0200 Subject: [PATCH 1/3] remove debug info from terminal output for convergence failure --- .../timestepping/AdaptiveTimeStepping_impl.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp index 827e877cf..69034e06a 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp @@ -242,9 +242,21 @@ namespace Opm { OpmLog::note("Overall linear iterations used: " + std::to_string(substepReport.total_linear_iterations)); } } + catch (const Opm::TooManyIterations& e) { + substepReport += solver.failureReport(); + cause_of_failure = "Solver convergence failure - Iteration limit reached"; + + detail::logException(e, solver_verbose_); + // since linearIterations is < 0 this will restart the solver + } + catch (const Opm::LinearSolverProblem& e) { + substepReport += solver.failureReport(); + + detail::logException(e, solver_verbose_); + // since linearIterations is < 0 this will restart the solver + } catch (const Opm::NumericalProblem& e) { substepReport += solver.failureReport(); - cause_of_failure = e.what(); detail::logException(e, solver_verbose_); // since linearIterations is < 0 this will restart the solver @@ -357,7 +369,7 @@ namespace Opm { if( solver_verbose_ ) { std::string msg; msg = cause_of_failure + "\n Timestep chopped to " - + std::to_string(unit::convert::to( substepTimer.currentStepLength(), unit::day )) + " days.\n"; + + std::to_string(unit::convert::to( substepTimer.currentStepLength(), unit::day )) + " days\n"; OpmLog::problem(msg); } // reset states From 073e4ce8394d08cfd962909b4837a847911f240e Mon Sep 17 00:00:00 2001 From: Rohith Nair Date: Mon, 12 Jun 2017 10:28:38 +0200 Subject: [PATCH 2/3] Add cause_of_failure for LinearSolverProblem --- opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp index 69034e06a..f6125fc94 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp @@ -251,6 +251,7 @@ namespace Opm { } catch (const Opm::LinearSolverProblem& e) { substepReport += solver.failureReport(); + cause_of_failure = "Linear Solver convergence failure"; detail::logException(e, solver_verbose_); // since linearIterations is < 0 this will restart the solver From 2976b62d75ac8a9e4d18e2550bc612748c4e5204 Mon Sep 17 00:00:00 2001 From: Rohith Nair Date: Mon, 12 Jun 2017 10:48:07 +0200 Subject: [PATCH 3/3] Add cause_of_failure for NumericalProblem --- opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp index f6125fc94..0c3753a0e 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp @@ -258,6 +258,7 @@ namespace Opm { } catch (const Opm::NumericalProblem& e) { substepReport += solver.failureReport(); + cause_of_failure = "Solver convergence failure - Numerical problem encountered"; detail::logException(e, solver_verbose_); // since linearIterations is < 0 this will restart the solver