From: wolf Date: Wed, 12 Sep 2001 13:40:01 +0000 (+0000) Subject: Add new testcase. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03b117be8003210597d0ad44fb4571a8522e2f02;p=dealii-svn.git Add new testcase. git-svn-id: https://svn.dealii.org/trunk@4973 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html b/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html index 5c3b1d9985..22fbbbee79 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html @@ -77,6 +77,12 @@ Step 9

+ +
  • +

    + Step 10 +

    +
  • diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q1_ref0.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q1_ref0.jpg new file mode 100644 index 0000000000..f03629236d Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q1_ref0.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q1_ref1.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q1_ref1.jpg new file mode 100644 index 0000000000..70029f7281 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q1_ref1.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q2_ref0.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q2_ref0.jpg new file mode 100644 index 0000000000..fe7c9b6916 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q2_ref0.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q2_ref1.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q2_ref1.jpg new file mode 100644 index 0000000000..d3a8110f11 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q2_ref1.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q3_ref0.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q3_ref0.jpg new file mode 100644 index 0000000000..2652050a28 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q3_ref0.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q3_ref1.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q3_ref1.jpg new file mode 100644 index 0000000000..7f4494c077 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/ball_mapping_q3_ref1.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/intro.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/intro.html new file mode 100644 index 0000000000..a460d933ea --- /dev/null +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/intro.html @@ -0,0 +1,60 @@ + +

    Introduction

    + +

    +This is a rather short example which only shows some aspects of using +higher order mappings. By mapping we mean the transformation +between the unit cell (i.e. the unit line, square, or cube) to the +cells in real space. In all the previous examples, we have implicitly +used linear or d-linear mappings; you will not have notices this at +all, since this is what happens if you do not do anything +special. However, if your domain has curved boundaries, there are +cases where the piecewise linear approximation of the boundary +(i.e. by straight line segments) is not sufficient, and you want that +your computational domain is an approximation to the real domain using +curved boundaries as well. If the boundary approximation uses +piecewise quadratic parabolas to approximate the true boundary, then +we say that this is a quadratic or Q2 approximation. If we +use piecewise graphs of cubic polynomials, then this is a Q3 +approximation, and so on. +

    + +

    +For some differential equations, it is known that piecewise linear +approximations of the boundary, i.e. Q1 mappings, are not +sufficient if the boundary of the domain is curved. Examples are the +biharmonic equation using C1 elements, or the Euler +equation. 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 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 mappings, we do only a brief computation: +calculating the value of pi=3.141592653589793238462643... 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 hp+1, where h is the mesh +width. We will check the values of the computed area of the circle and +their convergence towards pi under mesh refinement for different +mappings. We will also find a convergence behavior that is surprising +at first, but has a good explanation. +

    + +

    +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. +

    diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q1.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q1.jpg new file mode 100644 index 0000000000..1a48333ca7 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q1.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q2.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q2.jpg new file mode 100644 index 0000000000..48989bd740 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q2.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q3.jpg b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q3.jpg new file mode 100644 index 0000000000..63e22dc451 Binary files /dev/null and b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/quarter-q3.jpg differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/results.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/results.html new file mode 100644 index 0000000000..dd5ae80078 --- /dev/null +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-10.data/results.html @@ -0,0 +1,188 @@ + +

    Results

    + +

    +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 +

    +set data style lines
    +set size 0.721, 1
    +set nokey
    +plot [-1:1][-1:1] "ball0_mapping_q1.dat"
    +
    +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 +these pictures in acceptable quality, view them one by one. + + + + + + + + + + + + + + + +
    + Q1 mapping, coarse grid + + Q1 mapping, once refined grid +
    + Q2 mapping, coarse grid + + Q2 mapping, once refined grid +
    + Q3 mapping, coarse grid + + Q3 mapping, once refined grid +
    +These pictures show the obvious advantage of higher order mappings: +they approximate the true boundary quite well also on rather coarse +meshes. To demonstrate this a little further, the following table +shows the upper right quarter of the circle of the coarse mesh, and +with dashed lines the exact circle: + + + + + + +
    + Q1 mapping, coarse grid + + Q2 mapping, coarse grid + + Q3 mapping, coarse grid +
    +The quadratic mapping obviously quite well approximates the +boundary, while for the cubic mapping the difference between +approximated domain and true one is hardly visible already for the +coarse grid. +

    + +

    +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: +

    +Computation of Pi by the area:
    +==============================
    +Order = 1
    +cells         eval.pi         error                           
    +5       1.9999999999999998      1.1416e+00      -
    +20      2.8284271247461898      3.1317e-01      1.87
    +80      3.0614674589207178      8.0125e-02      1.97
    +320     3.1214451522580520      2.0148e-02      1.99
    +1280    3.1365484905459389      5.0442e-03      2.00
    +5120    3.1403311569547521      1.2615e-03      2.00
    +
    +Order = 2
    +cells         eval.pi         error                           
    +5       3.1045694996615869      3.7023e-02      -
    +20      3.1391475703122276      2.4451e-03      3.92
    +80      3.1414377167038303      1.5494e-04      3.98
    +320     3.1415829366419019      9.7169e-06      4.00
    +1280    3.1415920457576907      6.0783e-07      4.00
    +5120    3.1415926155921126      3.7998e-08      4.00
    +
    +Order = 3
    +cells         eval.pi         error                           
    +5       3.1465390309173475      4.9464e-03      -
    +20      3.1419461263297386      3.5347e-04      3.81
    +80      3.1416154689089382      2.2815e-05      3.95
    +320     3.1415940909713274      1.4374e-06      3.99
    +1280    3.1415927436051230      9.0015e-08      4.00
    +5120    3.1415926592185492      5.6288e-09      4.00
    +
    +Order = 4
    +cells         eval.pi         error                           
    +5       3.1418185737113964      2.2592e-04      -
    +20      3.1415963919525050      3.7384e-06      5.92
    +80      3.1415927128397780      5.9250e-08      5.98
    +320     3.1415926545188264      9.2903e-10      5.99
    +1280    3.1415926536042722      1.4479e-11      6.00
    +5120    3.1415926535899668      1.7343e-13      6.38
    +
    +
    +Computation of Pi by the perimeter:
    +===================================
    +Order = 1
    +cells         eval.pi         error                           
    +5       2.8284271247461903      3.1317e-01      -
    +20      3.0614674589207183      8.0125e-02      1.97
    +80      3.1214451522580524      2.0148e-02      1.99
    +320     3.1365484905459393      5.0442e-03      2.00
    +1280    3.1403311569547525      1.2615e-03      2.00
    +5120    3.1412772509327729      3.1540e-04      2.00
    +
    +Order = 2
    +cells         eval.pi         error                           
    +5       3.1248930668550599      1.6700e-02      -
    +20      3.1404050605605454      1.1876e-03      3.81
    +80      3.1415157631807014      7.6890e-05      3.95
    +320     3.1415878042798613      4.8493e-06      3.99
    +1280    3.1415923498174538      3.0377e-07      4.00
    +5120    3.1415926345932004      1.8997e-08      4.00
    +
    +Order = 3
    +cells         eval.pi         error                           
    +5       3.1442603311164286      2.6677e-03      -
    +20      3.1417729561193588      1.8030e-04      3.89
    +80      3.1416041192612365      1.1466e-05      3.98
    +320     3.1415933731961760      7.1961e-07      3.99
    +1280    3.1415926986118001      4.5022e-08      4.00
    +5120    3.1415926564043946      2.8146e-09      4.00
    +
    +Order = 4
    +cells         eval.pi         error                           
    +5       3.1417078926581086      1.1524e-04      -
    +20      3.1415945317216001      1.8781e-06      5.94
    +80      3.1415926832497720      2.9660e-08      5.98
    +320     3.1415926540544636      4.6467e-10      6.00
    +1280    3.1415926535970535      7.2602e-12      6.00
    +5120    3.1415926535899010      1.0805e-13      6.07
    +
    +

    + +

    +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 for Q4 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 +finest grid the accuracy is significantly worse than on the coarse +grid for a Q4 mapping! +

    + +

    +The last column of the output shows the convergence order, in powers +of the mesh width h. In the introduction, we had stated that +the convergence order for a Qp mapping should be +hp+1. However, in the example shown, the Q2 and Q4 +mappings show a convergence order of hp+2! This at +first surprising fact is readily explained by the particular boundary +we have here. In fact, the circle is described by the function +sqrt(1-x2), which has the series expansion +1-x2/2-x4/8-x6/16+... +around x=0. Thus, for the quadratic mapping where the +truncation error of the quadratic approximation should be cubic, there +is no such term but only a quartic one, which raises the convergence +order to 4, instead of 3. The same happens for the Q4 mapping. +

    diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html b/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html index 16785e8fea..8a2f794707 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html @@ -111,6 +111,11 @@ At present, the following programs exist: the system of equations in parallel using multi-threading, implementing a refinement criterion based on a finite difference approximation of the gradient. + +
    Step 10
    +
    What's new: Higher order mappings. Do not + solve equations, but rather compute the value of pi to high + accuracy.