]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
update step-49
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 17 Feb 2013 05:58:40 +0000 (05:58 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 17 Feb 2013 05:58:40 +0000 (05:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@28435 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-49/doc/intro.dox
deal.II/examples/step-49/doc/results.dox
deal.II/examples/step-49/doc/step-1.grid-1.png [deleted file]
deal.II/examples/step-49/doc/step-1.grid-2.png [deleted file]
deal.II/examples/step-49/doc/step-49.grid-4.png [new file with mode: 0644]
deal.II/examples/step-49/doc/step-49.grid-4base.png [new file with mode: 0644]
deal.II/examples/step-49/step-49.cc

index ae625fb7e1cea733bea2befcd7db77e2283fc8fe..9feea2970012a2cfe7e73a93ae149d7ae001f013 100644 (file)
@@ -100,7 +100,8 @@ gmsh -2 untitled.geo
 </pre>
 
 or by clicking "Mesh" and then "2D" inside Gmsh after loading the file.  Now
-this is the mesh read from the .msh file and saved again by deal.II as an image (see the grid_1 function: 
+this is the mesh read from the .msh file and saved again by deal.II as an
+image (see the grid_1 function):
 
 @image html step-49.grid-1.png
 
@@ -112,7 +113,7 @@ modify a mesh:
   - change boundary indicators
   - move vertices
   - transform via smooth function
-  - perturb mesh
+  - perturb/randomize mesh
   - relax inner vertices?
 
 other things to mention:
@@ -122,6 +123,8 @@ other things to mention:
 GridTools::rotate
  GridTools::scale
 
+
+
 <h4>Merge Meshes</h4>
 
 use GridGenerator::merge_triangulations()
@@ -133,9 +136,36 @@ example:
 @image html step-49.grid-2.png
 
 
+
 <h4>Move Vertices</h4>
 
 move individual vertices, first identify cells/vertices
 
 @image html step-49.grid-3.png
 
+
+
+<h4>Extrude Meshes</h4>
+
+GridGenerator::extrude_triangulation()
+
+see grid_4() function in this tutorial.
+
+this example can of course be generated using the 3d hyper_cube_with_cylindrical_hole().
+
+usage for meshes generated from gmsh for example
+
+
+<TABLE WIDTH="60%" ALIGN="center">
+  <tr>
+    <td ALIGN="center">
+      @image html step-49.grid-4base.png test
+    </td>
+
+    <td ALIGN="center">
+      @image html step-49.grid-4.png
+    </td>
+  </tr>
+</table>
+
+
index 675d2d530526e32503b86b91325a3838064f4275..9e18b462df90c65d413557510d2adf734508bdde 100644 (file)
@@ -3,17 +3,6 @@
 The program has, after having been run, produced two grids, which look
 like this:
 
-<TABLE WIDTH="60%" ALIGN="center">
-  <tr>
-    <td ALIGN="center">
-      @image html step-1.grid-1.png
-    </td>
-
-    <td ALIGN="center">
-      @image html step-1.grid-2.png
-    </td>
-  </tr>
-</table>
 
 
 <h3> Possible extensions </h3>
diff --git a/deal.II/examples/step-49/doc/step-1.grid-1.png b/deal.II/examples/step-49/doc/step-1.grid-1.png
deleted file mode 100644 (file)
index e7edc25..0000000
Binary files a/deal.II/examples/step-49/doc/step-1.grid-1.png and /dev/null differ
diff --git a/deal.II/examples/step-49/doc/step-1.grid-2.png b/deal.II/examples/step-49/doc/step-1.grid-2.png
deleted file mode 100644 (file)
index 8dc1d31..0000000
Binary files a/deal.II/examples/step-49/doc/step-1.grid-2.png and /dev/null differ
diff --git a/deal.II/examples/step-49/doc/step-49.grid-4.png b/deal.II/examples/step-49/doc/step-49.grid-4.png
new file mode 100644 (file)
index 0000000..ff8d5ce
Binary files /dev/null and b/deal.II/examples/step-49/doc/step-49.grid-4.png differ
diff --git a/deal.II/examples/step-49/doc/step-49.grid-4base.png b/deal.II/examples/step-49/doc/step-49.grid-4base.png
new file mode 100644 (file)
index 0000000..f18de2c
Binary files /dev/null and b/deal.II/examples/step-49/doc/step-49.grid-4base.png differ
index 3e564a9f3aab892b1eade8791752009008d20985..a9851a4d8dd46efce821c1f820631d9c34e697ec 100644 (file)
@@ -37,12 +37,12 @@ void mesh_info(Triangulation<dim> &tria, const char *filename)
   // loop over all the cells and find how often each boundary indicator is used:
   {
     std::map<unsigned int, unsigned int> boundary_count;
-    Triangulation<2>::active_cell_iterator
+    typename Triangulation<dim>::active_cell_iterator
     cell = tria.begin_active(),
     endc = tria.end();
     for (; cell!=endc; ++cell)
       {
-        for (unsigned int face=0; face<GeometryInfo<2>::faces_per_cell; ++face)
+        for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
           {
             if (cell->face(face)->at_boundary())
               boundary_count[cell->face(face)->boundary_indicator()]++;
@@ -136,6 +136,18 @@ void grid_3 ()
   triangulation.set_boundary (1);
 }
 
+// demonstrate extrude_triangulation
+void grid_4()
+{
+  Triangulation<2> triangulation;
+  Triangulation<3> out;
+  GridGenerator::hyper_cube_with_cylindrical_hole (triangulation, 0.25, 1.0);
+
+  GridGenerator::extrude_triangulation(triangulation, 3, 2.0, out);
+  mesh_info(out, "grid-4.eps");
+  
+}
+
 
 
 // @sect3{The main function}
@@ -147,4 +159,5 @@ int main ()
   grid_1 ();
   grid_2 ();
   grid_3 ();
+  grid_4 ();
 }

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.