[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Gmsh's mesh module regroups several 1D, 2D and 3D mesh algorithms, all producing grids conforming in the sense of finite elements (see section 1.2 Mesh: finite element mesh generation).
The 2D unstructured algorithms generate triangles or both triangles and
quadrangles (when Recombine Surface
is used: see 4.2.3 Miscellaneous). The 3D unstructured algorithm only generates tetrahedra.
The 2D structured algorithms (transfinite, elliptic and extrusion) generate
triangles by default, but quadrangles can be obtained by using the
Recombine
commands (see 4.2.2 Structured grids, and
4.2.3 Miscellaneous). The 3D structured algorithms generate
tetrahedra, hexahedra, prisms and pyramids, depending on the type of the
surface meshes they are based on.
4.1 Elementary vs. physical entities 4.2 Mesh commands 4.3 Mesh options
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If only elementary geometrical entities are defined (or if the
Mesh.SaveAll
option is set; see 4.3 Mesh options), the grid
produced by the mesh module will be saved "as is". That is, all the
elements in the grid will be saved to disk using the identification number
of the elementary entities they discretize as their region number
(see section 9.1 Gmsh mesh file format). This can sometimes be inconvenient:
To remedy these problems, the geometry module introduces the notion of "physical" entities (see section 3. Geometry module). The purpose of physical entities is to assemble elementary entities into larger, possibly overlapping groups, and to control the orientation of the elements in these groups. If physical entities are defined, the output mesh only contains those elements that belong to physical entities. The introduction of such physical entities in large models usually greatly facilitates the manipulation of the model (e.g. using `Tools->Visibility' in the GUI) and the interfacing with external solvers.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The mesh module commands mostly permit to modify the characteristic lengths and specify structured grid parameters. The actual mesh "actions" (i.e., "mesh the lines", "mesh the surfaces" and "mesh the volumes") cannot be specified in the input ASCII text input files. They have to be given either in the GUI or on the command line (see 8. Running Gmsh, and 8.2 Command-line options).
4.2.1 Characteristic lengths 4.2.2 Structured grids 4.2.3 Miscellaneous
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The `size' of a mesh element is defined as the length of the segment for a line segment, the radius of the circumscribed circle for a triangle and the radius of the circumscribed sphere for a tetrahedron. There are three main ways to specify the size of the mesh elements for a given geometry:
Point
command: see 3.1.1 Points). The actual size of
the mesh elements will be computed by linearly interpolating these
characteristic lengths on the initial mesh (see 1.2 Mesh: finite element mesh generation). This might
sometimes lead to over-refinement in some areas, so that you may have to add
"dummy" geometrical entities in the model in order to get the desired
element sizes.
This method works with all the algorithms implemented in the mesh module. The final element sizes are of course constrained by the structured algorithms for which the element sizes are explicitly specified (e.g. transfinite and extruded grids: see 4.2.2 Structured grids).
Attractor
command below.
Attractors only work with the 2D anisotropic algorithm (see the
Mesh.Algorithm
option in 4.3 Mesh options).
Mesh.ConstrainedBackgroundMesh
option is set.
This method only works with the isotropic 1D, 2D and 3D algorithm, and is
not currently available with the Triangle algorithm. To load a background
mesh, use the -bgm
command-line option (see section 8.2 Command-line options)
or select `Apply as background mesh' in the post-processing view option
menu.
Here are the mesh commands that are related to the specification of characteristic lengths:
Attractor Point | Line { expression-list } = { expression, expression, expression };
Mesh.Algorithm
in 4.3 Mesh options). An example of the use of attractors is given in
7.7 `t7.geo'.
Please note that attractors are an experimental feature (to be considered at most alpha-quality...). Use at your own risk.
Characteristic Length { expression-list } = expression;
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Extrude Point | Line | Surface { expression, { expression-list } } { layers; ... } ;
layers: Layers { { expression-list }, < { expression-list }, > { expression-list } }; | Recombine; | |
The first expression-list defines how many elements should be created in each extruded layer. The (optional) second expression-list assigns a region number to each layer, which, if non-zero, overrides the elementary entity number of the extruded entity. This is useful when there is more than one layer, as the elements in each layer can then be identified in a unique way. If the region number is set to zero, or if the expression-list is omitted, the elements are associated with the automatically created elementary geometrical entity (line, surface or volume) created during the extrusion. The last expression-list gives the normalized height of each layer (the list should contain a sequence of n numbers 0 < h1 < h2 < ... < hn <= 1). See 7.3 `t3.geo', for an example.
For line extrusions, the Recombine
option will recombine triangles
into quadrangles when possible. For surface extrusions, the
Recombine
option will recombine tetrahedra into prisms, hexahedra or
pyramids.
Extrude Point | Line | Surface { expression, { expression-list }, { expression-list }, expression } { layers; ... };
Extrude Point | Line | Surface { expression, { expression-list }, { expression-list }, { expression-list }, expression } { layers; ... };
Transfinite Line { expression-list } = expression < Using Progression | Bump expression >
Using Progression expression
' instructs the
transfinite algorithm to distribute the nodes following a geometric
progression (Progression 2
meaning for example that each line element
in the series will be twice as long as the preceding one). The optional
argument `Using Bump expression
' instructs the transfinite
algorithm to distribute the nodes with a refinement at both ends of the
line. (A deprecated synonym for Progression
is Power
.)
Transfinite Surface { expression } = { expression-list };
Transfinite Volume { expression } = { expression-list };
Elliptic Surface { expression } = { expression-list };
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here is a list of all other mesh commands currently available:
Color color-expression { Point | Line | Surface | Volume { expression-list }; ... }
Hide { Point | Line | Surface | Volume { expression-list }; ... }
General.VisibilityMode
is set to 0
or 2
.
Hide char-expression;
General.VisibilityMode
is set to 0
or 2
(char-expression can for example be "*"
).
Recombine Surface { expression-list } < = expression >;
Save char-expression;
Mesh.Format
(see section 4.3 Mesh options).
Show { Point | Line | Surface | Volume { expression-list }; ... }
General.VisibilityMode
is set to 0
or 2
.
Show char-expression;
General.VisibilityMode
is set to 0
or 2
(char-expression can for example be "*"
).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mesh options control the behavior of mesh commands, as well as the way meshes are displayed in the graphical user interface. For the signification of the `Saved in:' field in the following list, see 2.7 General options.
Mesh.TriangleOptions
"praqzBPY"
General.OptionsFileName
Mesh.Algorithm
1
General.OptionsFileName
Mesh.Algorithm3D
1
General.OptionsFileName
Mesh.AllowDegeneratedExtrude
0
-
Mesh.CharacteristicLengthFactor
1
General.OptionsFileName
Mesh.ColorCarousel
1
General.OptionsFileName
Mesh.ColorScheme
0
General.OptionsFileName
Mesh.ConstrainedBackgroundMesh
0
General.OptionsFileName
Mesh.CpuTime
0
-
Mesh.CutPlane
0
-
Mesh.CutPlaneAsSurface
0
-
Mesh.CutPlaneA
1
-
Mesh.CutPlaneB
0
-
Mesh.CutPlaneC
0
-
Mesh.CutPlaneD
0
-
Mesh.Dual
0
General.OptionsFileName
Mesh.ElementOrder
1
General.OptionsFileName
Mesh.Explode
1
General.OptionsFileName
Mesh.Format
1
General.OptionsFileName
Mesh.GammaInf
0
General.OptionsFileName
Mesh.GammaSup
0
General.OptionsFileName
Mesh.Interactive
0
General.OptionsFileName
Mesh.Light
0
General.OptionsFileName
Mesh.LightTwoSide
1
General.OptionsFileName
Mesh.Lines
0
General.OptionsFileName
Mesh.LineNumbers
0
General.OptionsFileName
Mesh.LineType
0
General.OptionsFileName
Mesh.LineWidth
1
General.OptionsFileName
Mesh.MinimumCirclePoints
7
General.OptionsFileName
Mesh.MshFileVersion
1
General.OptionsFileName
Mesh.NbHexahedra
0
-
Mesh.NbNodes
0
-
Mesh.NbPrisms
0
-
Mesh.NbPyramids
0
-
Mesh.NbQuadrangles
0
-
Mesh.NbTetrahedra
0
-
Mesh.NbTriangles
0
-
Mesh.Normals
0
General.OptionsFileName
Mesh.Optimize
0
General.OptionsFileName
Mesh.Points
1
General.OptionsFileName
Mesh.PointInsertion
1
General.OptionsFileName
Mesh.PointNumbers
0
General.OptionsFileName
Mesh.PointSize
4
General.OptionsFileName
Mesh.PointType
0
General.OptionsFileName
Mesh.RadiusInf
0
General.OptionsFileName
Mesh.RadiusSup
0
General.OptionsFileName
Mesh.RandomFactor
0.0001
General.OptionsFileName
Mesh.SaveAll
0
-
Mesh.ScalingFactor
1
General.OptionsFileName
Mesh.Smoothing
1
General.OptionsFileName
Mesh.SpeedMax
0
General.OptionsFileName
Mesh.SurfaceEdges
1
General.OptionsFileName
Mesh.SurfaceFaces
0
General.OptionsFileName
Mesh.SurfaceNumbers
0
General.OptionsFileName
Mesh.Tangents
0
General.OptionsFileName
Mesh.VertexArrays
1
General.OptionsFileName
Mesh.VolumeEdges
1
General.OptionsFileName
Mesh.VolumeFaces
0
General.OptionsFileName
Mesh.VolumeNumbers
0
General.OptionsFileName
Mesh.Color.Points
{0,255,0}
General.OptionsFileName
Mesh.Color.PointsSup
{255,0,255}
General.OptionsFileName
Mesh.Color.Lines
{0,255,0}
General.OptionsFileName
Mesh.Color.Triangles
{160,150,255}
General.OptionsFileName
Mesh.Color.Quadrangles
{130,120,225}
General.OptionsFileName
Mesh.Color.Tetrahedra
{160,150,255}
General.OptionsFileName
Mesh.Color.Hexahedra
{130,120,225}
General.OptionsFileName
Mesh.Color.Prisms
{232,210,23}
General.OptionsFileName
Mesh.Color.Pyramids
{217,113,38}
General.OptionsFileName
Mesh.Color.Tangents
{255,255,0}
General.OptionsFileName
Mesh.Color.Normals
{255,0,0}
General.OptionsFileName
Mesh.Color.One
{232,210,23}
General.OptionsFileName
Mesh.Color.Two
{226,167,29}
General.OptionsFileName
Mesh.Color.Three
{217,113,38}
General.OptionsFileName
Mesh.Color.Four
{201,54,54}
General.OptionsFileName
Mesh.Color.Five
{169,12,86}
General.OptionsFileName
Mesh.Color.Six
{114,2,141}
General.OptionsFileName
Mesh.Color.Seven
{67,30,188}
General.OptionsFileName
Mesh.Color.Eight
{44,86,211}
General.OptionsFileName
Mesh.Color.Nine
{32,145,223}
General.OptionsFileName
Mesh.Color.Ten
{25,193,230}
General.OptionsFileName
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |