From: heister Date: Sun, 17 Feb 2013 05:58:40 +0000 (+0000) Subject: update step-49 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fa16fe86006ce584a6913044aa94ebb9d765b50;p=dealii-svn.git update step-49 git-svn-id: https://svn.dealii.org/trunk@28435 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-49/doc/intro.dox b/deal.II/examples/step-49/doc/intro.dox index ae625fb7e1..9feea29700 100644 --- a/deal.II/examples/step-49/doc/intro.dox +++ b/deal.II/examples/step-49/doc/intro.dox @@ -100,7 +100,8 @@ gmsh -2 untitled.geo 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 + +

Merge Meshes

use GridGenerator::merge_triangulations() @@ -133,9 +136,36 @@ example: @image html step-49.grid-2.png +

Move Vertices

move individual vertices, first identify cells/vertices @image html step-49.grid-3.png + + +

Extrude Meshes

+ +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 + + + + + + + + +
+ @image html step-49.grid-4base.png test + + @image html step-49.grid-4.png +
+ + diff --git a/deal.II/examples/step-49/doc/results.dox b/deal.II/examples/step-49/doc/results.dox index 675d2d5305..9e18b462df 100644 --- a/deal.II/examples/step-49/doc/results.dox +++ b/deal.II/examples/step-49/doc/results.dox @@ -3,17 +3,6 @@ The program has, after having been run, produced two grids, which look like this: - - - - - - -
- @image html step-1.grid-1.png - - @image html step-1.grid-2.png -

Possible extensions

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 index e7edc253dd..0000000000 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 index 8dc1d31d6a..0000000000 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 index 0000000000..ff8d5cefc0 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 index 0000000000..f18de2c8dd Binary files /dev/null and b/deal.II/examples/step-49/doc/step-49.grid-4base.png differ diff --git a/deal.II/examples/step-49/step-49.cc b/deal.II/examples/step-49/step-49.cc index 3e564a9f3a..a9851a4d8d 100644 --- a/deal.II/examples/step-49/step-49.cc +++ b/deal.II/examples/step-49/step-49.cc @@ -37,12 +37,12 @@ void mesh_info(Triangulation &tria, const char *filename) // loop over all the cells and find how often each boundary indicator is used: { std::map boundary_count; - Triangulation<2>::active_cell_iterator + typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); for (; cell!=endc; ++cell) { - for (unsigned int face=0; face::faces_per_cell; ++face) + for (unsigned int face=0; face::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 (); }