From: wolf Date: Wed, 5 May 1999 19:03:39 +0000 (+0000) Subject: Doc updates. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a09ce9b244c6ea0f9d70f72274eae39c1ad02049;p=dealii-svn.git Doc updates. git-svn-id: https://svn.dealii.org/trunk@1281 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/Todo b/deal.II/lac/Todo index c7155fdce9..21b97904c7 100644 --- a/deal.II/lac/Todo +++ b/deal.II/lac/Todo @@ -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 diff --git a/deal.II/lac/include/lac/solver.h b/deal.II/lac/include/lac/solver.h index a7494f17a0..2b59d6ba47 100644 --- a/deal.II/lac/include/lac/solver.h +++ b/deal.II/lac/include/lac/solver.h @@ -91,14 +91,16 @@ template 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 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 Solver diff --git a/deal.II/lac/include/lac/solver_bicgstab.h b/deal.II/lac/include/lac/solver_bicgstab.h index eb9df13282..c5ebf62c0c 100644 --- a/deal.II/lac/include/lac/solver_bicgstab.h +++ b/deal.II/lac/include/lac/solver_bicgstab.h @@ -12,8 +12,19 @@ /** * 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 SolverBicgstab // diff --git a/deal.II/lac/include/lac/solver_cg.h b/deal.II/lac/include/lac/solver_cg.h index 94a3a3398b..2258796928 100644 --- a/deal.II/lac/include/lac/solver_cg.h +++ b/deal.II/lac/include/lac/solver_cg.h @@ -14,10 +14,23 @@ /** * 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 SolverCG : public Solver diff --git a/deal.II/lac/include/lac/solver_gmres.h b/deal.II/lac/include/lac/solver_gmres.h index 869c45eb51..32058f62bd 100644 --- a/deal.II/lac/include/lac/solver_gmres.h +++ b/deal.II/lac/include/lac/solver_gmres.h @@ -45,8 +45,18 @@ * 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 */ 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 diff --git a/deal.II/lac/include/lac/solver_richardson.h b/deal.II/lac/include/lac/solver_richardson.h index e5ef9a9fcf..36b1b13c5b 100644 --- a/deal.II/lac/include/lac/solver_richardson.h +++ b/deal.II/lac/include/lac/solver_richardson.h @@ -16,8 +16,18 @@ * 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 */ struct AdditionalData { + /** + * Constructor. By default, + * set the damping parameter + * to one. + */ AdditionalData(double omega=1): - omega(omega) {}; + omega(omega) + {}; /** * Relaxation parameter. diff --git a/deal.II/lac/include/lac/solver_selector.h b/deal.II/lac/include/lac/solver_selector.h index 04277123fd..9d31ef82d8 100644 --- a/deal.II/lac/include/lac/solver_selector.h +++ b/deal.II/lac/include/lac/solver_selector.h @@ -18,6 +18,8 @@ #include #include + + /** * 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::SolverSelector(string solver_name, VectorMemory &vector_memory) : solver_name(solver_name), control(&control), - vector_memory(&vector_memory) {} + vector_memory(&vector_memory) +{}; + + - template SolverSelector::~SolverSelector() -{} +{}; @@ -240,7 +245,7 @@ SolverSelector::solve(const Matrix &A, Assert(false,ExcSolverDoesNotExist(solver_name)); return Solver::breakdown; -} +}; @@ -248,7 +253,7 @@ template string SolverSelector::get_solver_names() { return "richardson|cg|bicgstab|gmres"; -} +}; /*---------------------------- solver_selector.h ---------------------------*/