</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
- change boundary indicators
- move vertices
- transform via smooth function
- - perturb mesh
+ - perturb/randomize mesh
- relax inner vertices?
other things to mention:
GridTools::rotate
GridTools::scale
+
+
<h4>Merge Meshes</h4>
use GridGenerator::merge_triangulations()
@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>
+
+
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>
// 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()]++;
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}
grid_1 ();
grid_2 ();
grid_3 ();
+ grid_4 ();
}