From b7f31e5f644422f7685b0673e983c939008a666c Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 24 Feb 2013 19:14:30 +0000 Subject: [PATCH] Various edits around the tutorial programs. git-svn-id: https://svn.dealii.org/trunk@28539 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/doxygen/tutorial/toc-list.html | 4 +- deal.II/doc/doxygen/tutorial/toc-topics.html | 4 +- deal.II/examples/step-1/doc/results.dox | 4 ++ deal.II/examples/step-1/doc/tooltip | 2 +- deal.II/examples/step-49/doc/intro.dox | 73 +++++++++++--------- deal.II/examples/step-49/doc/tooltip | 2 +- 6 files changed, 51 insertions(+), 38 deletions(-) diff --git a/deal.II/doc/doxygen/tutorial/toc-list.html b/deal.II/doc/doxygen/tutorial/toc-list.html index 71095b6c91..e5b0b8c627 100644 --- a/deal.II/doc/doxygen/tutorial/toc-list.html +++ b/deal.II/doc/doxygen/tutorial/toc-list.html @@ -15,9 +15,9 @@

Tutorial programs listed by number

- +
- + diff --git a/deal.II/doc/doxygen/tutorial/toc-topics.html b/deal.II/doc/doxygen/tutorial/toc-topics.html index 11617f66cb..ca8b5a6bea 100644 --- a/deal.II/doc/doxygen/tutorial/toc-topics.html +++ b/deal.II/doc/doxygen/tutorial/toc-topics.html @@ -4,7 +4,7 @@ Step-by-Step - + @@ -16,7 +16,7 @@

Tutorial programs grouped by topics

-
Step-1Step-1 Creating a grid. A simple way to write it to a file.
+
diff --git a/deal.II/examples/step-1/doc/results.dox b/deal.II/examples/step-1/doc/results.dox index fcbf4f4ff0..751a3910b8 100644 --- a/deal.II/examples/step-1/doc/results.dox +++ b/deal.II/examples/step-1/doc/results.dox @@ -57,6 +57,10 @@ geometries for which deal.II can create meshes using the functions in the GridGenerator namespace. Take a look at what it provides and see how it could be used in a program like this. +We also discuss a variety of other ways to create and manipulate meshes to +step-49. + +

Comments about programming and debugging

We close with a comment about modifying or writing programs with deal.II in diff --git a/deal.II/examples/step-1/doc/tooltip b/deal.II/examples/step-1/doc/tooltip index 71927bda1d..ae43afaffd 100644 --- a/deal.II/examples/step-1/doc/tooltip +++ b/deal.II/examples/step-1/doc/tooltip @@ -1 +1 @@ -Creating a grid. Refining it. Writing it to a file +Creating a mesh. Refining it. Writing it to a file. diff --git a/deal.II/examples/step-49/doc/intro.dox b/deal.II/examples/step-49/doc/intro.dox index 8b61de71f3..2947b26d8e 100644 --- a/deal.II/examples/step-49/doc/intro.dox +++ b/deal.II/examples/step-49/doc/intro.dox @@ -1,18 +1,22 @@ -This program was made by Timo Heister. +This program was contributed by Timo Heister.

Introduction

This tutorial is an extension to step-1 and demonstrates several ways to -obtain more involved meshes. +obtain more involved meshes than the ones shown there. -Generating complex geometries is a challenging task, especially in 3 space +Generating complex geometries is a challenging task, especially in three space 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. -The example program shows some of ways to create and modify meshes for -computations and outputs them as .eps files. No other computations or adaptive -refinements are done. Please note that the example program does not show all -the ways to generate meshes that are discussed in this text. +This example program shows some of ways to create and modify meshes for +computations and outputs them as .eps 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 +example program does not show all the ways to generate meshes that are +discussed in this introduction. +

General concerns about meshes

@@ -27,6 +31,7 @@ in the initial mesh. That said, your mesh needs to capture the given geometry adequately. +

How to create meshes

There are several ways to create an initial mesh. Meshes can be modified or @@ -34,48 +39,53 @@ combined in many ways as discussed later on.

Using GridGenerator

-The easiest way to generate meshes is to use the GridGenerator, which is -already discussed in step-1. There are many different helper functions +The easiest way to generate meshes is to use the functions in namespace +GridGenerator, as already discussed in step-1. There are many different +helper functions available, including GridGenerator::hyper_cube(), GridGenerator::hyper_shell(), GridGenerator::hyper_ball(), GridGenerator::hyper_cube_with_cylindrical_hole(), ... +

Constructing your own mesh programmatically

-If the is no good fit in the GridGenerator class, you can always create a +If there is no good fit in the GridGenerator namespace for what you want to +do, you can always create a Triangulation in your program "by hand". For that, you need a list of vertices with their coordinates and a list of cells referencing those vertices. You can -find an example in the function create_coarse_grid in step-14. Additionally, -all the functions in GridGenerator are implemented in this fashion. +find an example in the function create_coarse_grid in step-14. +All the functions in GridGenerator are implemented in this fashion. - We are happy to accept more functions to be added to GridGenerator. So, if +We are happy to accept more functions to be added to GridGenerator. So, if you end up writing a function that might be useful for a larger audience, please contribute it. +

Importing from external programs

The class GridIn can read many different mesh formats from a file from disk. How this is done is explained in step-5 and can be seen in the function -grid_1 in this example. +grid_1 in this example, see the code below. Meshes can be generated from different tools like gmsh, lagrit and cubit. See the +href="http://geuz.org/gmsh/" target="_top">gmsh, lagrit and cubit. See the documentation of GridIn for more information. The problem is that deal.II needs meshes that only consist of quads and hexas -- tetrahedral 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 -quickest to set up open source tool, that we know of. It can generate -unstructured 2d quad based meshes, but in 3d it can only extrude 2d meshes to -get hexahedral meshes. 3D meshing of unstructured geometry into hexas is not -supported at the time of writing. - -A mesh is described in a text based .geo file, that can be edited by hand and -can contain computations, loops, variables, etc.. It is very flexible. The +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 be edited by +hand and +can contain computations, loops, variables, etc. It is very flexible. The mesh is 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 build from +line loops, which is build from a list of lines, which are in turn built from points. It is important that file contains "physical lines" and "physical @@ -88,12 +98,12 @@ under the "Geometry" tab. This tutorial contains an example .geo file, that describes a box with two objects cut out in the interior. This is how untitled.geo looks like in gmsh -(displaying the boundary indicators): +(displaying the boundary indicators): @image html gmsh_picture.png Mesh displayed in Gmsh You might want to open the .geo file in a text editor to see how it is structured. Deal.II can read the .msh format written by gmsh. You generate the -.msh from the .geo by running: +.msh from the .geo by running:
 gmsh -2 untitled.geo
@@ -131,7 +141,7 @@ a sin curve:
          regular input mesh
     
     
Basic techniques Step-1 - output mesh + output mesh
@@ -146,7 +156,7 @@ of this tutorial: regular input mesh - wall-adapted output mesh + wall-adapted output mesh @@ -160,7 +170,7 @@ demonstrated in grid_7() and the result is as follows: regular input mesh - perturbed output mesh + perturbed output mesh @@ -249,6 +259,5 @@ above. This is the output from grid_4(): - change boundary indicators - relax inner vertices - Database of unstructured meshes for convergence studies -- discuss GridTools::extract_boundary_mesh +- discuss GridTools::extract_boundary_mesh - how to remove or disable a cell inside a mesh - diff --git a/deal.II/examples/step-49/doc/tooltip b/deal.II/examples/step-49/doc/tooltip index 9580c289af..9975ca8578 100644 --- a/deal.II/examples/step-49/doc/tooltip +++ b/deal.II/examples/step-49/doc/tooltip @@ -1 +1 @@ -How to create and modify advanced grids. +How to create and modify meshes. -- 2.39.5