From 14cc9d8735478b9ef1534534a75a2093376db388 Mon Sep 17 00:00:00 2001 From: wolf Date: Sun, 4 Oct 1998 19:35:54 +0000 Subject: [PATCH] Change the behaviour of the solver control object to *not* print the convergence history by default. git-svn-id: https://svn.dealii.org/trunk@612 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/solver_control.h | 24 +++++++++++++++++++----- deal.II/lac/source/solver_control.cc | 9 ++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/deal.II/lac/include/lac/solver_control.h b/deal.II/lac/include/lac/solver_control.h index 444f42b050..4dc8dc8b68 100644 --- a/deal.II/lac/include/lac/solver_control.h +++ b/deal.II/lac/include/lac/solver_control.h @@ -53,8 +53,17 @@ class SolverControl { * maximum number of iteration * steps before failure and the * tolerance to determine success - * of the iteration. */ - SolverControl (const unsigned int n, const double tol); + * of the iteration. + * + * #log_history# specifies whether + * the history (i.e. the value to + * be checked and the number of + * the iteration step) shall be + * printed to #deallog# stream. + * Default is: do not print. + */ + SolverControl (const unsigned int n, const double tol, + const bool log_history = false); /** * Decide about success or failure @@ -107,17 +116,22 @@ class SolverControl { /** * Prescribed tolerance to be achieved. */ - const double tol; + const double tol; /** * Last value of the convergence criterion. */ - double lvalue; + double lvalue; /** * Last step. */ - unsigned int lstep; + unsigned int lstep; + + /** + * Log convergence history to #deallog#? + */ + const bool log_history; }; diff --git a/deal.II/lac/source/solver_control.cc b/deal.II/lac/source/solver_control.cc index 603313e4f0..edd8592fe7 100644 --- a/deal.II/lac/source/solver_control.cc +++ b/deal.II/lac/source/solver_control.cc @@ -9,11 +9,13 @@ SolverControl::SolverControl (const unsigned int maxiter, - const double tolerance) : + const double tolerance, + const bool log_history) : maxsteps(maxiter), tol(tolerance), lvalue(1.e300), - lstep(0) + lstep(0), + log_history(log_history) {}; @@ -22,7 +24,8 @@ SolverControl::State SolverControl::check (const unsigned int step, const double check_value) { - deallog << "Check " << step << "\t" << check_value << endl; + if (log_history) + deallog << "Check " << step << "\t" << check_value << endl; lstep = step; lvalue = check_value; -- 2.39.5