]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change the behaviour of the solver control object to *not* print the convergence...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 4 Oct 1998 19:35:54 +0000 (19:35 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 4 Oct 1998 19:35:54 +0000 (19:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@612 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/solver_control.h
deal.II/lac/source/solver_control.cc

index 444f42b050ed716345b82fc5badb9c6f911dd4ac..4dc8dc8b68ce5384299c34db2934d23f928efcbd 100644 (file)
@@ -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;
 };
 
 
index 603313e4f0e8ae5495027f82d7db03b5c9eabcfc..edd8592fe7d7db62310943dd6ece2a99e56cf410 100644 (file)
@@ -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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.