]> https://gitweb.dealii.org/ - dealii.git/commitdiff
print coefficients for post-processing
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 5 Feb 2001 09:57:59 +0000 (09:57 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 5 Feb 2001 09:57:59 +0000 (09:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@3854 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/solver_bicgstab.h
deal.II/lac/include/lac/solver_cg.h

index 1335bb297e870b35d1cd15f3d5170c9a6885e370..98b6c475a23b17ee29edaee0688eb23b2c009d25 100644 (file)
@@ -197,7 +197,7 @@ class SolverBicgstab : public Subscriptor, private Solver<VECTOR>
     double res;
 
                                     /**
-                                     * Additional parameters..
+                                     * Additional parameters.
                                      */
     AdditionalData additional_data;
   
index 1ddb2ca00d2171240c140ed5cfeba7cfc303c3c7..577da83699836dc873de2b556dd72994087ed109 100644 (file)
@@ -51,11 +51,24 @@ class SolverCG : public Subscriptor, private Solver<VECTOR>
                                     /**
                                      * Standardized data struct to
                                      * pipe additional data to the
-                                     * solver. This solver does not
-                                     * need additional data yet.
+                                     * solver.
                                      */
     struct AdditionalData
     {
+                                      /**
+                                       * Write coefficients alpha and
+                                       * beta to the log file for later use.
+                                       */
+      bool log_coefficients;
+
+                                      /**
+                                       * Constructor. Initialize data fields.
+                                       * Confer the description of those.
+                                       */
+      AdditionalData (bool log_coefficients = false)
+       :
+       log_coefficients (log_coefficients)
+       {}
     };
 
                                     /**
@@ -125,6 +138,11 @@ class SolverCG : public Subscriptor, private Solver<VECTOR>
                                      * the square root of the @p{res2} value.
                                      */
     double res2;
+
+                                    /**
+                                     * Additional parameters.
+                                     */
+    AdditionalData additional_data;
 };
 
 
@@ -134,9 +152,10 @@ class SolverCG : public Subscriptor, private Solver<VECTOR>
 template<class VECTOR>
 SolverCG<VECTOR>::SolverCG(SolverControl &cn,
                           VectorMemory<VECTOR> &mem,
-                          const AdditionalData &)
+                          const AdditionalData &data)
                :
-               Solver<VECTOR>(cn,mem)
+  Solver<VECTOR>(cn,mem),
+  additional_data(data)
 {}
 
 
@@ -236,6 +255,9 @@ SolverCG<VECTOR>::solve (const MATRIX &A,
 
       print_vectors(it, x, g, d);
       
+      if (additional_data.log_coefficients)
+       deallog << "alpha-beta:" << alpha << '\t' << beta << endl;
+      
       conv = control().check(it,res);
       if (conv)
        break;

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.