From 13d9e063e4bf5b10b9ad689b2e8a5716209d2745 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 14 Jan 2020 17:15:29 -0700 Subject: [PATCH] Better document gmsh's features. --- examples/step-49/doc/intro.dox | 41 ++++++++++++++++++++++---------- include/deal.II/gmsh/utilities.h | 2 +- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/examples/step-49/doc/intro.dox b/examples/step-49/doc/intro.dox index a2b82dbc46..54aee436cd 100644 --- a/examples/step-49/doc/intro.dox +++ b/examples/step-49/doc/intro.dox @@ -78,20 +78,24 @@ meshes won't work (this means tools like tetgen can not be used directly). We will describe a possible workflow using Gmsh. Gmsh is the smallest and most quickly set up open source tool we are aware of. It can generate -unstructured 2d quad meshes, but in 3d it can only extrude 2d meshes to -get hexahedral meshes. 3D meshing of unstructured geometry into hexahedra is not -supported at the time of writing this tutorial (early 2013). - -In Gmsh, a mesh is described in a text based .geo file, that can -contain computations, loops, variables, etc. It is very flexible. The mesh is -generated from a surface representation, which is built from a list of line +unstructured 2d quad meshes. In 3d, it can extrude 2d meshes to +get hexahedral meshes; 3D meshing of unstructured geometry into hexahedra is +possible, though there are some issues with the quality of these meshes +that imply that these meshes only sometimes work in deal.II. + +In Gmsh, a mesh is fundamentally described in a text-based +.geo file whose format can +contain computations, loops, variables, etc. This format is quite flexible +in allowing the description of complex geometries. The mesh is then +generated from a surface representation, which is build from a list of line loops, which is build from a list of lines, which are in turn built from points. The .geo script can be written and edited by hand or it can be generated automatically by creating objects graphically inside Gmsh. In many cases it is best to combine both approaches. The file can be easily -reloaded by pressing "reload" under the "Geometry" tab. +reloaded by pressing "reload" under the "Geometry" tab if you want to write +it by hand and see the effects in the graphical user interface of gmsh. -This tutorial contains an example .geo file, that describes a box +This tutorial contains an example .geo file that describes a box with two objects cut out in the interior. This is how example.geo looks like in Gmsh (displaying the boundary indicators as well as the mesh discussed further down below): @@ -107,9 +111,9 @@ numbers. "Physical" object are the ones that carry information about the boundary indicator (see @ref GlossBoundaryIndicator "this glossary entry"). @note It is important that this file contain "physical lines" and "physical -surfaces". These give the boundary indicators and material ids for use -in deal.II. Without these physical entities, nothing will be imported into -deal.II. + surfaces". These give the boundary indicators and material ids for use + in deal.II. Without these physical entities, nothing will be imported into + deal.II. deal.II's GridIn class can read the .msh format written by Gmsh and that contains a mesh created for the geometry described by the @@ -127,6 +131,19 @@ of the current program): +@note gmsh has a number of other interfaces by which one can describe + geometries to it. In particular, it has the ability to interface with + scripting languages like Python and Julia, but it can also be scripted + from C++. These interfaces are useful if one doesn't just want to generate + a mesh for a single geometry (in which case the graphical interface or, + in simple cases, a hand-written `.geo` file is probably the simplest + approach), but instead wants to do parametric studies over the geometry + for which it is necessary to generate many meshes for geometries that + differ in certain parameters. Another case where this is useful is if there + is already a CAD geometry for which one only needs a mesh; indeed, this + can be done from within deal.II using the + Gmsh::create_triangulation_from_boundary_curve() function. +

Modifying a Mesh

diff --git a/include/deal.II/gmsh/utilities.h b/include/deal.II/gmsh/utilities.h index 2ccc02ee33..cf73198ed3 100644 --- a/include/deal.II/gmsh/utilities.h +++ b/include/deal.II/gmsh/utilities.h @@ -82,7 +82,7 @@ namespace Gmsh # ifdef DEAL_II_WITH_OPENCASCADE /** - * Given a smooth closed curve creates a triangulation from it using + * Given a smooth closed curve, create a triangulation from it using * Gmsh. * * The input curve @p boundary should be closed. -- 2.39.5