]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-49: switch to vtu and add possible extensions
authorTimo Heister <timo.heister@gmail.com>
Wed, 7 Aug 2019 20:24:09 +0000 (14:24 -0600)
committerTimo Heister <timo.heister@gmail.com>
Wed, 7 Aug 2019 20:24:09 +0000 (14:24 -0600)
examples/step-49/doc/intro.dox
examples/step-49/doc/results.dox
examples/step-49/step-49.cc

index d84c9256926f4577a08a5c5644afe81de0f0afce..51fb958fecd1efba94de8b8edabdec6e616f67e4 100644 (file)
@@ -11,7 +11,7 @@ dimensions. We will discuss several ways to do this, but this list is not
 exhaustive. Additionally, there is not one approach that fits all problems.
 
 This example program shows some of ways to create and modify meshes for
-computations and outputs them as <code>.eps</code> files in much the same way
+computations and outputs them as <code>.vtu</code> files in much the same way
 as we do in step-1. No other computations or adaptive
 refinements are done; the idea is that you can use the techniques used here as
 building blocks in other, more involved simulators. Please note that the
@@ -279,14 +279,3 @@ just creating the mesh are necessary. We will go over some of these steps in
 the <a href="#Results">results section</a> below.
 
 
-<!--
-
-Possible Extensions
-
-- Modify a mesh:
-  - change boundary indicators
-  - relax inner vertices
-- Database of unstructured meshes for convergence studies
-- discuss GridTools::extract_boundary_mesh
-- how to remove or disable a cell inside a mesh
--->
index d7c0aa0510aeeae7ce503d76116df0b25a0c6f21..870823510d9dc0f4db46032b032cab97ec7a3579 100644 (file)
@@ -1,6 +1,6 @@
 <h1>Results</h1>
 
-The program produces a series of <code>.eps</code> files of the
+The program produces a series of <code>.vtu</code> files of the
 triangulations. The methods are discussed above.
 
 
@@ -328,3 +328,27 @@ the nice detail of the boundary fitted mesh if we refine two more times:
 
 <img src="https://www.dealii.org/images/steps/developer/step-49.yuhan.11.png"
      alt="" width="400" height="355">
+
+
+<h3> Possible extensions </h3>
+
+<h4> Modify a mesh </h4>
+
+Similar to the operations in step-1, iterate over a mesh and change boundary
+indicators.
+
+<h4> Extracting a boundary mesh </h4>
+
+To compute on surfaces on manifolds, you can use the function
+GridTools::extract_boundary_mesh() to extract the surface elements of a
+mesh. For example, using the function on a 3d mesh (a Triangulation<3,3>),
+this will return a Triangulation<2,3> that you can use in step-38 for example.
+
+
+<!--
+
+Possible Extensions for this tutorial:
+
+- Database of unstructured meshes for convergence studies
+- how to remove or disable a cell inside a mesh
+-->
index 2d2724a7301bee18d965fe279da0b20408d68bc4..abf6625b9ee80ae01b034637da69931d58e08083 100644 (file)
@@ -55,8 +55,8 @@ using namespace dealii;
 // - The number of boundary faces that use each boundary indicator, so that
 //   it can be compared with what we expect.
 //
-// Finally, the function outputs the mesh in encapsulated postscript (EPS)
-// format that can easily be visualized in the same way as was done in step-1.
+// Finally, the function outputs the mesh in VTU format that can easily be
+// visualized in Paraview or VisIt.
 template <int dim>
 void print_mesh_info(const Triangulation<dim> &triangulation,
                      const std::string &       filename)
@@ -95,7 +95,7 @@ void print_mesh_info(const Triangulation<dim> &triangulation,
   // file:
   std::ofstream out(filename);
   GridOut       grid_out;
-  grid_out.write_eps(triangulation, out);
+  grid_out.write_vtu(triangulation, out);
   std::cout << " written to " << filename << std::endl << std::endl;
 }
 
@@ -116,7 +116,7 @@ void grid_1()
   std::ifstream f("untitled.msh");
   gridin.read_msh(f);
 
-  print_mesh_info(triangulation, "grid-1.eps");
+  print_mesh_info(triangulation, "grid-1.vtu");
 }
 
 
@@ -142,7 +142,7 @@ void grid_2()
   Triangulation<2> triangulation;
   GridGenerator::merge_triangulations(tria1, tria2, triangulation);
 
-  print_mesh_info(triangulation, "grid-2.eps");
+  print_mesh_info(triangulation, "grid-2.vtu");
 }
 
 
@@ -191,7 +191,7 @@ void grid_3()
   // section</a> for a fully worked example where we <em>do</em> attach a
   // Manifold object).
   triangulation.refine_global(2);
-  print_mesh_info(triangulation, "grid-3.eps");
+  print_mesh_info(triangulation, "grid-3.vtu");
 }
 
 // There is one snag to doing things as shown above: If one moves the nodes on
@@ -221,7 +221,7 @@ void grid_4()
   GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, 0.25, 1.0);
 
   GridGenerator::extrude_triangulation(triangulation, 3, 2.0, out);
-  print_mesh_info(out, "grid-4.eps");
+  print_mesh_info(out, "grid-4.vtu");
 }
 
 
@@ -255,7 +255,7 @@ void grid_5()
       return {in[0], in[1] + std::sin(in[0] / 5.0 * numbers::PI)};
     },
     triangulation);
-  print_mesh_info(triangulation, "grid-5.eps");
+  print_mesh_info(triangulation, "grid-5.vtu");
 }
 
 
@@ -295,7 +295,7 @@ void grid_6()
                                             Point<2>(1.0, 1.0));
 
   GridTools::transform(Grid6Func(), triangulation);
-  print_mesh_info(triangulation, "grid-6.eps");
+  print_mesh_info(triangulation, "grid-6.vtu");
 }
 
 
@@ -318,14 +318,14 @@ void grid_7()
                                             Point<2>(1.0, 1.0));
 
   GridTools::distort_random(0.3, triangulation, true);
-  print_mesh_info(triangulation, "grid-7.eps");
+  print_mesh_info(triangulation, "grid-7.vtu");
 }
 
 
 // @sect3{The main function}
 
-// Finally, the main function. There isn't much to do here, only to call the
-// subfunctions.
+// Finally, the main function. There isn't much to do here, only to call all the
+// various functions we wrote above.
 int main()
 {
   try

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.