From 48823e4e4b97a4e8009989bbed3d340ca8eaed56 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 26 Jul 2018 15:14:42 +0200 Subject: [PATCH] fix references, update results --- doc/doxygen/headers/mg.h | 2 +- doc/doxygen/tutorial/tutorial.h.in | 7 +++ examples/step-16/doc/results.dox | 92 +++++++++++++++--------------- examples/step-16b/CMakeLists.txt | 2 +- 4 files changed, 55 insertions(+), 48 deletions(-) diff --git a/doc/doxygen/headers/mg.h b/doc/doxygen/headers/mg.h index b4ec80edfc..d1a4235b1e 100644 --- a/doc/doxygen/headers/mg.h +++ b/doc/doxygen/headers/mg.h @@ -42,7 +42,7 @@ * Finally, we have several auxiliary classes, namely MGLevelObject, * which stores an object on each level* * - * See the step-16 and step-39 example programs on how to use this + * See the step-16, step-16b, and step-39 example programs on how to use this * functionality. *

Multigrid and hanging nodes

diff --git a/doc/doxygen/tutorial/tutorial.h.in b/doc/doxygen/tutorial/tutorial.h.in index de339bdb6f..d00e83a928 100644 --- a/doc/doxygen/tutorial/tutorial.h.in +++ b/doc/doxygen/tutorial/tutorial.h.in @@ -199,6 +199,12 @@ * * * + * step-16b + * A variant of step-16 but with MeshWorker for assembly: Multigrid + * preconditioning of the Laplace equation on adaptive meshes. + * + * + * * step-17 * Using PETSc for linear algebra; running * in parallel on clusters of computers linked together by MPI. @@ -742,6 +748,7 @@ * * * step-16, + * step-16b * step-31, * step-32, * step-37, diff --git a/examples/step-16/doc/results.dox b/examples/step-16/doc/results.dox index eef49e5215..d03a6a0c2a 100644 --- a/examples/step-16/doc/results.dox +++ b/examples/step-16/doc/results.dox @@ -10,58 +10,57 @@ More importantly, we would like to see if the multigrid method really improved the solver performance. Therefore, here is the textual output:
-DEAL::Cycle 0
-DEAL::   Number of active cells:       20
-DEAL::   Number of degrees of freedom: 25 (by level: 8, 25)
-DEAL:cg::Starting value 0.510691
-DEAL:cg::Convergence step 6 value 4.59193e-14
-DEAL::Cycle 1
-DEAL::   Number of active cells:       41
-DEAL::   Number of degrees of freedom: 52 (by level: 8, 25, 41)
-DEAL:cg::Starting value 0.455356
-DEAL:cg::Convergence step 8 value 3.09682e-13
-DEAL::Cycle 2
-DEAL::   Number of active cells:       80
-DEAL::   Number of degrees of freedom: 100 (by level: 8, 25, 61, 52)
-DEAL:cg::Starting value 0.394469
-DEAL:cg::Convergence step 9 value 1.96993e-13
-DEAL::Cycle 3
-DEAL::   Number of active cells:       161
-DEAL::   Number of degrees of freedom: 190 (by level: 8, 25, 77, 160)
-DEAL:cg::Starting value 0.322156
-DEAL:cg::Convergence step 9 value 2.94418e-13
-DEAL::Cycle 4
-DEAL::   Number of active cells:       311
-DEAL::   Number of degrees of freedom: 364 (by level: 8, 25, 86, 227, 174)
-DEAL:cg::Starting value 0.279667
-DEAL:cg::Convergence step 10 value 3.45746e-13
-DEAL::Cycle 5
-DEAL::   Number of active cells:       593
-DEAL::   Number of degrees of freedom: 667 (by level: 8, 25, 89, 231, 490, 96)
-DEAL:cg::Starting value 0.215917
-DEAL:cg::Convergence step 10 value 1.03758e-13
-DEAL::Cycle 6
-DEAL::   Number of active cells:       1127
-DEAL::   Number of degrees of freedom: 1251 (by level: 8, 25, 89, 274, 760, 417, 178)
-DEAL:cg::Starting value 0.185906
-DEAL:cg::Convergence step 10 value 3.40351e-13
-DEAL::Cycle 7
-DEAL::   Number of active cells:       2144
-DEAL::   Number of degrees of freedom: 2359 (by level: 8, 25, 89, 308, 779, 1262, 817)
-DEAL:cg::Starting value 0.141519
-DEAL:cg::Convergence step 10 value 5.74965e-13
+Cycle 0
+   Number of active cells:       80
+   Number of degrees of freedom: 89 (by level: 8, 25, 89)
+  Number of CG iterations: 8
+
+Cycle 1
+   Number of active cells:       158
+   Number of degrees of freedom: 183 (by level: 8, 25, 89, 138)
+  Number of CG iterations: 9
+
+Cycle 2
+   Number of active cells:       302
+   Number of degrees of freedom: 352 (by level: 8, 25, 89, 223, 160)
+  Number of CG iterations: 10
+
+Cycle 3
+   Number of active cells:       578
+   Number of degrees of freedom: 649 (by level: 8, 25, 89, 231, 494, 66)
+  Number of CG iterations: 10
+
+Cycle 4
+   Number of active cells:       1100
+   Number of degrees of freedom: 1218 (by level: 8, 25, 89, 274, 764, 417, 126)
+  Number of CG iterations: 10
+
+Cycle 5
+   Number of active cells:       2096
+   Number of degrees of freedom: 2317 (by level: 8, 25, 89, 304, 779, 1214, 817)
+  Number of CG iterations: 11
+
+Cycle 6
+   Number of active cells:       3986
+   Number of degrees of freedom: 4366 (by level: 8, 25, 89, 337, 836, 2270, 897, 1617)
+  Number of CG iterations: 10
+
+Cycle 7
+   Number of active cells:       7574
+   Number of degrees of freedom: 8350 (by level: 8, 25, 89, 337, 1086, 2835, 2268, 1789, 3217)
+  Number of CG iterations: 11
 
-That's almost perfect multigrid performance: 12 orders of magnitude in -10 iteration steps, and almost independent of the mesh size. That's +That's almost perfect multigrid performance: the linear residual gets reduced by 12 orders of +magnitude in 10 iteration steps, and the results are almost independent of the mesh size. That's obviously in part due to the simple nature of the problem solved, but it shows the power of multigrid methods.

Possible extensions

-We encourage you to switch on timing output by calling the function -LogStream::log_execution_time() of the deallog object and compare to + +We encourage you to switch generate timings for the solve() call and compare to step 6. You will see that the multigrid method has quite an overhead on coarse meshes, but that it always beats other methods on fine meshes because of its optimal complexity. @@ -78,8 +77,9 @@ example. In that case, it would be simpler if one could use a black-box preconditioner that uses some sort of multigrid hierarchy for good performance but can figure out level matrices and similar things by itself. Algebraic multigrid methods do exactly this, and we will use them in step-31 for the -solution of a Stokes problemm and in step-32 and step-40 for a parallel -variation. +solution of a Stokes problem and in step-32 and step-40 for a parallel +variation. That said, a parallel version of this example program with MPI is found +as step-50. Finally, one may want to think how to use geometric multigrid for other kinds of problems, specifically @ref vector_valued "vector valued problems". This is the diff --git a/examples/step-16b/CMakeLists.txt b/examples/step-16b/CMakeLists.txt index 63aa9a9952..b19f8f2a2a 100644 --- a/examples/step-16b/CMakeLists.txt +++ b/examples/step-16b/CMakeLists.txt @@ -1,5 +1,5 @@ ## -# CMake script for the step-16 tutorial program: +# CMake script for the step-16b tutorial program: ## # Set the name of the project and target: -- 2.39.5