]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Doc updates.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 May 1999 19:03:39 +0000 (19:03 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 May 1999 19:03:39 +0000 (19:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@1281 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/Todo
deal.II/lac/include/lac/solver.h
deal.II/lac/include/lac/solver_bicgstab.h
deal.II/lac/include/lac/solver_cg.h
deal.II/lac/include/lac/solver_gmres.h
deal.II/lac/include/lac/solver_richardson.h
deal.II/lac/include/lac/solver_selector.h

index c7155fdce9af6fdbe2f37e050645afb78212171b..21b97904c7539ab828126304a8d14a418fcab863 100644 (file)
@@ -26,4 +26,7 @@ Use memcpy in dSMatrix::copy_from instead of elementwise copying.
 
 
 Make ILU decomposition faster by following the comment in the
-  innermost loop (about the better use of the index j).
\ No newline at end of file
+  innermost loop (about the better use of the index j).
+
+Change in-class defined SolverSelector functions out-of-class to
+  conform to general style guide. (Ralf?)
\ No newline at end of file
index a7494f17a0147d9a77044cf97e5142356a839789..2b59d6ba477efa55d8ffff380999a22aa9a43934 100644 (file)
@@ -91,14 +91,16 @@ template <class Vector> class VectorMemory;
  * };
  * \end{verbatim}
  *
+ *
  * \subsection{AdditionalData}
+ *
  * Several solvers need additional data, like the damping parameter #omega# of the
- * #SolverRichardson# class or the maximum number of tmp vectors of the #SolverGMRES#.
+ * #SolverRichardson# class or the maximum number of temporary vectors of the #SolverGMRES#.
  * To have a standardized constructor for each solver class the #struct AdditionalData#
- * has been introduced to each solver class. Some solver needs no additional data, like
- * the SolverCG or SolverBicgstab. For these solvers the struct #AdditionalData# is empty
- * and the calling
- * of the constructor has not change as a default #AdditionalData# is set by default. 
+ * has been introduced to each solver class. Some solvers need no additional data, like
+ * #SolverCG# or #SolverBicgstab#. For these solvers the struct #AdditionalData# is empty
+ * and calling the constructor may be done without giving the additional structure as
+ * an argument as a default #AdditionalData# is set by default. 
  *
  * Now the generating of a solver looks like
  * \begin{verbatim}
@@ -113,6 +115,14 @@ template <class Vector> class VectorMemory;
  *                               // CG with default AdditionalData
  * SolverCG solver_cg (solver_control, vector_memory);
  * \end{verbatim}
+ *
+ * Using a unified constructor parameter list for all solvers was introduced when the
+ * #SolverSelector# class was written; the unified interface enabled us to use this
+ * class unchanged even if the number of types of parameters to a certain solver
+ * changes and it is still possible in a simple way to give these additional data to
+ * the #SolverSelector# object for each solver which it may use.
+ *
+ * @author Wolfgang Bangerth, Guido Kanschat, Ralf Hartmann, 1997, 1998, 1999
  */
 template <class Matrix, class Vector>
 class Solver
index eb9df13282da8ae581218cb4cf51c54b45bfa3bf..c5ebf62c0c7852a3fbe9e0f03e74d67bd2b2517a 100644 (file)
 /**
  * Bicgstab algorithm by van der Vorst.
  *
- * The use of the #AdditionalData# struct is described in the #solver#
- * base class.
+ * Like all other solver classes, this class has a local structure called
+ * #AdditionalData# which is used to pass additional parameters to the
+ * solver, like damping parameters or the number of temporary vectors. We
+ * use this additional structure instead of passing these values directly
+ * to the constructor because this makes the use of the #SolverSelector# and
+ * other classes much easier and guarantees that these will continue to
+ * work even if number or type of the additional parameters for a certain
+ * solver changes.
+ *
+ * However, since the BiCGStab method does not need additional data, the respective
+ * structure is empty and does not offer any functionality. The constructor
+ * has a default argument, so you may call it without the additional
+ * parameter.
  */
 template<class Matrix, class Vector>
 class SolverBicgstab //<Matrix,Vector>
index 94a3a3398b84524ea18fc52cc28f7e3d3a8220d4..22587969289d39ca857e8408b8dab512e772d8fe 100644 (file)
 
 /**
  * Preconditioned cg method.
- * @author Original implementation by G. Kanschat, R. Becker and F.-T. Suttmeier, reworking and  documentation by Wolfgang Bangerth
  *
- * The use of the #AdditionalData# struct is described in the #solver#
- * base class.
+ * Like all other solver classes, this class has a local structure called
+ * #AdditionalData# which is used to pass additional parameters to the
+ * solver, like damping parameters or the number of temporary vectors. We
+ * use this additional structure instead of passing these values directly
+ * to the constructor because this makes the use of the #SolverSelector# and
+ * other classes much easier and guarantees that these will continue to
+ * work even if number or type of the additional parameters for a certain
+ * solver changes.
+ *
+ * However, since the CG method does not need additional data, the respective
+ * structure is empty and does not offer any functionality. The constructor
+ * has a default argument, so you may call it without the additional
+ * parameter.
+ *
+ *
+ * @author Original implementation by G. Kanschat, R. Becker and F.-T. Suttmeier, reworking and  documentation by Wolfgang Bangerth
  */
 template<class Matrix, class Vector>
 class SolverCG : public Solver<Matrix,Vector>
index 869c45eb51b8a68ce4b88e261df481a7fc8a4d6e..32058f62bd96c9fe29e5491d3b604e7773536260 100644 (file)
  * computational speed against memory. One of the few other
  * possibilities is to use a good preconditioner.
  *
- * The use of the #AdditionalData# struct is described in the #solver#
- * base class.
+ * Like all other solver classes, this class has a local structure called
+ * #AdditionalData# which is used to pass additional parameters to the
+ * solver, like damping parameters or the number of temporary vectors. We
+ * use this additional structure instead of passing these values directly
+ * to the constructor because this makes the use of the #SolverSelector# and
+ * other classes much easier and guarantees that these will continue to
+ * work even if number or type of the additional parameters for a certain
+ * solver changes.
+ *
+ * For the GMRes method, the #AdditionalData# structure contains the number
+ * of temporary vectors as commented upon above. By default, the number
+ * of these vectors is set to 30.
  *
  * @author Wolfgang Bangerth
  */
@@ -61,8 +71,14 @@ class SolverGMRES : public Solver<Matrix, Vector>
                                      */
     struct AdditionalData 
     {
+                                        /**
+                                         * Constructor. By default,
+                                         * set the number of temporary
+                                         * vectors to 30.
+                                         */
        AdditionalData(const unsigned int max_n_tmp_vectors=30):
-                       max_n_tmp_vectors(max_n_tmp_vectors) {};
+                       max_n_tmp_vectors(max_n_tmp_vectors)
+         {};
        
                                         /**
                                          * Maximum number of
index e5ef9a9fcfa9d687acedc551c380c875af1e051a..36b1b13c5b6dc8533fb3aa05b09d57a64ca1600c 100644 (file)
  * Implementation of the richardson iteration method. The stopping criterion
  * is the norm of the residual.
  *
- * The use of the #AdditionalData# struct is described in the #solver#
- * base class.
+ * Like all other solver classes, this class has a local structure called
+ * #AdditionalData# which is used to pass additional parameters to the
+ * solver, like damping parameters or the number of temporary vectors. We
+ * use this additional structure instead of passing these values directly
+ * to the constructor because this makes the use of the #SolverSelector# and
+ * other classes much easier and guarantees that these will continue to
+ * work even if number or type of the additional parameters for a certain
+ * solver changes.
+ *
+ * For the Richardson method, the additional data is the damping parameter,
+ * which is the only content of the #AdditionalData# structure. By default,
+ * the constructor of the structure sets it to one.
  *
  * @author Ralf Hartmann
  */
@@ -32,8 +42,14 @@ class SolverRichardson : public Solver<Matrix, Vector>
                                      */
     struct AdditionalData 
     {
+                                        /**
+                                         * Constructor. By default,
+                                         * set the damping parameter
+                                         * to one.
+                                         */
        AdditionalData(double omega=1):
-                       omega(omega) {};
+                       omega(omega)
+         {};
        
                                         /**
                                          * Relaxation parameter.
index 04277123fd2fa250102412c4acfcae3cf8dd54ba..9d31ef82d8ca9086639378ce7717a1ac3a144dc8 100644 (file)
@@ -18,6 +18,8 @@
 #include <lac/solver_richardson.h>
 #include <lac/precondition.h>
 
+
+
 /**
  * By calling the #solve# function of this #SolverSelector#, it selects
  * the #solve# function of that #Solver# that was specified in the constructor
@@ -190,6 +192,7 @@ class SolverSelector
 };
 
 
+
 /* --------------------- Inline and template functions ------------------- */
 
 
@@ -199,12 +202,14 @@ SolverSelector<Matrix, Vector>::SolverSelector(string solver_name,
                                               VectorMemory<Vector> &vector_memory) :
                solver_name(solver_name),
                control(&control),
-               vector_memory(&vector_memory)  {}
+               vector_memory(&vector_memory)
+{};
+
+
 
-               
 template <class Matrix, class Vector>
 SolverSelector<Matrix, Vector>::~SolverSelector()
-{}
+{};
 
 
 
@@ -240,7 +245,7 @@ SolverSelector<Matrix, Vector>::solve(const Matrix &A,
     Assert(false,ExcSolverDoesNotExist(solver_name));
 
   return Solver<Matrix,Vector>::breakdown;
-}
+};
 
 
 
@@ -248,7 +253,7 @@ template <class Matrix, class Vector>
 string SolverSelector<Matrix, Vector>::get_solver_names()
 {
   return "richardson|cg|bicgstab|gmres";
-}
+};
 
 
 /*----------------------------   solver_selector.h     ---------------------------*/

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.