[ < ] | [ > ] | [ << ] | [ 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 algorithms only
generate tetrahedra.
The 2D structured algorithms (transfinite 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 elementary
region number (and 0 as their physical region number(6); 9. File formats). This can sometimes be inconvenient:
To remedy these problems, the geometry module (see section 3. Geometry module) introduces the notion of "physical" entities (also called "physical groups"). 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. The introduction of 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.
In the MSH file format (see section 9. File formats), if physical entities are defined, the output mesh only contains those elements that belong to physical entities. Other file formats each treat physical entities in slightly different ways, depending on their capability to define groups.
[ < ] | [ > ] | [ << ] | [ 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.3 Command-line options).
4.2.1 Characteristic lengths 4.2.2 Structured grids 4.2.3 Miscellaneous
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are two ways to specify the size of the mesh elements for a given geometry:
Point
command: see 3.1.1 Points). The size of the
mesh elements will then 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).
PostView
field specifies an explicit background mesh in the
form of a scalar post-processing view (see 6.1 Post-processing commands, and 9. File formats) in which the nodal values are the
target element sizes. This method is very general but it requires a
first (usually rough) mesh and a way to compute the target sizes on this
mesh (usually through an error estimation procedure, in an iterative
process of mesh adaptation).
(Note that you can also load a background mesh directly from the command
line using the -bgm
option (see section 8.3 Command-line options), or in
the GUI by selecting `Apply as background mesh' in the post-processing
view option menu.)
Box
field specifies the size of the elements inside and outside
of a parallelipipedic region.
Threshold
field specifies the size of the mesh according to the
distance to some geometrical entities. These entities can for example be
geometry points and lines specified by an Attractor
field.
MathEval
field specifies the size of the mesh using an explicit
mathematical function.
Min
field specifies the size as the minimum of the sizes
computed using other fields
Mesh.ConstrainedBackgroundMesh
option is set.
Fields are supported by all the algorithms except those based on Netgen.
Here are the mesh commands that are related to the specification of characteristic lengths:
Characteristic Length { expression-list } = expression;
Field[expression] = string;
Field[expression].string = char-expression | expression | expression-list;
Background Field = expression;
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Extrude { expression-list } { extrude-list layers }
layers: Layers { expression } | Layers { { expression-list }, { expression-list } } | Recombine; ... |
In the first Layers
form, expression gives the number of
elements to be created in the (single) layer. In the second form, the
first expression-list defines how many elements should be created
in each extruded layer, and the second 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.
Please note that, starting with Gmsh 2.0, region numbers cannot be
specified explicitly anymore in Layers
commands. Instead, as with
all other geometry commands, you must use the automatically created
entity identifier created by the extrusion command. For example, the
following extrusion command will return the id of the new "top"
surface in num[0]
and the id of the new volume in num[1]
:
num[] = Extrude {0,0,1} { Surface{1}; Layers{10}; }; |
Extrude { { expression-list }, { expression-list }, expression } { extrude-list layers }
Extrude { { expression-list }, { expression-list }, { expression-list }, expression } { extrude-list layers }
Extrude { Surface { expression-list }; 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 } < Left | Right | Alternate > ;
Transfinite Volume { 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). If the path in
char-expression is not absolute, char-expression is appended to
the path of the current file.
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 "*"
).
Smoother Surface { expression-list } = expression;
[ < ] | [ > ] | [ << ] | [ 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.Algorithm
1
General.OptionsFileName
Mesh.Algorithm3D
1
General.OptionsFileName
Mesh.AngleSmoothNormals
30
General.OptionsFileName
Mesh.AllowSwapAngle
10
General.OptionsFileName
Mesh.BdfFieldFormat
1
General.OptionsFileName
Mesh.C1Continuity
0
General.OptionsFileName
Mesh.CharacteristicLengthExtendFromBoundary
1
General.OptionsFileName
Mesh.CharacteristicLengthFactor
1
General.OptionsFileName
Mesh.CharacteristicLengthMin
0
General.OptionsFileName
Mesh.CharacteristicLengthMax
1e+22
General.OptionsFileName
Mesh.CharacteristicLengthFromCurvature
0
General.OptionsFileName
Mesh.CharacteristicLengthFromPoints
1
General.OptionsFileName
Mesh.ColorCarousel
1
General.OptionsFileName
Mesh.CpuTime
0
-
Mesh.DrawSkinOnly
0
General.OptionsFileName
Mesh.Dual
0
General.OptionsFileName
Mesh.ElementOrder
1
General.OptionsFileName
Mesh.Explode
1
General.OptionsFileName
Mesh.Format
1
General.OptionsFileName
Mesh.Hexahedra
1
General.OptionsFileName
Mesh.LabelsFrequency
100
General.OptionsFileName
Mesh.LabelType
0
General.OptionsFileName
Mesh.Light
1
General.OptionsFileName
Mesh.LightLines
1
General.OptionsFileName
Mesh.LightTwoSide
1
General.OptionsFileName
Mesh.Lines
0
General.OptionsFileName
Mesh.LineNumbers
0
General.OptionsFileName
Mesh.LineWidth
1
General.OptionsFileName
Mesh.MinimumCirclePoints
7
General.OptionsFileName
Mesh.MinimumCurvePoints
3
General.OptionsFileName
Mesh.MshBinary
0
General.OptionsFileName
Mesh.MshFileVersion
2
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.OptimizeNetgen
0
General.OptionsFileName
Mesh.Points
0
General.OptionsFileName
Mesh.PointNumbers
0
General.OptionsFileName
Mesh.PointSize
4
General.OptionsFileName
Mesh.PointType
0
General.OptionsFileName
Mesh.Prisms
1
General.OptionsFileName
Mesh.Pyramids
1
General.OptionsFileName
Mesh.Quadrangles
1
General.OptionsFileName
Mesh.QualityInf
0
General.OptionsFileName
Mesh.QualitySup
0
General.OptionsFileName
Mesh.QualityType
2
General.OptionsFileName
Mesh.RadiusInf
0
General.OptionsFileName
Mesh.RadiusSup
0
General.OptionsFileName
Mesh.RandomFactor
1e-09
General.OptionsFileName
Mesh.RefineSteps
10
General.OptionsFileName
Mesh.RecombineAlgo
1
General.OptionsFileName
Mesh.ReverseAllNormals
0
General.OptionsFileName
Mesh.SaveAll
0
-
Mesh.SaveGroupsOfNodes
0
-
Mesh.ScalingFactor
1
General.OptionsFileName
Mesh.SecondOrderExperimental
0
General.OptionsFileName
Mesh.SecondOrderIncomplete
1
General.OptionsFileName
Mesh.SecondOrderLinear
0
General.OptionsFileName
Mesh.LcIntegrationPrecision
1e-09
General.OptionsFileName
Mesh.Smoothing
1
General.OptionsFileName
Mesh.SmoothInternalEdges
0
General.OptionsFileName
Mesh.SmoothNormals
0
General.OptionsFileName
Mesh.StlBinary
0
General.OptionsFileName
Mesh.SurfaceEdges
1
General.OptionsFileName
Mesh.SurfaceFaces
0
General.OptionsFileName
Mesh.SurfaceNumbers
0
General.OptionsFileName
Mesh.Tangents
0
General.OptionsFileName
Mesh.Tetrahedra
1
General.OptionsFileName
Mesh.Triangles
1
General.OptionsFileName
Mesh.VolumeEdges
1
General.OptionsFileName
Mesh.VolumeFaces
0
General.OptionsFileName
Mesh.VolumeNumbers
0
General.OptionsFileName
Mesh.Color.Points
{0,0,255}
General.OptionsFileName
Mesh.Color.PointsSup
{255,0,255}
General.OptionsFileName
Mesh.Color.Lines
{0,0,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.Zero
{255,120,0}
General.OptionsFileName
Mesh.Color.One
{255,160,0}
General.OptionsFileName
Mesh.Color.Two
{255,200,0}
General.OptionsFileName
Mesh.Color.Three
{255,240,0}
General.OptionsFileName
Mesh.Color.Four
{228,255,0}
General.OptionsFileName
Mesh.Color.Five
{188,255,0}
General.OptionsFileName
Mesh.Color.Six
{148,255,0}
General.OptionsFileName
Mesh.Color.Seven
{108,255,0}
General.OptionsFileName
Mesh.Color.Eight
{68,255,0}
General.OptionsFileName
Mesh.Color.Nine
{0,255,52}
General.OptionsFileName
Mesh.Color.Ten
{0,255,132}
General.OptionsFileName
Mesh.Color.Eleven
{0,255,192}
General.OptionsFileName
Mesh.Color.Twelve
{0,216,255}
General.OptionsFileName
Mesh.Color.Thirteen
{0,176,255}
General.OptionsFileName
Mesh.Color.Fourteen
{0,116,255}
General.OptionsFileName
Mesh.Color.Fifteen
{0,76,255}
General.OptionsFileName
Mesh.Color.Sixteen
{24,0,255}
General.OptionsFileName
Mesh.Color.Seventeen
{84,0,255}
General.OptionsFileName
Mesh.Color.Eighteen
{104,0,255}
General.OptionsFileName
Mesh.Color.Nineteen
{184,0,255}
General.OptionsFileName
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |