Manual For GMSH V2.0
Manual For GMSH V2.0
Manual For GMSH V2.0
Intro
Gmsh is a software package that can create 2D/3D finite element meshes very easily. It
is developed by Prof. Christophe Geuzaine at Dept. of Electrical Engineering and
Computer Science, University of Lige. Download link is:
http://www.geuz.org/gmsh/doc/texinfo/
Since there is a step-by-step tutorial about how to generating a 2D mesh using Gmsh on
its website (http://geuz.org/gmsh/doc/gui_tutorial/), here I will just describe the general
idea and process of creating a 2D mesh, and how to get the nodes and elements data
from the resulting file.
General Process
The mesh of Gmsh is described by 3 levels, points, lines, and surface. You first create
several points on the plane and specify their coordinates, then connect those points into
lines. This will give you a general portrait of the mesh. The 3 rd step is to specify a
surface by combining several adjacent lines to form a close region, and you can also
specify a hole in this region by combining other lines in the similar way. The region in
that surface but not in the hole will use the setting of that surface to generate mesh,
while the hole doesnt. A hole is a region that will not generate mesh nodes in it. To set
different node density in this region, you have to specify the hole as another surface in
the same method mentioned before, then the Gmsh will create mesh nodes in this area
as well.
Menu Operation
To create points:
Set Geometry, choose Elementary entities -> Add -> New -> Point.
To create lines:
Set Geometry, choose Elementary entities -> Add -> New.
You can choose to create a straight line, or circle arc, or other shapes as you need.
You have to specify which points should be used to create this line.
To create surface:
Set Geometry, choose Elementary entities -> Add -> New -> Plane surface.
You have to specify which lines should be used to create this surface. And after that
you will be asked automatically if you want to create a hole in this surface.
To generate 2D meshes:
Set Mesh, and then press 2D. The resolution of the mesh is controlled by the
Notes; when you specifying points or lines, press e means to confirm and end this
selection, press q means quit and make no selection.
(1)
{50,
0,For
0,each
1};point, the first 3 parameters are the X-Y-Z coordinates, the last parameter specify the resolution aroun
Specify 4Point
points of
the =
outer
circle.
Point (2) = {0, 50, 0, 1};
Point (3) = {-50, 0, 0, 1};
Point (4) = {0, -50, 0, 1};
Point
Point
Point
Point
(5)
(6)
(7)
(8)
=
=
=
=
{40, 0, 0, 5};
{0, 40, 0, 5};
{-40, 0, 0, 5};
{0, -40, 0, 5};
{1,
{2,
{3,
{4,
9,
9,
9,
9,
2};
3};
4};
1};
Specify 3 points to create a circle arc. Connect 4 circle arcs to form an entire outer circle
Circle
Circle
Circle
Circle
(1)
(2)
(3)
(4)
Circle
Circle
Circle
Circle
Using the Line Loop 11, which is the boundary defined above, to create a surface
Plane Surface (11) = {11};
Similar as above. Redefine the hole above into another surface. Then you can generate a mesh with different resolutio
Line Loop (12) = {6, 7, 8, 5};
Plane Surface (12) = {12};