]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Doc updates.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 18 Jul 1999 21:22:26 +0000 (21:22 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 18 Jul 1999 21:22:26 +0000 (21:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@1590 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_base.h
deal.II/lac/include/lac/mgbase.h
deal.II/lac/include/lac/precondition.h

index 5b4bdeff1a387dea60b36d2a3c2855b42dff3df7..1a5d7134433fb8da3399d319ad44ec078a69e19e 100644 (file)
@@ -38,8 +38,9 @@ class MGCoarseGridSolver : public Subscriptor
                                      * about the matrix is removed to
                                      * that class.
                                      */
-    virtual void operator() (unsigned int level, Vector<double>& dst,
-                            const Vector<double>& src) const = 0;
+    virtual void operator() (const unsigned int    level,
+                            Vector<double>       &dst,
+                            const Vector<double> &src) const = 0;
 };
 
 
@@ -70,7 +71,7 @@ class MGSmootherBase :  public Subscriptor
                                      * or another function doing similar
                                      * things.
                                      */
-    virtual void smooth (const unsigned int   level,
+    virtual void smooth (const unsigned int    level,
                         Vector<double>       &u,
                         const Vector<double> &rhs) const = 0;
 
index a85402cc0ced3e7abdac4ad32ad48f9b7ae7753b..d1fd1fe0c3a9c9ff90f06c8aa950fe14a3800155 100644 (file)
@@ -38,8 +38,9 @@ class MGCoarseGridSolver : public Subscriptor
                                      * about the matrix is removed to
                                      * that class.
                                      */
-    virtual void operator() (unsigned int level, Vector<double>& dst,
-                            const Vector<double>& src) const = 0;
+    virtual void operator() (const unsigned int    level,
+                            Vector<double>       &dst,
+                            const Vector<double> &src) const = 0;
 };
 
 
@@ -70,7 +71,7 @@ class MGSmootherBase :  public Subscriptor
                                      * or another function doing similar
                                      * things.
                                      */
-    virtual void smooth (const unsigned int   level,
+    virtual void smooth (const unsigned int    level,
                         Vector<double>       &u,
                         const Vector<double> &rhs) const = 0;
 
index c397076d9577933fe82cb519e0ede2bc83a8adf6..13ba73558b7b31e3dd396cc4170b1ee71890e3f9 100644 (file)
@@ -24,6 +24,8 @@ class PreconditionIdentity
 };
 
 
+
+
 /**
  * Preconditioner using a matrix-builtin function.
  * This class forms a preconditioner suitable for the LAC solver
@@ -35,9 +37,28 @@ class PreconditionIdentity
  *
  * It seems that all builtin preconditioners have a relaxation
  * parameter, so please use #PreconditionRelaxation# for these.
- * @author Guido Kanschat, 1999
- */ 
-
+ *
+ * \subsection{Use}
+ * You will usually not want to create a named object of this type,
+ * although possible. The most common use is like this:
+ * \begin{verbatim}
+ *    SolverGMRES<SparseMatrix<double>,
+ *                Vector<double> >      gmres(control,memory,500);
+ *
+ *    gmres.solve (matrix, solution, right_hand_side,
+ *                PreconditionUseMatrix<SparseMatrix<double>,Vector<double> >
+ *                (matrix,&SparseMatrix<double>::template precondition_Jacobi));
+ * \end{verbatim}
+ * This creates an unnamed object to be passed as the fourth parameter to
+ * the solver function of the #SolverGMRES# class. It assumes that the
+ * #SparseMatrix# class has a function #precondition_Jacobi# taking two
+ * vectors (source and destination) as parameters. (Actually, there is no
+ * function like that, the existing function takes a third parameter,
+ * denoting the relaxation parameter; this example is therefore only meant to
+ * illustrate the general idea.)
+ *
+ * @author Guido Kanschat, Wolfgang Bangerth, 1999
+ */
 template<class MATRIX, class VECTOR>
 class PreconditionUseMatrix
 {
@@ -57,18 +78,24 @@ class PreconditionUseMatrix
                                      * must be a member function of
                                      * that matrix.
                                      */
-    PreconditionUseMatrix(const MATRIX & M, function_ptr method);
+    PreconditionUseMatrix(const MATRIX      &M,
+                         const function_ptr method);
     
                                     /**
-                                     * Execute preconditioning.
+                                     * Execute preconditioning. Calls the
+                                     * function passed to the constructor
+                                     * of this object with the two
+                                     * arguments given here.
                                      */
-    void operator() (VECTOR&, const VECTOR&) const;
+    void operator() (VECTOR       &dst,
+                    const VECTOR &src) const;
 
   private:
                                     /**
                                      * Pointer to the matrix in use.
                                      */
     const MATRIX& matrix;
+    
                                     /**
                                      * Pointer to the preconditioning
                                      * function.
@@ -76,14 +103,33 @@ class PreconditionUseMatrix
     const function_ptr precondition;
 };
 
+
+
 /**
  * Preconditioner for builtin relaxation methods.
- * Application of this preconditioner involves
+ * Application of this preconditioner includes
  * use of the #precondition_...# methods of #SparseMatrix#.
  *
- * Construction of objects of this class is quite strange, so read the
- * documentation of the constructor for an example.
- * @author Guido Kanschat, 1999
+ * \subsection{Use}
+ * You will usually not want to create a named object of this type,
+ * although possible. The most common use is like this:
+ * \begin{verbatim}
+ *    SolverGMRES<SparseMatrix<double>,
+ *                Vector<double> >      gmres(control,memory,500);
+ *
+ *    gmres.solve (matrix, solution, right_hand_side,
+ *                PreconditionRelaxation<SparseMatrix<double>,Vector<double> >
+ *                (matrix,&SparseMatrix<double>::template precondition_Jacobi,
+ *                   0.5));
+ * \end{verbatim}
+ * This creates an unnamed object to be passed as the fourth parameter to
+ * the solver function of the #SolverGMRES# class. It assumes that the
+ * #SparseMatrix# class has a function #precondition_Jacobi# taking two
+ * vectors (source and destination) and a relaxation value as parameters. (Unlike
+ * for the #PreconditionUseMatrix# class, this time it should work, with
+ * relaxation parameter $0.5$.)
+ *
+ * @author Guido Kanschat, Wolfgang Bangerth, 1999
  */
 template<class MATRIX, class VECTOR>
 class PreconditionRelaxation
@@ -103,21 +149,19 @@ class PreconditionRelaxation
                                      * for later use and selects a
                                      * preconditioning method, which
                                      * must be a member function of
-                                     * that matrix. An example of a
-                                     * typical usage is this:
-       * \begin{verbatim}
-       * SparseMatrix<float> A;
-       * Vector<double> u;
-       * PreconditioningRelaxation<SparseMatrix<float>,Vector<double> >
-       *    precondition_ssor(A, &SparseMatrix<float>::template
-       *       precondition_SSOR<double>, 1.2);
-       * \end{verbatim}
-       */
-    PreconditionRelaxation(const MATRIX & M, function_ptr method,
-                          double omega = 1.);
+                                     * that matrix.
+                                     */
+    PreconditionRelaxation(const MATRIX      &M,
+                          const function_ptr method,
+                          const double       omega = 1.);
     
                                     /**
-                                     * Execute preconditioning.
+                                     * Execute preconditioning. Calls the
+                                     * function passed to the constructor
+                                     * of this object with the two
+                                     * arguments given here, and the
+                                     * relaxation parameter passed to the
+                                     * constructor.
                                      */
     void operator() (VECTOR&, const VECTOR&) const;
 
@@ -126,11 +170,13 @@ class PreconditionRelaxation
                                      * Pointer to the matrix in use.
                                      */
     const MATRIX& matrix;
+    
                                     /**
                                      * Pointer to the preconditioning
                                      * function.
                                      */
     const function_ptr precondition;
+    
                                     /**
                                      * Relaxation parameter.
                                      */
@@ -138,6 +184,10 @@ class PreconditionRelaxation
 };
 
 
+
+
+/* ---------------------------------- Inline functions ------------------- */
+
 template<class VECTOR>
 void
 PreconditionIdentity<VECTOR>::operator() (VECTOR& dst, const VECTOR& src) const

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.