From: wolf
+
This is a rather short example which only shows some aspects of using
-higher order mappings. By
+
+
For some differential equations, it is known that piecewise linear
-approximations of the boundary, i.e. Q1 mappings, are not
+approximations of the boundary, i.e. $Q_1$ mappings, are not
sufficient if the boundary of the domain is curved. Examples are the
-biharmonic equation using C1 elements, or the Euler
+biharmonic equation using $C^1$ elements, or the Euler
equation on domains with curved reflective boundaries. In these cases,
it is necessary to compute the integrals using a higher order
mapping. The reason, of course, is that if we do not use a higher
@@ -31,31 +31,31 @@ order mapping, the order of approximation of the boundary dominates
the order of convergence of the entire numerical scheme, irrespective
of the order of convergence of the discretization in the interior of
the domain.
-
+
+
Rather than demonstrating the use of higher order mappings with one of
these more complicated examples, we do only a brief computation:
-calculating the value of pi=3.141592653589793238462643... by two
+calculating the value of $\pi=3.141592653589793238462643\ldots$ by two
different methods.
-
+
+
The first method uses a triangulated approximation of the circle with
unit radius and integrates the unit function over it. Of course, if
the domain were the exact unit circle, then the area would be pi, but
since we only use an approximation by piecewise polynomial segments,
the value of the area is not exactly pi. However, it is known that as
-we refine the triangulation, a Qp mapping approximates the boundary
-with an order
+
+
The second method works similarly, but this time does not use the area
of the triangulated unit circle, but rather its perimeter. Pi is then
approximated by half of the perimeter, as the radius is equal to one.
-
+
The program performs two tasks, the first being to generate a
visualization of the mapped domain, the second to compute pi by the
two methods described. Let us first take a look at the generated
graphics. They are generated in Gnuplot format, and can be viewed with
the commands
-Introduction
-Results
-
+@code
set data style lines
set size 0.721, 1
set nokey
plot [-1:1][-1:1] "ball0_mapping_q1.dat"
-
+@endcode
or using one of the other filenames. The second line makes sure that
the aspect ratio of the generated output is actually 1:1, i.e. a
circle is drawn as a circle on your screen, rather than as an
ellipse. The third line switches off the key in the graphic, as that
will only print information (the filename) which is not that important
right now.
-
+ + The following table shows the triangulated computational domain for Q1, Q2, and Q3 mappings, for the original coarse grid (left), and a once uniformly refined grid (right). If your browser does not display @@ -29,28 +29,28 @@ these pictures in acceptable quality, view them one by one.
- + @image html step-10.ball_mapping_q1_ref0.png | - + @image html step-10.ball_mapping_q1_ref1.png |
- + @image html step-10.ball_mapping_q2_ref0.png | - + @image html step-10.ball_mapping_q2_ref1.png |
- + @image html step-10.ball_mapping_q3_ref0.png | - + @image html step-10.ball_mapping_q3_ref1.png |
- + @image html step-10.quarter-q1.png | - + @image html step-10.quarter-q2.png | - + @image html step-10.quarter-q3.png |
+ + The second purpose of the program was to compute the value of pi to good accuracy. This is the output of this part of the program: -
+@code Computation of Pi by the area: ============================== Degree = 1 @@ -164,31 +164,31 @@ cells eval.pi error 320 3.1415926540544636 4.6467e-10 6.00 1280 3.1415926535970535 7.2602e-12 6.00 5120 3.1415926535899010 1.0805e-13 6.07 -- +@endcode + + -
One of the immediate observations from the output is that in all cases the values converge quickly to the true value of -pi=3.141592653589793238462643. Note that for the Q4 mapping, the last +$\pi=3.141592653589793238462643$. Note that for the $Q_4$ mapping, the last number is correct to 13 digits in both computations, which is already -quite a lot. However, also note that for the Q1 mapping, even on the +quite a lot. However, also note that for the $Q_1$ mapping, even on the finest grid the accuracy is significantly worse than on the coarse -grid for a Q4 mapping! -
+grid for a $Q_4$ mapping! + + -
The last column of the output shows the convergence order, in powers
-of the mesh width
+
The output of this program consist of the console output, the eps
files including the grids, and the solutions given in gnuplot format.
-
-
We see that, as expected, on each refinement step the two solutions
coincide. The difference measured in time of treating each face only
once (second version of the DG method) in comparison with treating
each face twice within a nested loop over all cells and all faces of
each cell (first version), is much less than one might have
expected. The gain is less than 20% on the last few refinement steps.
-
+@code
Cycle 0:
Number of active cells: 64
Number of degrees of freedom: 256
Time of assemble_system1: 0.05
Time of assemble_system2: 0.04
solution1 and solution2 coincide.
-Writing grid to <grid-0.eps>...
-Writing solution to <sol-0.gnuplot>...
+Writing grid to
-
First we show the solutions on the initial mesh, the mesh after two + + First we show the solutions on the initial mesh, the mesh after two and after five adaptive refinement steps. -
- - - -
-Then we show the final grid (after 5 refinement steps). The +@image step-12.sol-0.png +@image step-12.sol-2.png +@image step-12.sol-5.png + + +Then we show the final grid (after 5 refinement steps). The grid is largely concentrated in the vicinity of the jump of the solution. -
- -
- -And finally we show a plot of a 3d computation. -
- -
+ +@image step-12.grid-5.png + + +And finally we show a plot of a 3d computation. + +@image html step-12.sol-5-3d.png + diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-0.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-0.gif deleted file mode 100644 index d4d0b52469..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-0.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-2.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-2.gif deleted file mode 100644 index 175c9c99b5..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-2.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-5-3d.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-5-3d.gif deleted file mode 100644 index 1899455ffc..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-5-3d.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-5.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-5.gif deleted file mode 100644 index e57bc0572e..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/sol-5.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.grid-5.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.grid-5.png new file mode 100644 index 0000000000..a2383b9551 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.grid-5.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-0.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-0.png new file mode 100644 index 0000000000..16ae3fb90f Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-0.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-2.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-2.png new file mode 100644 index 0000000000..081f3afc8b Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-2.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-5-3d.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-5-3d.png new file mode 100644 index 0000000000..6f80120c9b Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-5-3d.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-5.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-5.png new file mode 100644 index 0000000000..d9cfd871fb Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-12.data/step-12.sol-5.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/intro.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/intro.dox similarity index 81% rename from deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/intro.html rename to deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/intro.dox index 2d78fbf791..750048aaef 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/intro.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/intro.dox @@ -1,15 +1,15 @@+ This example shows the basic usage of the multilevel functions in -deal.II. It solves the Helmholtz equation with Neumann boundary conditions +deal.II. It solves the Helmholtz equation with Neumann boundary conditions to avoid additional complications due to Dirichlet boundary conditions (there, some library functions are missing). Therefore, the solution is the constant function with value unity. In all other respects, it is similar to step 5. -
-In order to allow sufficient flexibility in conjunction with systems of + + In order to allow sufficient flexibility in conjunction with systems of differential equations and block preconditioners, quite a few different objects have to be created before starting the multilevel method. These are
+ + These objects are combined in an object of type Multigrid, containing the implementation of the V-cycle, which is in turn used by the preconditioner PreconditionMG, ready for plug-in into a linear solver of the LAC library. -
--The multilevel method in deal.II follows in many respects the outlines + + +The multilevel method in deal.II follows in many respects the outlines of the various publications by James Bramble, Joseph Pasciak and Jinchao Xu. In order to understand many of the options, a rough familiarity with their work is quite helpful. -
+ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/results.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/results.dox similarity index 100% rename from deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/results.html rename to deal.II/doc/tutorial/chapter-2.step-by-step/step-16.data/results.dox diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-vectors.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-vectors.jpg deleted file mode 100644 index e32ec8c20f..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-vectors.jpg and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-x.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-x.jpg deleted file mode 100644 index 306bc68dde..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-x.jpg and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-y.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-y.jpg deleted file mode 100644 index 3028b9f6e9..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/displacement-y.jpg and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/final-grid.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/final-grid.jpg deleted file mode 100644 index 2fbccd2521..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/final-grid.jpg and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/results.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/results.dox similarity index 70% rename from deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/results.html rename to deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/results.dox index 9f7c98cdf3..bc6a11423e 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/results.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/results.dox @@ -1,50 +1,47 @@+ There is not much to be said about the results of this program, apart from that they look nice. All images were made using GMV from the output files that the program wrote to disk. The first picture shows the displacement as a vector field, where one vector is shown at each vertex of the grid: -
-- -
-+@image html step-8.vectors.png + + You can clearly see the sources of x-displacement around x=0.5 and x=-0.5, and of y-displacement at the origin. The next image shows the final grid after eight steps of refinement: -
-- -
-+@image html step-8.grid.png + + + Finally, the x-displacement and y-displacement are displayed separately: -
-+ +
- +@image html step-8.x.png | - +@image html step-8.y.png |
+ + It should be noted that intuitively one would have expected the solution to be symmetric about the x- and y-axes since the x- and y-forces are symmetric with respect to these axes. However, the force considered as a vector is not symmetric and consequently neither is the solution. -
+ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.grid.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.grid.png new file mode 100644 index 0000000000..8dbd79f5fc Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.grid.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.vectors.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.vectors.png new file mode 100644 index 0000000000..ff7f082fe9 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.vectors.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.x.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.x.png new file mode 100644 index 0000000000..d961789ac4 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.x.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.y.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.y.png new file mode 100644 index 0000000000..9ae4f77872 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-8.data/step-8.y.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-grid.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-grid.gif deleted file mode 100644 index d468124836..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-grid.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-solution.jpeg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-solution.jpeg deleted file mode 100644 index e891149bae..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/final-solution.jpeg and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/results.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/results.dox similarity index 84% rename from deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/results.html rename to deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/results.dox index eace7e86f0..0217858a78 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/results.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/results.dox @@ -1,12 +1,11 @@
+
The results of this program are not particularly spectacular. They
consist of the console output, some grid files, and the solution on
the finest grid. First for the console output:
-
-
+@endcode
As can be seen, quite a number of cells is used on the finest level to
resolve the features of the solution. The final grid showing this is
displayed in the following picture:
-
+@code
Cycle 0:
Number of active cells: 256
Number of degrees of freedom: 289
@@ -25,31 +24,27 @@ Cycle 4:
Cycle 5:
Number of active cells: 26002
Number of degrees of freedom: 30035
-
-
- -
-+@image html step-9.grid.png + + + The structure of the grid will be understandable by looking at the solution itself: -
-- -
-+@image html step-9.solution.png + + + Note that the solution is created by that part that is transported along the wiggled advection field from the left and lower boundaries to the top right, and the part that is created by the source in the lower left corner, and the results of which are also transported along. The grid shown above is well-adapted to resolve these features. -
\ No newline at end of file diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/step-9.grid.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/step-9.grid.png new file mode 100644 index 0000000000..2c28509099 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/step-9.grid.png differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/step-9.solution.png b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/step-9.solution.png new file mode 100644 index 0000000000..e5164f3f50 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-9.data/step-9.solution.png differ