From: Guido Kanschat Date: Fri, 11 Mar 2005 16:36:09 +0000 (+0000) Subject: Example documentation included X-Git-Tag: v8.0.0~14433 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c9bc1e3a82902ce4b052c701885457f8789d6b6;p=dealii.git Example documentation included git-svn-id: https://svn.dealii.org/trunk@10100 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index 3dc47022d8..2fc8f4d439 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -71,7 +71,41 @@ template class Vector; * BlockVector. SparseMatrix is a possible entry * type. * - * @include block_matrix_array.cc + *

Example program

+ * We document the relevant parts of examples/doxygen/block_matrix_array.cc. + * + * @dontinclude block_matrix_array.cc + * + * Obviously, we have to include the header file contining the definition + * of BlockMatrixArray: + * @skipline block_matrix_array.h + * + * First, we set up some matrices to be entered into the blocks. + * @skip main + * @until C.fill + * + * Now, we are ready to build a 2x2 BlockMatrixArray. + * @line Block + * First, we enter the matrix A multiplied by 2 in the upper left block + * @line enter + * Now -1 times B1 in the upper right block. + * @line enter + * We add the transpose of B2 to the upper right block and + * continue in a similar fashion. In the end, the block matrix + * structure is printed into an LaTeX table. + * @until latex + * + * Now, we set up vectors to be multiplied with this matrix and do a + * multiplication. + * @until vmult + * + * Finally, we solve a linear system with BlockMatrixArray, using no + * preconditioning and the conjugate gradient method. + * @until Error + * + * The remaining code of this sample program concerns preconditioning + * and is described in the documentation of + * BlockTrianglePrecondition. * * @author Guido Kanschat, 2000 - 2005 */ @@ -280,6 +314,38 @@ class BlockMatrixArray : public Subscriptor * sufficient as long as the block sizes are much larger than the * number of blocks. * + *

Example

+ * Here, we document the second part of + * examples/doxygen/block_matrix_array.cc. For the beginning + * of this file, see BlockMatrixArray. + * + * In order to set up the preconditioner, we have to compute the + * inverses of the diagonal blocks ourselves. Since we used FullMatrix + * objects, this is fairly easy. + * @dontinclude block_matrix_array.cc + * @skip Error + * @until Cinv.invert + * + * After creating a 2x2 BlockTrianglePrecondition object, we + * only fill its diagonals. The scaling factor 1/2 used for + * A is the reciprocal of the scaling factor used for the + * matrix itself. Remember, this preconditioner actually + * multiplies with the diagonal blocks. + * @until Cinv + * + * Now, we have a block Jacobi preconditioner, which is still + * symmetric, since the blocks are symmetric. Therefore, we can still + * use the preconditioned conjugate gradient method. + * @until Error + * + * Now, we enter the subdiagonal block. This is the same as in + * matrix. + * @until B2 + * + * Since the preconditioner is not symmetric anymore, we use the GMRES + * method for solving. + * @until Error + * * @author Guido Kanschat, 2001, 2005 */ template