]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make parameter parsing more conforming to other classes
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 3 Jun 2014 04:58:51 +0000 (04:58 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 3 Jun 2014 04:58:51 +0000 (04:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@33008 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/algorithms/newton.h
deal.II/include/deal.II/algorithms/newton.templates.h
deal.II/include/deal.II/algorithms/operator.templates.h
deal.II/include/deal.II/algorithms/theta_timestepping.h
deal.II/include/deal.II/algorithms/theta_timestepping.templates.h

index c3bc9f4b9db772ae3cd050a0a0a9d9c6426d31dc..2d2e162feb02d698529db56ad2146bc566dd6617 100644 (file)
@@ -79,15 +79,19 @@ namespace Algorithms
     Newton (Operator<VECTOR> &residual, Operator<VECTOR> &inverse_derivative);
 
     /**
-     * Declare the parameters
-     * applicable to Newton's method.
+     * Declare the parameters applicable to Newton's method.
      */
-    void declare_parameters (ParameterHandler &param);
+    static void declare_parameters (ParameterHandler &param);
 
     /**
-     * Read the parameters.
+     * Read the parameters in the ParameterHandler.
      */
-    void initialize (ParameterHandler &param);
+    void parse_parameters (ParameterHandler &param);
+
+    /**
+     * @deprecated Use parse_parameters().
+     */
+    void initialize (ParameterHandler &param) DEAL_II_DEPRECATED;
 
     /**
      * Initialize the pointer
index c397fd22beb065965257a396ae2266a96db8a268..9e3d62466d316f11cf9775a4ef082fdd2309948a 100644 (file)
@@ -55,7 +55,7 @@ namespace Algorithms
 
   template <class VECTOR>
   void
-  Newton<VECTOR>::initialize (ParameterHandler &param)
+  Newton<VECTOR>::parse_parameters (ParameterHandler &param)
   {
     param.enter_subsection("Newton");
     control.parse_parameters (param);
@@ -65,6 +65,13 @@ namespace Algorithms
     param.leave_subsection ();
   }
 
+  template <class VECTOR>
+  void
+  Newton<VECTOR>::initialize (ParameterHandler &param)
+  {
+    parse_parameters(param);
+  }
+
   template <class VECTOR>
   void
   Newton<VECTOR>::initialize (OutputOperator<VECTOR> &output)
index db13a0009408f24e69a3a156a1738ddf1dbf6f96..0c1ee9d6cd5a9d9f2db4ce64960077a4e35c53a1 100644 (file)
@@ -131,7 +131,7 @@ namespace Algorithms
           {
             const VECTOR *v = vectors.try_read_ptr<VECTOR>(i);
             if (v == 0) continue;
-           deallog << vectors.name(i);
+            deallog << vectors.name(i);
             for (unsigned int j=0; j<v->size(); ++j)
               deallog << ' ' << (*v)(j);
             deallog << std::endl;
index 492af1cee1d0971c1825a20bc2156540f0ffaa85..ff6262cbab98237a9e9597d9763e9ccf541e80d9 100644 (file)
@@ -240,8 +240,20 @@ namespace Algorithms
      */
     void set_output(OutputOperator<VECTOR> &output);
 
-    void declare_parameters (ParameterHandler &param);
-    void initialize (ParameterHandler &param);
+    /**
+     * Declare parameters in a parameter handler.
+     */
+    static void declare_parameters (ParameterHandler &param);
+
+    /**
+     * Read the parameters in the ParameterHandler.
+     */
+    void parse_parameters (ParameterHandler &param);
+
+    /**
+     * @deprecated Use parse_parameters().
+     */
+    void initialize (ParameterHandler &param) DEAL_II_DEPRECATED;
     /**
      * The current time in the
      * timestepping scheme.
@@ -256,9 +268,9 @@ namespace Algorithms
      */
     double theta() const;
 
-      /**
-       * Set a new weight and return the old
-       */
+    /**
+     * Set a new weight and return the old
+     */
     double theta(double new_theta);
 
     /**
@@ -401,7 +413,7 @@ namespace Algorithms
   double ThetaTimestepping<VECTOR>::current_time () const
   {
     return control.now();
-  }  
+  }
 }
 
 DEAL_II_NAMESPACE_CLOSE
index 78d92783bf71e6cd2f5b4bff25748191d0fbfcb9..a3402f6dd020ad8bb3d88008d5aa4fff39d22e9a 100644 (file)
@@ -51,7 +51,7 @@ namespace Algorithms
 
   template <class VECTOR>
   void
-  ThetaTimestepping<VECTOR>::initialize (ParameterHandler &param)
+  ThetaTimestepping<VECTOR>::parse_parameters (ParameterHandler &param)
   {
     param.enter_subsection("ThetaTimestepping");
     control.parse_parameters (param);
@@ -61,6 +61,14 @@ namespace Algorithms
   }
 
 
+  template <class VECTOR>
+  void
+  ThetaTimestepping<VECTOR>::initialize (ParameterHandler &param)
+  {
+    parse_parameters(param);
+  }
+
+
   template <class VECTOR>
   void
   ThetaTimestepping<VECTOR>::operator() (NamedData<VECTOR *> &out, const NamedData<VECTOR *> &in)

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.