]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix leading underscores as nobody else seems to have an interest in doing it...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 Aug 2001 09:02:46 +0000 (09:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 Aug 2001 09:02:46 +0000 (09:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@4877 0785d39b-7218-0410-832d-ea1e28bc413d

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

index c7b5d0de4b1bc5859381edcd3a63b8f3b59b2e9e..d2704dcf443d87fa6fe65603a96ae82e6fd98673 100644 (file)
@@ -130,10 +130,10 @@ class SolverControl : public Subscriptor
                                      * logged to @p{deallog}. Default
                                      * is yes.
                                      */
-    SolverControl (const unsigned int n = 100,
-                  const double tol = 1.e-10,
-                  const bool log_history = false,
-                  const bool log_result = true);
+    SolverControl (const unsigned int n           = 100,
+                  const double       tol         = 1.e-10,
+                  const bool         log_history = false,
+                  const bool         log_result  = true);
     
                                     /**
                                      * Virtual destructor is needed
@@ -197,7 +197,7 @@ class SolverControl : public Subscriptor
                                      * other computations.
                                      */
     virtual State check (const unsigned int step,
-                        const double check_value);
+                        const double   check_value);
 
                                     /**
                                      * Return the result of the last check operation.
@@ -290,24 +290,24 @@ class SolverControl : public Subscriptor
                                     /**
                                      * Result of last check operation.
                                      */
-    State lcheck;
+    State        lcheck;
     
                                     /**
                                      * Last value of the convergence criterion.
                                      */
-    double             lvalue;
+    double       lvalue;
     
                                     /**
                                      * Last step.
                                      */
-    unsigned int       lstep;
+    unsigned int lstep;
 
                                     /**
                                      * Is set to @p{true} by
                                      * @p{set_failure_criterion} and
                                      * enables failure checking.
                                      */
-    bool check_failure;
+    bool         check_failure;
 
                                     /*
                                      * Stores the
@@ -332,13 +332,11 @@ class SolverControl : public Subscriptor
                                      * Log convergence history to
                                      * @p{deallog}.
                                      */
-//TODO:[GK] leading underscores are prohibited by the C++ standard in user code. what is the reason here anyway?
-    bool         _log_history;
+    bool         m_log_history;
                                     /**
                                      * Log only every nth step.
                                      */
-//TODO:[GK] leading underscores are prohibited by the C++ standard in user code. what is the reason here anyway?
-    unsigned int _log_frequency;
+    unsigned int m_log_frequency;
     
                                     /**
                                      * Log iteration result to
@@ -348,8 +346,7 @@ class SolverControl : public Subscriptor
                                      * success together with @p{lstep}
                                      * and @p{lvalue} are logged.
                                      */
-//TODO:[GK] leading underscores are prohibited by the C++ standard in user code. what is the reason here anyway?
-    bool         _log_result;
+    bool         m_log_result;
 };
 
 
@@ -375,10 +372,10 @@ class ReductionControl : public SolverControl
                                      * constructor.
                                      */
     ReductionControl (const unsigned int maxiter = 100,
-                     const double tolerance = 1.e-10,
-                     const double reduce = 1.e-2,
-                     const bool log_history = false,
-                     const bool log_result = true);
+                     const double   tolerance   = 1.e-10,
+                     const double   reduce      = 1.e-2,
+                     const bool     log_history = false,
+                     const bool     log_result  = true);
 
                                     /**
                                      * Virtual destructor is needed
@@ -406,7 +403,7 @@ class ReductionControl : public SolverControl
                                      * upon the first iteration.
                                      */
     virtual State check (const unsigned int step,
-                        const double check_value);
+                        const double   check_value);
 
                                     /**
                                      * Return the initial convergence
@@ -424,7 +421,7 @@ class ReductionControl : public SolverControl
                                      */
     double set_reduction (const double);
 
-protected:
+  protected:
                                     /**
                                      * Desired reduction factor.
                                      */
@@ -454,6 +451,7 @@ SolverControl::max_steps () const
 }
 
 
+
 inline unsigned int
 SolverControl::set_max_steps (const unsigned int newval)
 {
@@ -463,6 +461,7 @@ SolverControl::set_max_steps (const unsigned int newval)
 }
 
 
+
 inline void
 SolverControl::set_failure_criterion (const double rel_failure_residual)
 {
@@ -471,6 +470,7 @@ SolverControl::set_failure_criterion (const double rel_failure_residual)
 }
 
 
+
 inline void
 SolverControl::clear_failure_criterion ()
 {
@@ -480,6 +480,7 @@ SolverControl::clear_failure_criterion ()
 }
 
 
+
 inline double
 SolverControl::tolerance () const
 {
@@ -487,6 +488,7 @@ SolverControl::tolerance () const
 }
 
 
+
 inline double
 SolverControl::set_tolerance (const double t)
 {
@@ -499,14 +501,15 @@ SolverControl::set_tolerance (const double t)
 inline void
 SolverControl::log_history (const bool newval)
 {
-  _log_history = newval;
+  m_log_history = newval;
 }
 
 
+
 inline bool
 SolverControl::log_history () const
 {
-  return _log_history;
+  return m_log_history;
 }
 
 
@@ -514,10 +517,11 @@ SolverControl::log_history () const
 inline void
 SolverControl::log_result (const bool newval)
 {
-  _log_result = newval;
+  m_log_result = newval;
 }
 
 
+
 inline double
 ReductionControl::reduction () const
 {
@@ -525,6 +529,7 @@ ReductionControl::reduction () const
 }
 
 
+
 inline double
 ReductionControl::set_reduction (const double t)
 {
index 9894feaa8b3dffd58004d53ba1e58def59835829..828febbd7982c44657ca53712e217c56d7b8b64b 100644 (file)
@@ -60,8 +60,8 @@ SolverControl::NoConvergence::what () const throw ()
 
 SolverControl::SolverControl (const unsigned int maxiter,
                              const double tolerance,
-                             const bool _log_history,
-                             const bool _log_result)
+                             const bool m_log_history,
+                             const bool m_log_result)
                :
                maxsteps(maxiter),
                tol(tolerance),
@@ -70,9 +70,9 @@ SolverControl::SolverControl (const unsigned int maxiter,
                check_failure(false),
                relative_failure_residual(0),
                failure_residual(0),
-               _log_history(_log_history),
-               _log_frequency(1),
-               _log_result(_log_result)
+               m_log_history(m_log_history),
+               m_log_frequency(1),
+               m_log_result(m_log_result)
 {};
 
 
@@ -86,7 +86,7 @@ SolverControl::State
 SolverControl::check (const unsigned int step,
                      const double check_value)
 {
-  if (_log_history && ((step % _log_frequency) == 0))
+  if (m_log_history && ((step % m_log_frequency) == 0))
     deallog << "Check " << step << "\t" << check_value << std::endl;
   
   lstep  = step;
@@ -97,7 +97,7 @@ SolverControl::check (const unsigned int step,
       if (check_failure)
        failure_residual=relative_failure_residual*check_value;
       
-      if (_log_result)
+      if (m_log_result)
        deallog << "Starting value " << check_value << std::endl;
     }
 
@@ -115,7 +115,7 @@ SolverControl::check (const unsigned int step,
       (check_failure && (check_value > failure_residual))
   )
     {
-      if (_log_result)
+      if (m_log_result)
        deallog << "Failure step " << step
                << " value " << check_value << std::endl;
       lcheck = failure;
@@ -124,7 +124,7 @@ SolverControl::check (const unsigned int step,
 
   if (check_value <= tol)
     {
-      if (_log_result)
+      if (m_log_result)
        deallog << "Convergence step " << step
                << " value " << check_value << std::endl;
       lcheck = success;
@@ -162,8 +162,8 @@ SolverControl::log_frequency (unsigned int f)
 {
   if (f==0)
     f = 1;
-  unsigned int old = _log_frequency;
-  _log_frequency = f;
+  unsigned int old = m_log_frequency;
+  m_log_frequency = f;
   return old;
 }
 
@@ -194,10 +194,10 @@ void SolverControl::parse_parameters (ParameterHandler& param)
 ReductionControl::ReductionControl(const unsigned int n,
                                   const double tol,
                                   const double red,
-                                  const bool _log_history,
-                                  const bool _log_result)
+                                  const bool m_log_history,
+                                  const bool m_log_result)
                :
-               SolverControl (n, tol, _log_history, _log_result),
+               SolverControl (n, tol, m_log_history, m_log_result),
                reduce(red)
 {};
 
@@ -231,7 +231,7 @@ ReductionControl::check (const unsigned int step,
                                   // residual already was zero
   if (check_value <= reduced_tol)
     {
-      if (_log_result)
+      if (m_log_result)
        deallog << "Convergence step " << step
                << " value " << check_value << std::endl;
       lcheck = success;

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.