From 332a199f3f99d3e7ced91f441bfaac0f9fe5c3a0 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 22 Apr 2018 19:44:43 -0400 Subject: [PATCH] Update step-10 for 9.0. This commit changes the output (which was altered as a result of the new TFI scheme for placing new vertices) and the manifold handling (which was altered by the 'attach default manifolds to triangulations' change in GridGenerator). --- doc/doxygen/stylesheet.css | 12 ++ examples/step-10/doc/results.dox | 211 +++++++++++++++++-------------- examples/step-10/step-10.cc | 22 +--- 3 files changed, 131 insertions(+), 114 deletions(-) diff --git a/doc/doxygen/stylesheet.css b/doc/doxygen/stylesheet.css index 9f4191b68b..9e4f9f201f 100644 --- a/doc/doxygen/stylesheet.css +++ b/doc/doxygen/stylesheet.css @@ -45,3 +45,15 @@ div.image img[src="fe_enriched_1d.png"] { div.image img[src="fe_enriched_h-refinement.png"] { width:500px; } + +/* + * environment for aligning pictures in two columns. + */ +.twocolumn { + display: grid; + grid-template-columns: 1fr 1fr; + grid-column-gap: 5%; + grid-row-gap: 5%; + margin-left: auto; + margin-right: auto; +} diff --git a/examples/step-10/doc/results.dox b/examples/step-10/doc/results.dox index a81bf44e41..7f4a5c6b34 100644 --- a/examples/step-10/doc/results.dox +++ b/examples/step-10/doc/results.dox @@ -8,54 +8,58 @@ graphics. They are generated in Gnuplot format, and can be viewed with the commands @code set style data lines -set size 0.721, 1 +set size ratio -1 unset key -plot [-1:1][-1:1] "ball_0_mapping_q_1.dat" +unset xtics +unset ytics +plot [-1:1][-1:1] "ball_0_mapping_q_1.dat" lw4 lt rgb "black" @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 -these pictures in acceptable quality, view them one by one. - - - - - - - - - - - - - - - - -
- -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: - - - - - - - -
+right now. Similarly, the third and fourth disable tic marks. + +The following table shows the triangulated computational domain for $Q_1$, +$Q_2$, and $Q_3$ mappings, for the original coarse grid (left), and a once +uniformly refined grid (right). + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +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, here is part of the upper right quarter +circle of the coarse meshes with $Q_2$ and $Q_3$ mappings, where the dashed +red line marks the actual circle: + +
+
+ +
+
+ +
+
Obviously the quadratic mapping approximates the boundary quite well, while for the cubic mapping the difference between approximated domain @@ -73,81 +77,93 @@ cells. 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 +Output of grids into gnuplot files: +=================================== +Refinement level: 0 +Degree = 1 +Degree = 2 +Degree = 3 + +Refinement level: 1 +Degree = 1 +Degree = 2 +Degree = 3 + Computation of Pi by the area: ============================== Degree = 1 -cells eval.pi error - 5 1.9999999999999993 1.1416e+00 - - 20 2.8284271247461894 3.1317e-01 1.87 - 80 3.0614674589207178 8.0125e-02 1.97 - 320 3.1214451522580520 2.0148e-02 1.99 - 1280 3.1365484905459393 5.0442e-03 2.00 - 5120 3.1403311569547534 1.2615e-03 2.00 +cells eval.pi error + 5 1.9999999999999993 1.1416e+00 - + 20 2.8284271247461890 3.1317e-01 1.87 + 80 3.0614674589207174 8.0125e-02 1.97 + 320 3.1214451522580511 2.0148e-02 1.99 + 1280 3.1365484905459380 5.0442e-03 2.00 + 5120 3.1403311569547516 1.2615e-03 2.00 Degree = 2 -cells eval.pi error - 5 3.1045694996615865 3.7023e-02 - - 20 3.1391475703122271 2.4451e-03 3.92 - 80 3.1414377167038303 1.5494e-04 3.98 - 320 3.1415829366419015 9.7169e-06 4.00 - 1280 3.1415920457576911 6.0783e-07 4.00 - 5120 3.1415926155921139 3.7998e-08 4.00 +cells eval.pi error + 5 3.1045694996615860 3.7023e-02 - + 20 3.1391475703122267 2.4451e-03 3.92 + 80 3.1414377167038290 1.5494e-04 3.98 + 320 3.1415829366419006 9.7169e-06 4.00 + 1280 3.1415920457576898 6.0783e-07 4.00 + 5120 3.1415926155921117 3.7998e-08 4.00 Degree = 3 -cells eval.pi error - 5 3.1410033851499310 5.8927e-04 - - 20 3.1415830393583861 9.6142e-06 5.94 - 80 3.1415925017363837 1.5185e-07 5.98 - 320 3.1415926512106722 2.3791e-09 6.00 - 1280 3.1415926535525962 3.7197e-11 6.00 - 5120 3.1415926535892140 5.7923e-13 6.00 +cells eval.pi error + 5 3.1410033851499288 5.8927e-04 - + 20 3.1415830393583839 9.6142e-06 5.94 + 80 3.1415925017363797 1.5185e-07 5.98 + 320 3.1415926512106696 2.3791e-09 6.00 + 1280 3.1415926535525927 3.7200e-11 6.00 + 5120 3.1415926535892100 5.8302e-13 6.00 Degree = 4 -cells eval.pi error - 5 3.1415871927401127 5.4608e-06 - - 20 3.1415926314742437 2.2116e-08 7.95 - 80 3.1415926535026228 8.7170e-11 7.99 - 320 3.1415926535894529 3.4036e-13 8.00 - 1280 3.1415926535897927 2.9187e-16 10.19 - 5120 3.1415926535897944 1.3509e-15 -2.21 +cells eval.pi error + 5 3.1415871927401131 5.4608e-06 - + 20 3.1415926314742428 2.2116e-08 7.95 + 80 3.1415926535026202 8.7173e-11 7.99 + 320 3.1415926535894498 3.4350e-13 7.99 + 1280 3.1415926535897896 3.4671e-15 6.63 + 5120 3.1415926535897909 2.4009e-15 0.53 Computation of Pi by the perimeter: =================================== Degree = 1 -cells eval.pi error - 5 2.8284271247461898 3.1317e-01 - - 20 3.0614674589207178 8.0125e-02 1.97 - 80 3.1214451522580520 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 +cells eval.pi error + 5 2.8284271247461898 3.1317e-01 - + 20 3.0614674589207178 8.0125e-02 1.97 + 80 3.1214451522580520 2.0148e-02 1.99 + 320 3.1365484905459389 5.0442e-03 2.00 + 1280 3.1403311569547525 1.2615e-03 2.00 + 5120 3.1412772509327724 3.1540e-04 2.00 Degree = 2 -cells eval.pi error - 5 3.1248930668550594 1.6700e-02 - - 20 3.1404050605605449 1.1876e-03 3.81 - 80 3.1415157631807014 7.6890e-05 3.95 - 320 3.1415878042798617 4.8493e-06 3.99 - 1280 3.1415923498174534 3.0377e-07 4.00 - 5120 3.1415926345932004 1.8997e-08 4.00 +cells eval.pi error + 5 3.1248930668550594 1.6700e-02 - + 20 3.1404050605605449 1.1876e-03 3.81 + 80 3.1415157631807009 7.6890e-05 3.95 + 320 3.1415878042798613 4.8493e-06 3.99 + 1280 3.1415923498174534 3.0377e-07 4.00 + 5120 3.1415926345931995 1.8997e-08 4.00 Degree = 3 -cells eval.pi error - 5 3.1414940401456057 9.8613e-05 - - 20 3.1415913432549156 1.3103e-06 6.23 - 80 3.1415926341726914 1.9417e-08 6.08 - 320 3.1415926532906893 2.9910e-10 6.02 - 1280 3.1415926535851360 4.6571e-12 6.01 - 5120 3.1415926535897203 7.2845e-14 6.00 +cells eval.pi error + 5 3.1414940401456048 9.8613e-05 - + 20 3.1415913432549156 1.3103e-06 6.23 + 80 3.1415926341726910 1.9417e-08 6.08 + 320 3.1415926532906897 2.9910e-10 6.02 + 1280 3.1415926535851355 4.6578e-12 6.00 + 5120 3.1415926535897190 7.4216e-14 5.97 Degree = 4 -cells eval.pi error - 5 3.1415921029432576 5.5065e-07 - - 20 3.1415926513737600 2.2160e-09 7.96 - 80 3.1415926535810712 8.7218e-12 7.99 - 320 3.1415926535897594 3.3668e-14 8.02 - 1280 3.1415926535897922 1.0617e-15 4.99 - 5120 3.1415926535897931 1.0061e-16 3.40 +cells eval.pi error + 5 3.1415921029432572 5.5065e-07 - + 20 3.1415926513737595 2.2160e-09 7.96 + 80 3.1415926535810712 8.7222e-12 7.99 + 320 3.1415926535897576 3.5525e-14 7.94 + 1280 3.1415926535897936 4.6729e-16 6.25 + 5120 3.1415926535897918 1.4929e-15 -1.68 @endcode @@ -173,4 +189,3 @@ order 2p. Even though these points are here only used for interpolation of a pth order polynomial, we get a superconvergence effect when numerically evaluating the integral that actually gives this high order of convergence. - diff --git a/examples/step-10/step-10.cc b/examples/step-10/step-10.cc index 23eee7aeb7..88469c70f8 100644 --- a/examples/step-10/step-10.cc +++ b/examples/step-10/step-10.cc @@ -75,15 +75,13 @@ namespace Step10 std::cout << "Output of grids into gnuplot files:" << std::endl << "===================================" << std::endl; - // So first generate a coarse triangulation of the circle and - // associate a suitable boundary description to it. Note that the - // default value of the argument to the SphericalManifold - // constructor is a center at the origin. + // So first generate a coarse triangulation of the circle and associate a + // suitable boundary description to it. By default, + // GridGenerator::hyper_ball attaches a SphericalManifold to the boundary + // (and uses FlatManifold for the interior) so we simply call that + // function and move on: Triangulation triangulation; GridGenerator::hyper_ball (triangulation); - static const SphericalManifold boundary; - triangulation.set_all_manifold_ids_on_boundary(0); - triangulation.set_manifold (0, boundary); // Next generate output for this grid and for a once refined grid. Note // that we have hidden the mesh refinement in the loop header, which might @@ -134,7 +132,7 @@ namespace Step10 // sufficient to give us the impression of seeing a curved line, // rather than a set of straight lines. GridOut grid_out; - GridOutFlags::Gnuplot gnuplot_flags(false, 30); + GridOutFlags::Gnuplot gnuplot_flags(false, 60); grid_out.set_flags(gnuplot_flags); // Finally, generate a filename and a file for output: @@ -207,10 +205,6 @@ namespace Step10 Triangulation triangulation; GridGenerator::hyper_ball (triangulation); - static const SphericalManifold boundary; - triangulation.set_all_manifold_ids_on_boundary (0); - triangulation.set_manifold(0, boundary); - const MappingQ mapping (degree); // We now create a dummy finite element. Here we could choose any @@ -344,10 +338,6 @@ namespace Step10 Triangulation triangulation; GridGenerator::hyper_ball (triangulation); - static const SphericalManifold boundary; - triangulation.set_all_manifold_ids_on_boundary (0); - triangulation.set_manifold (0, boundary); - const MappingQ mapping (degree); const FE_Q fe (1); -- 2.39.5