From: wolf Date: Sun, 18 Jul 1999 21:22:26 +0000 (+0000) Subject: Doc updates. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf76f55e974d84e250781ca3d84246807c48d54a;p=dealii-svn.git Doc updates. git-svn-id: https://svn.dealii.org/trunk@1590 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/mg_base.h b/deal.II/deal.II/include/multigrid/mg_base.h index 5b4bdeff1a..1a5d713443 100644 --- a/deal.II/deal.II/include/multigrid/mg_base.h +++ b/deal.II/deal.II/include/multigrid/mg_base.h @@ -38,8 +38,9 @@ class MGCoarseGridSolver : public Subscriptor * about the matrix is removed to * that class. */ - virtual void operator() (unsigned int level, Vector& dst, - const Vector& src) const = 0; + virtual void operator() (const unsigned int level, + Vector &dst, + const Vector &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 &u, const Vector &rhs) const = 0; diff --git a/deal.II/lac/include/lac/mgbase.h b/deal.II/lac/include/lac/mgbase.h index a85402cc0c..d1fd1fe0c3 100644 --- a/deal.II/lac/include/lac/mgbase.h +++ b/deal.II/lac/include/lac/mgbase.h @@ -38,8 +38,9 @@ class MGCoarseGridSolver : public Subscriptor * about the matrix is removed to * that class. */ - virtual void operator() (unsigned int level, Vector& dst, - const Vector& src) const = 0; + virtual void operator() (const unsigned int level, + Vector &dst, + const Vector &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 &u, const Vector &rhs) const = 0; diff --git a/deal.II/lac/include/lac/precondition.h b/deal.II/lac/include/lac/precondition.h index c397076d95..13ba73558b 100644 --- a/deal.II/lac/include/lac/precondition.h +++ b/deal.II/lac/include/lac/precondition.h @@ -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, + * Vector > gmres(control,memory,500); + * + * gmres.solve (matrix, solution, right_hand_side, + * PreconditionUseMatrix,Vector > + * (matrix,&SparseMatrix::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 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, + * Vector > gmres(control,memory,500); + * + * gmres.solve (matrix, solution, right_hand_side, + * PreconditionRelaxation,Vector > + * (matrix,&SparseMatrix::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 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 A; - * Vector u; - * PreconditioningRelaxation,Vector > - * precondition_ssor(A, &SparseMatrix::template - * precondition_SSOR, 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 void PreconditionIdentity::operator() (VECTOR& dst, const VECTOR& src) const