From 1456226768ea5485b72be68da24d9550d297e9f6 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 8 Jul 2018 23:50:40 +0200 Subject: [PATCH] Fix comments in @code blocks in lac headers --- include/deal.II/lac/block_linear_operator.h | 3 +- include/deal.II/lac/block_matrix_array.h | 24 ++-- include/deal.II/lac/diagonal_matrix.h | 3 +- include/deal.II/lac/filtered_matrix.h | 14 +-- include/deal.II/lac/identity_matrix.h | 2 +- include/deal.II/lac/matrix_out.h | 15 +-- include/deal.II/lac/parpack_solver.h | 4 +- include/deal.II/lac/petsc_solver.h | 8 +- include/deal.II/lac/precondition.h | 42 ++++--- include/deal.II/lac/precondition_selector.h | 30 ++--- include/deal.II/lac/read_write_vector.h | 2 +- include/deal.II/lac/schur_complement.h | 108 ++++++++++-------- include/deal.II/lac/slepc_solver.h | 54 ++++----- .../lac/slepc_spectral_transformation.h | 15 +-- include/deal.II/lac/solver.h | 35 +++--- include/deal.II/lac/solver_selector.h | 24 ++-- include/deal.II/lac/vector_type_traits.h | 6 +- 17 files changed, 206 insertions(+), 183 deletions(-) diff --git a/include/deal.II/lac/block_linear_operator.h b/include/deal.II/lac/block_linear_operator.h index 80f456bf22..136c457dba 100644 --- a/include/deal.II/lac/block_linear_operator.h +++ b/include/deal.II/lac/block_linear_operator.h @@ -171,7 +171,8 @@ block_back_substitution( * auto top_left_op = linear_operator(top_left); * auto bottom_right_op = linear_operator(bottom_right); * std::array operators {{top_left_op, - * bottom_right_op}}; auto block_op = block_diagonal_operator (operators); + * bottom_right_op}}; + * auto block_op = block_diagonal_operator (operators); * * std::vector::size_type> block_sizes {2, 4}; * BlockVector src(block_sizes); diff --git a/include/deal.II/lac/block_matrix_array.h b/include/deal.II/lac/block_matrix_array.h index 3adb25c46e..75fd70b812 100644 --- a/include/deal.II/lac/block_matrix_array.h +++ b/include/deal.II/lac/block_matrix_array.h @@ -234,26 +234,26 @@ public: * * As an example, consider the following code: * @code - * FullMatrix A1(4,4); - * FullMatrix A2(4,4); - * FullMatrix B(4,3); - * FullMatrix C(3,3); + * FullMatrix A1(4,4); + * FullMatrix A2(4,4); + * FullMatrix B(4,3); + * FullMatrix C(3,3); * - * BlockMatrixArray block(2,2); + * BlockMatrixArray block(2,2); * - * block.enter(A1,0,0); - * block.enter(A2,0,0,2,true); - * block.enter(B,0,1,-3.); - * block.enter(B,0,1,-3.,true); - * block.enter(C,1,1,1.,true); + * block.enter(A1,0,0); + * block.enter(A2,0,0,2,true); + * block.enter(B,0,1,-3.); + * block.enter(B,0,1,-3.,true); + * block.enter(C,1,1,1.,true); * - * block.print_latex(std::cout); + * block.print_latex(std::cout); * @endcode * The current function will then produce output of the following kind: * @code * \begin{array}{cc} * M0+2xM1^T & -3xM2-3xM3^T\\ - * & M4^T + * & M4^T * \end{array} * @endcode * Note how the individual blocks here are just numbered successively as diff --git a/include/deal.II/lac/diagonal_matrix.h b/include/deal.II/lac/diagonal_matrix.h index 08573e8218..fa99ed42a6 100644 --- a/include/deal.II/lac/diagonal_matrix.h +++ b/include/deal.II/lac/diagonal_matrix.h @@ -36,7 +36,8 @@ DEAL_II_NAMESPACE_OPEN * @code * DiagonalMatrix > diagonal_matrix; * LinearAlgebra::distributed::Vector &diagonal_vector = - * diagonal_matrix.get_vector(); diagonal_vector.reinit(locally_owned_dofs, + * diagonal_matrix.get_vector(); + * diagonal_vector.reinit(locally_owned_dofs, * locally_relevant_dofs, * mpi_communicator); * @endcode diff --git a/include/deal.II/lac/filtered_matrix.h b/include/deal.II/lac/filtered_matrix.h index 730bd23ef6..7c190e828f 100644 --- a/include/deal.II/lac/filtered_matrix.h +++ b/include/deal.II/lac/filtered_matrix.h @@ -69,28 +69,28 @@ class FilteredMatrixBlock; * * A typical code snippet showing the above steps is as follows: * @code - * ... // set up sparse matrix A and right hand side b somehow + * // set up sparse matrix A and right hand side b somehow + * ... * - * // initialize filtered matrix with - * // matrix and boundary value constraints + * // initialize filtered matrix with matrix and boundary value constraints * FilteredMatrix > filtered_A (A); * filtered_A.add_constraints (boundary_values); * - * // set up a linear solver + * // set up a linear solver * SolverControl control (1000, 1.e-10, false, false); * GrowingVectorMemory > mem; * SolverCG > solver (control, mem); * - * // set up a preconditioner object + * // set up a preconditioner object * PreconditionJacobi > prec; * prec.initialize (A, 1.2); * FilteredMatrix > filtered_prec (prec); * filtered_prec.add_constraints (boundary_values); * - * // compute modification of right hand side + * // compute modification of right hand side * filtered_A.apply_constraints (b, true); * - * // solve for solution vector x + * // solve for solution vector x * solver.solve (filtered_A, x, b, filtered_prec); * @endcode * diff --git a/include/deal.II/lac/identity_matrix.h b/include/deal.II/lac/identity_matrix.h index e418b61d7a..b34db37b61 100644 --- a/include/deal.II/lac/identity_matrix.h +++ b/include/deal.II/lac/identity_matrix.h @@ -62,7 +62,7 @@ DEAL_II_NAMESPACE_OPEN * SolverControl solver_control (1000, 1e-12); * SolverCG<> cg (solver_control); * cg.solve (system_matrix, solution, system_rhs, - * IdentityMatrix(solution.size())); + * IdentityMatrix(solution.size())); * @endcode * * diff --git a/include/deal.II/lac/matrix_out.h b/include/deal.II/lac/matrix_out.h index 2f4a1c4f61..5fbf56f82f 100644 --- a/include/deal.II/lac/matrix_out.h +++ b/include/deal.II/lac/matrix_out.h @@ -45,14 +45,15 @@ DEAL_II_NAMESPACE_OPEN * * A typical usage of this class would be as follows: * @code - * FullMatrix M; - * ... // fill matrix M with some values + * FullMatrix M; + * // fill matrix M with some values + * ... * - * // now write out M: - * MatrixOut matrix_out; - * std::ofstream out ("M.gnuplot"); - * matrix_out.build_patches (M, "M"); - * matrix_out.write_gnuplot (out); + * // now write out M: + * MatrixOut matrix_out; + * std::ofstream out ("M.gnuplot"); + * matrix_out.build_patches (M, "M"); + * matrix_out.write_gnuplot (out); * @endcode * Of course, you can as well choose a different graphical output format. * Also, this class supports any matrix, not only of type FullMatrix, as long diff --git a/include/deal.II/lac/parpack_solver.h b/include/deal.II/lac/parpack_solver.h index 2225ae43fc..f43aa909f7 100644 --- a/include/deal.II/lac/parpack_solver.h +++ b/include/deal.II/lac/parpack_solver.h @@ -194,8 +194,8 @@ extern "C" * SolverControl solver_control_lin (1000, 1e-10,false,false); * * SolverCG cg(solver_control_lin); - * const auto op_shift_invert = inverse_operator(op_shift, cg, - * PreconditionIdentity ()); + * const auto op_shift_invert = + * inverse_operator(op_shift, cg, PreconditionIdentity ()); * @endcode * * The class is intended to be used with MPI and can work on arbitrary vector diff --git a/include/deal.II/lac/petsc_solver.h b/include/deal.II/lac/petsc_solver.h index 44b8f4581b..a71660e0ec 100644 --- a/include/deal.II/lac/petsc_solver.h +++ b/include/deal.II/lac/petsc_solver.h @@ -918,10 +918,10 @@ namespace PETScWrappers * is made possible by the set_symmetric_mode() function. If your matrix is * symmetric, you can use this class as follows: * @code - * SolverControl cn; - * PETScWrappers::SparseDirectMUMPS solver(cn, mpi_communicator); - * solver.set_symmetric_mode(true); - * solver.solve(system_matrix, solution, system_rhs); + * SolverControl cn; + * PETScWrappers::SparseDirectMUMPS solver(cn, mpi_communicator); + * solver.set_symmetric_mode(true); + * solver.solve(system_matrix, solution, system_rhs); * @endcode * * @note The class internally calls KSPSetFromOptions thus you are able to diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index cf895e8069..9800cb55a6 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -63,8 +63,7 @@ namespace LinearAlgebra * @code * SolverControl solver_control (1000, 1e-12); * SolverCG<> cg (solver_control); - * cg.solve (system_matrix, solution, system_rhs, - * PreconditionIdentity()); + * cg.solve (system_matrix, solution, system_rhs, PreconditionIdentity()); * @endcode * * See the step-3 tutorial program for an example and additional explanations. @@ -331,13 +330,12 @@ private: * You will usually not want to create a named object of this type, although * possible. The most common use is like this: * @code - * SolverGMRES, - * Vector > gmres(control,memory,500); + * SolverGMRES Vector> gmres(control,memory,500); * - * gmres.solve (matrix, solution, right_hand_side, - * PreconditionUseMatrix,Vector > - * (matrix,&SparseMatrix::template - * precondition_Jacobi)); + * gmres.solve( + * matrix, solution, right_hand_side, + * PreconditionUseMatrix,Vector >( + * matrix, &SparseMatrix::template precondition_Jacobi)); * @endcode * 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 @@ -350,11 +348,11 @@ private: * Note that due to the default template parameters, the above example could * be written shorter as follows: * @code - * ... - * gmres.solve (matrix, solution, right_hand_side, - * PreconditionUseMatrix<> - * (matrix,&SparseMatrix::template - * precondition_Jacobi)); + * ... + * gmres.solve( + * matrix, solution, right_hand_side, + * PreconditionUseMatrix<>( + * matrix,&SparseMatrix::template precondition_Jacobi)); * @endcode * * @author Guido Kanschat, Wolfgang Bangerth, 1999 @@ -495,8 +493,8 @@ protected: * // Define and initialize preconditioner: * * PreconditionJacobi > precondition; - * precondition.initialize (A, PreconditionJacobi - * >::AdditionalData(.6)); + * precondition.initialize( + * A, PreconditionJacobi>::AdditionalData(.6)); * * solver.solve (A, x, b, precondition); * @endcode @@ -583,8 +581,8 @@ public: * // Define and initialize preconditioner * * PreconditionSOR > precondition; - * precondition.initialize (A, PreconditionSOR - * >::AdditionalData(.6)); + * precondition.initialize( + * A, PreconditionSOR>::AdditionalData(.6)); * * solver.solve (A, x, b, precondition); * @endcode @@ -640,7 +638,7 @@ public: * @ref ConceptRelaxationType "relaxation concept". * * @code - * // Declare related objects + * // Declare related objects * * SparseMatrix A; * Vector x; @@ -652,8 +650,8 @@ public: * // Define and initialize preconditioner * * PreconditionSSOR > precondition; - * precondition.initialize (A, PreconditionSSOR - * >::AdditionalData(.6)); + * precondition.initialize( + * A, PreconditionSSOR>::AdditionalData(.6)); * * solver.solve (A, x, b, precondition); * @endcode @@ -737,7 +735,7 @@ private: * TPSOR(VectorType&, const VectorType&, double). * * @code - * // Declare related objects + * // Declare related objects * * SparseMatrix A; * Vector x; @@ -751,7 +749,7 @@ private: * * //...fill permutation and its inverse with reasonable values * - * // Define and initialize preconditioner + * // Define and initialize preconditioner * * PreconditionPSOR > precondition; * precondition.initialize (A, permutation, inverse_permutation, .6); diff --git a/include/deal.II/lac/precondition_selector.h b/include/deal.II/lac/precondition_selector.h index 7b6b2f27ed..389033a034 100644 --- a/include/deal.II/lac/precondition_selector.h +++ b/include/deal.II/lac/precondition_selector.h @@ -49,35 +49,35 @@ class SparseMatrix; * *

Usage

The simplest use of this class is the following: * @code - * // generate a @p SolverControl and - * // a @p VectorMemory + * // generate a @p SolverControl and a @p VectorMemory * SolverControl control; * VectorMemory > memory; - * // generate a solver + * + * // generate a solver * SolverCG, Vector > solver(control, memory); - * // generate a @p PreconditionSelector + * + * // generate a @p PreconditionSelector * PreconditionSelector, Vector > * preconditioning("jacobi", 1.); - * // give a matrix whose diagonal entries - * // are to be used for the preconditioning. - * // Generally the matrix of the linear - * // equation system Ax=b. + * + * // give a matrix whose diagonal entries are to be used for the + * // preconditioning. Generally the matrix of the linear equation system Ax=b. * preconditioning.use_matrix(A); - * // call the @p solve function with this - * // preconditioning as last argument + * + * // call the @p solve function with this preconditioning as last argument * solver.solve(A,x,b,preconditioning); * @endcode * The same example where also the @p SolverSelector class is used reads * @code - * // generate a @p SolverControl and - * // a @p VectorMemory + * // generate a @p SolverControl and a @p VectorMemory * SolverControl control; * VectorMemory > memory; - * // generate a @p SolverSelector that - * // calls the @p SolverCG + * + * // generate a @p SolverSelector that calls the @p SolverCG * SolverSelector, Vector > * solver_selector("cg", control, memory); - * // generate a @p PreconditionSelector + * + * // generate a @p PreconditionSelector * PreconditionSelector, Vector > * preconditioning("jacobi", 1.); * diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index 9a3a1529ab..1c26196c03 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -236,7 +236,7 @@ namespace LinearAlgebra * @code * struct Functor * { - * void operator() (Number &value); + * void operator() (Number &value); * }; * @endcode * diff --git a/include/deal.II/lac/schur_complement.h b/include/deal.II/lac/schur_complement.h index fe9181ae3f..7ad43b3e91 100644 --- a/include/deal.II/lac/schur_complement.h +++ b/include/deal.II/lac/schur_complement.h @@ -129,36 +129,45 @@ DEAL_II_NAMESPACE_OPEN * An illustration of typical usage of this operator for a fully coupled * system is given below. * @code - * #include - * - * // Given BlockMatrix K and BlockVectors d,F - * - * // Decomposition of tangent matrix - * const auto A = linear_operator(K.block(0,0)); - * const auto B = linear_operator(K.block(0,1)); - * const auto C = linear_operator(K.block(1,0)); - * const auto D = linear_operator(K.block(1,1)); - * - * // Decomposition of solution vector - * auto x = d.block(0); - * auto y = d.block(1); - * - * // Decomposition of RHS vector - * auto f = F.block(0); - * auto g = F.block(1); - * - * // Construction of inverse of Schur complement - * const auto prec_A = PreconditionSelector<...>(A); - * const auto A_inv = inverse_operator<...>(A,prec_A); - * const auto S = schur_complement(A_inv,B,C,D); - * const auto S_prec = PreconditionSelector<...>(D); // D and S operate on - * same space const auto S_inv = inverse_operator<...>(S,...,prec_S); - * - * // Solve reduced block system - * auto rhs = condense_schur_rhs (A_inv,C,f,g); // PackagedOperation that - * represents the condensed form of g y = S_inv * rhs; // Solve for y x = - * postprocess_schur_solution (A_inv,B,y,f); // Compute x using resolved - * solution y + * #include + * + * // Given BlockMatrix K and BlockVectors d,F + * + * // Decomposition of tangent matrix + * const auto A = linear_operator(K.block(0,0)); + * const auto B = linear_operator(K.block(0,1)); + * const auto C = linear_operator(K.block(1,0)); + * const auto D = linear_operator(K.block(1,1)); + * + * // Decomposition of solution vector + * auto x = d.block(0); + * auto y = d.block(1); + * + * // Decomposition of RHS vector + * auto f = F.block(0); + * auto g = F.block(1); + * + * // Construction of inverse of Schur complement + * const auto prec_A = PreconditionSelector<...>(A); + * const auto A_inv = inverse_operator<...>(A,prec_A); + * const auto S = schur_complement(A_inv,B,C,D); + * + * // D and S operate on same space + * const auto S_prec = PreconditionSelector<...>(D); + * const auto S_inv = inverse_operator<...>(S,...,prec_S); + * + * // Solve reduced block system + * // PackagedOperation that represents the condensed form of g + * y = S_inv * rhs; + * + * // PackagedOperation that represents the condensed form of g + * auto rhs = condense_schur_rhs (A_inv,C,f,g); + * + * // Solve for y + * y = S_inv * rhs; + * + * // Compute x using resolved solution y + * postprocess_schur_solution (A_inv,B,y,f); * @endcode * * In the above example, the preconditioner for $ S $ was defined as the @@ -178,22 +187,29 @@ DEAL_II_NAMESPACE_OPEN * construct the approximate inverse operator $ \tilde{S}^{-1} $ which is then * used as the preconditioner for computing $ S^{-1} $. * @code - * // Construction of approximate inverse of Schur complement - * const auto A_inv_approx = linear_operator(preconditioner_A); - * const auto S_approx = schur_complement(A_inv_approx,B,C,D); - * const auto S_approx_prec = PreconditionSelector<...>(D); // D and S_approx - * operate on same space const auto S_inv_approx = - * inverse_operator(S_approx,...,S_approx_prec); // Inner solver: Typically - * limited to few iterations using IterationNumberControl - * - * // Construction of exact inverse of Schur complement - * const auto S = schur_complement(A_inv,B,C,D); - * const auto S_inv = inverse_operator(S,...,S_inv_approx); // Outer solver - * - * // Solve reduced block system - * auto rhs = condense_schur_rhs (A_inv,C,f,g); - * y = S_inv * rhs; // Solve for y - * x = postprocess_schur_solution (A_inv,B,y,f); + * // Construction of approximate inverse of Schur complement + * const auto A_inv_approx = linear_operator(preconditioner_A); + * const auto S_approx = schur_complement(A_inv_approx,B,C,D); + * + * // D and S_approx operate on same space + * const auto S_approx_prec = PreconditionSelector<...>(D); + * + * // Inner solver: + * // Typically limited to few iterations using IterationNumberControl + * auto S_inv_approx = inverse_operator(S_approx,...,S_approx_prec); + * + * // Construction of exact inverse of Schur complement + * const auto S = schur_complement(A_inv,B,C,D); + * + * // Outer solver + * const auto S_inv = inverse_operator(S,...,S_inv_approx); + * + * // Solve reduced block system + * auto rhs = condense_schur_rhs (A_inv,C,f,g); + * + * // Solve for y + * y = S_inv * rhs; + * x = postprocess_schur_solution (A_inv,B,y,f); * @endcode * Note that due to the construction of @c S_inv_approx and subsequently @c * S_inv, there are a pair of nested iterative solvers which could diff --git a/include/deal.II/lac/slepc_solver.h b/include/deal.II/lac/slepc_solver.h index ac75ad2668..afcb056b76 100644 --- a/include/deal.II/lac/slepc_solver.h +++ b/include/deal.II/lac/slepc_solver.h @@ -50,9 +50,9 @@ DEAL_II_NAMESPACE_OPEN * * SLEPcWrappers can be implemented in application codes in the following way: * @code - * SolverControl solver_control (1000, 1e-9); - * SolverArnoldi system (solver_control, mpi_communicator); - * system.solve (A, B, lambda, x, size_of_spectrum); + * SolverControl solver_control (1000, 1e-9); + * SolverArnoldi system (solver_control, mpi_communicator); + * system.solve (A, B, lambda, x, size_of_spectrum); * @endcode * for the generalized eigenvalue problem $Ax=B\lambda x$, where the variable * const unsigned int size_of_spectrum tells SLEPc the number of @@ -63,8 +63,8 @@ DEAL_II_NAMESPACE_OPEN * wanted only, the following code can be implemented before calling * solve(): * @code - * system.set_problem_type (EPS_NHEP); - * system.set_which_eigenpairs (EPS_SMALLEST_REAL); + * system.set_problem_type (EPS_NHEP); + * system.set_which_eigenpairs (EPS_SMALLEST_REAL); * @endcode * These options can also be set at the command line. * @@ -75,22 +75,22 @@ DEAL_II_NAMESPACE_OPEN * additionally specify which linear solver and preconditioner to use. This * can be achieved as follows * @code - * PETScWrappers::PreconditionBoomerAMG::AdditionalData data; - * data.symmetric_operator = true; - * PETScWrappers::PreconditionBoomerAMG preconditioner(mpi_communicator, - * data); SolverControl linear_solver_control (dof_handler.n_dofs(), - * 1e-12,false,false); PETScWrappers::SolverCG - * linear_solver(linear_solver_control,mpi_communicator); - * linear_solver.initialize(preconditioner); - * SolverControl solver_control (100, 1e-9,false,false); - * SLEPcWrappers::SolverKrylovSchur - * eigensolver(solver_control,mpi_communicator); - * SLEPcWrappers::TransformationShift - * spectral_transformation(mpi_communicator); - * spectral_transformation.set_solver(linear_solver); - * eigensolver.set_transformation(spectral_transformation); - * eigensolver.solve - * (stiffness_matrix,mass_matrix,eigenvalues,eigenfunctions,eigenfunctions.size()); + * PETScWrappers::PreconditionBoomerAMG::AdditionalData data; + * data.symmetric_operator = true; + * PETScWrappers::PreconditionBoomerAMG preconditioner(mpi_communicator, data); + * SolverControl linear_solver_control (dof_handler.n_dofs(), + * 1e-12, false, false); + * PETScWrappers::SolverCG linear_solver(linear_solver_control, + * mpi_communicator); + * linear_solver.initialize(preconditioner); + * SolverControl solver_control (100, 1e-9,false,false); + * SLEPcWrappers::SolverKrylovSchur eigensolver(solver_control, + * mpi_communicator); + * SLEPcWrappers::TransformationShift spectral_transformation(mpi_communicator); + * spectral_transformation.set_solver(linear_solver); + * eigensolver.set_transformation(spectral_transformation); + * eigensolver.solve(stiffness_matrix, mass_matrix, + * eigenvalues, eigenfunctions, eigenfunctions.size()); * @endcode * * In order to support this usage case, different from PETSc wrappers, the @@ -110,11 +110,13 @@ DEAL_II_NAMESPACE_OPEN * template * void * SolverBase::solve (const PETScWrappers::MatrixBase &A, - * const PETScWrappers::MatrixBase &B, - * std::vector &eigenvalues, - * std::vector &eigenvectors, - * const unsigned int n_eigenpairs) - * { ... } + * const PETScWrappers::MatrixBase &B, + * std::vector &eigenvalues, + * std::vector &eigenvectors, + * const unsigned int n_eigenpairs) + * { + * ... + * } * @endcode * as an example on how to do this. * diff --git a/include/deal.II/lac/slepc_spectral_transformation.h b/include/deal.II/lac/slepc_spectral_transformation.h index ab11c1740b..0beae909d9 100644 --- a/include/deal.II/lac/slepc_spectral_transformation.h +++ b/include/deal.II/lac/slepc_spectral_transformation.h @@ -50,16 +50,17 @@ namespace SLEPcWrappers * application codes in the following way for XXX=INVERT with * the solver object eigensolver: * @code - * // Set a transformation, this one shifts the eigenspectrum by 3.142.. - * SLEPcWrappers::TransformationShift::AdditionalData additional_data - * (3.142); SLEPcWrappers::TransformationShift shift - * (mpi_communicator,additional_data); eigensolver.set_transformation (shift); + * // Set a transformation, this one shifts the eigenspectrum by 3.142.. + * SLEPcWrappers::TransformationShift::AdditionalData + * additional_data(3.142); + * SLEPcWrappers::TransformationShift shift(mpi_communicator,additional_data); + * eigensolver.set_transformation(shift); * @endcode * and later calling the solve() function as usual: * @code - * SolverControl solver_control (1000, 1e-9); - * SolverArnoldi system (solver_control, mpi_communicator); - * eigensolver.solve (A, B, lambda, x, size_of_spectrum); + * SolverControl solver_control (1000, 1e-9); + * SolverArnoldi system (solver_control, mpi_communicator); + * eigensolver.solve (A, B, lambda, x, size_of_spectrum); * @endcode * * @note These options can also be set at the command line. diff --git a/include/deal.II/lac/solver.h b/include/deal.II/lac/solver.h index 4b0b3108fc..a62ffbabbf 100644 --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@ -247,23 +247,24 @@ class Vector; * An example may illuminate these issues. In the step-3 tutorial program, let * us add a member function as follows to the main class: * @code - * SolverControl::State - * Step3::write_intermediate_solution (const unsigned int iteration, - * const double , //check_value - * const Vector ¤t_iterate) - * const - * { - * DataOut<2> data_out; - * data_out.attach_dof_handler (dof_handler); - * data_out.add_data_vector (current_iterate, "solution"); - * data_out.build_patches (); - * - * std::ofstream output ((std::string("solution-") - * + Utilities::int_to_string(iteration,4) + - * ".vtu").c_str()); data_out.write_vtu (output); - * - * return SolverControl::success; - * } + * SolverControl::State + * Step3::write_intermediate_solution ( + * const unsigned int iteration, + * const double , //check_value + * const Vector ¤t_iterate) const + * { + * DataOut<2> data_out; + * data_out.attach_dof_handler (dof_handler); + * data_out.add_data_vector (current_iterate, "solution"); + * data_out.build_patches (); + * + * std::ofstream output ("solution-" + * + Utilities::int_to_string(iteration,4) + * + ".vtu"); + * data_out.write_vtu (output); + * + * return SolverControl::success; + * } * @endcode * The function satisfies the signature necessary to be a slot for the signal * discussed above, with the exception that it is a member function and diff --git a/include/deal.II/lac/solver_selector.h b/include/deal.II/lac/solver_selector.h index 893e3d294a..e5a1f57833 100644 --- a/include/deal.II/lac/solver_selector.h +++ b/include/deal.II/lac/solver_selector.h @@ -47,22 +47,21 @@ DEAL_II_NAMESPACE_OPEN * *

Usage

The simplest use of this class is the following: * @code - * // generate a @p SolverControl and - * // a @p VectorMemory + * // generate a @p SolverControl and a @p VectorMemory * SolverControl control; * VectorMemory > memory; - * // Line 3: - * // - * // generate a @p SolverSelector that - * // calls the @p SolverCG + * + * // Line 3: + * // generate a @p SolverSelector that calls the @p SolverCG * SolverSelector > * solver_selector("cg", control, memory); - * // generate e.g. a @p PreconditionRelaxation + * + * // generate e.g. a @p PreconditionRelaxation * PreconditionRelaxation, Vector > - * preconditioning(A, &SparseMatrix - * ::template precondition_SSOR,0.8); - * // call the @p solve function with this - * // preconditioning as last argument + * preconditioning( + * A, &SparseMatrix::template precondition_SSOR,0.8); + * + * // call the @p solve function with this preconditioning as last argument * solver_selector.solve(A,x,b,preconditioning); * @endcode * But the full usefulness of the @p SolverSelector class is not clear until @@ -71,7 +70,8 @@ DEAL_II_NAMESPACE_OPEN * @code * Parameter_Handler prm; * prm.declare_entry ("solver", "none", - * Patterns::Selection(SolverSelector<>::get_solver_names())); + * Patterns::Selection( + * SolverSelector<>::get_solver_names())); * ... * @endcode * Assuming that in the users parameter file there exists the line diff --git a/include/deal.II/lac/vector_type_traits.h b/include/deal.II/lac/vector_type_traits.h index 4cefa13004..3f07ae3bab 100644 --- a/include/deal.II/lac/vector_type_traits.h +++ b/include/deal.II/lac/vector_type_traits.h @@ -31,12 +31,14 @@ DEAL_II_NAMESPACE_OPEN * The specialization * @code * template <> - * struct is_serial_vector< VectorType > : std::true_type {}; + * struct is_serial_vector : std::true_type + * {}; * @endcode * for a serial vector type, respectively, * @code * template <> - * struct is_serial_vector< VectorType > : std::false_type {}; + * struct is_serial_vector : std::false_type + * {}; * @endcode * for a vector type with support of distributed storage, * must be done in a header file of a vector declaration. -- 2.39.5