]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
access inital_value als in SolverControl
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 28 Apr 2005 18:34:12 +0000 (18:34 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 28 Apr 2005 18:34:12 +0000 (18:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@10586 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 9f063bd29b29a0562ed2e6198e5f22c34b427a84..fce9ee7fd1e2116f834ff596e0dd67bd0577f52d 100644 (file)
@@ -209,6 +209,12 @@ class SolverControl : public Subscriptor
                                      */
     State last_check() const;
     
+                                    /**
+                                     * Return the initial convergence
+                                     * criterion.
+                                     */
+    double initial_value() const;
+
                                     /**
                                      * Return the convergence value of last
                                      * iteration step for which @p check was
@@ -302,6 +308,11 @@ class SolverControl : public Subscriptor
                                      */
     State        lcheck;
     
+                                    /**
+                                     * Initial value.
+                                     */
+    double initial_val;
+    
                                     /**
                                      * Last value of the convergence criterion.
                                      */
@@ -414,12 +425,6 @@ class ReductionControl : public SolverControl
     virtual State check (const unsigned int step,
                         const double   check_value);
 
-                                    /**
-                                     * Return the initial convergence
-                                     * criterion.
-                                     */
-    double initial_value() const;
-
                                     /**
                                      * Reduction factor.
                                      */
@@ -436,11 +441,6 @@ class ReductionControl : public SolverControl
                                      */
     double reduce;
     
-                                    /**
-                                     * Initial value.
-                                     */
-    double initial_val;
-    
                                     /**
                                      * Reduced tolerance. Stop iterations
                                      * if either this value is achieved
index c8166f0f9886ae5daa9cf0c1520b7019d2e28e58..5e3822e4181ac0191fe9c3fbaf2b822f0428db5f 100644 (file)
@@ -98,6 +98,12 @@ SolverControl::State
 SolverControl::check (const unsigned int step,
                      const double check_value)
 {
+                                  // if this is the first time we
+                                  // come here, then store the
+                                  // residual for later comparisons
+  if (step==0)
+    initial_val = check_value;
+
   if (m_log_history && ((step % m_log_frequency) == 0))
     deallog << "Check " << step << "\t" << check_value << std::endl;
   
@@ -155,6 +161,13 @@ SolverControl::last_check() const
 }
 
 
+double
+SolverControl::initial_value() const
+{
+  return initial_val;
+}
+
+
 double
 SolverControl::last_value() const
 {
@@ -218,12 +231,6 @@ ReductionControl::~ReductionControl()
 {}
 
 
-double
-ReductionControl::initial_value() const {
-  return initial_val;
-}
-
-
 SolverControl::State
 ReductionControl::check (const unsigned int step,
                         const double 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.