Commit 70d6d2bb authored by Christophe Geuzaine's avatar Christophe Geuzaine

clarify physical groups

parent 1a185292
......@@ -1520,7 +1520,7 @@ Returns the next available surface loop tag.
@item newreg
Returns the next available region tag. That is, @code{newreg} returns
the maximum of @code{newp}, @code{newl}, @code{news}, @code{newv},
@code{newll}, @code{newsl} and all physical entity tags@footnote{For
@code{newll}, @code{newsl} and all physical group tags@footnote{For
compatibility purposes, the behavior of @code{newl}, @code{news},
@code{newv} and @code{newreg} can be modified with the
@code{Geometry.OldNewReg} option (@pxref{Geometry options list}).}.
......@@ -1820,13 +1820,13 @@ references them. Zero or negative tags are reserved by the system for
special uses: do not use them in your scripts.
Groups of elementary geometrical entities can also be defined and are
called ``physical'' entities. These physical entities cannot be modified
called ``physical'' groups. These physical groups cannot be modified
by geometry commands: their only purpose is to assemble elementary
entities into larger groups so that they can be referred to by the mesh
module as single entities. As is the case with elementary entities, each
physical point, physical curve, physical surface or physical volume must
be assigned a unique tag. See @ref{Mesh module}, for more information
about how physical entities affect the way meshes are saved.
about how physical groups affect the way meshes are saved.
@menu
* Geometry commands::
......@@ -2124,14 +2124,13 @@ the OpenCASCADE kernel.
@item Physical Volume ( @var{expression} | @var{char-expression} <, @var{expression}> ) <+|->= @{ @var{expression-list} @};
Creates a physical volume. The @var{expression} inside the parentheses
is the physical volume's tag; the
@var{expression-list} on the right hand side should contain the
tags of all the elementary volumes that need to be
grouped inside the physical volume. If a @var{char-expression} is given
instead instead of @var{expression} inside the parentheses, a string
label is associated with the physical tag, which can
be either provided explicitly (after the comma) or not (in which case a
unique tag is automatically created).
is the physical volume's tag; the @var{expression-list} on the right
hand side should contain the tags of all the elementary volumes that
need to be grouped inside the physical volume. If a
@var{char-expression} is given instead instead of @var{expression}
inside the parentheses, a string label is associated with the physical
tag, which can be either provided explicitly (after the comma) or not
(in which case a unique tag is automatically created).
@end ftable
......@@ -2498,7 +2497,7 @@ algorithm can be quite poor.
@menu
* Choosing the right unstructured algorithm::
* Elementary vs physical entities::
* Elementary entities vs physical groups::
* Mesh commands::
* Mesh options::
@end menu
......@@ -2507,7 +2506,7 @@ algorithm can be quite poor.
@c Choosing the right unstructured algorithm
@c -------------------------------------------------------------------------
@node Choosing the right unstructured algorithm, Elementary vs physical entities, Mesh module, Mesh module
@node Choosing the right unstructured algorithm, Elementary entities vs physical groups, Mesh module, Mesh module
@section Choosing the right unstructured algorithm
Gmsh currently provides a choice between three 2D unstructured
......@@ -2594,63 +2593,34 @@ produced by both algorithms is comparable. If element quality is
important the mesh optimizer(s) should be applied.
@c -------------------------------------------------------------------------
@c Elementary vs. physical entities
@c Elementary entities vs. physical groups
@c -------------------------------------------------------------------------
@node Elementary vs physical entities, Mesh commands, Choosing the right unstructured algorithm, Mesh module
@section Elementary vs. physical entities
@node Elementary entities vs physical groups, Mesh commands, Choosing the right unstructured algorithm, Mesh module
@section Elementary entities vs. physical groups
If only elementary geometrical entities are defined (or if the
@code{Mesh.SaveAll} option is set; see @ref{Mesh options list}), the
grid produced by the mesh module will be saved ``as is''. That is, all
the elements in the grid will be saved using the tag
of the elementary entities they discretize as their elementary region
tag (and 0 as their physical region tag@footnote{This behaviour
was introduced in Gmsh 2.0. In older versions, both the elementary and
the physical region tags would be set to the tag of
the elementary region.}; @ref{File formats}). This can sometimes be
inconvenient:
It is usually convenient to combine geometrical entities into more
meaningful groups, e.g. to define some mathematical (``domain'',
``boundary with Neumann condition''), functional (``left wing'',
``fuselage'') or material (``steel'', ``carbon'') properties. Such
grouping is done in Gmsh's geometry module (@pxref{Geometry module})
through ``physical groups''.
@itemize @bullet
@item
mesh elements cannot be duplicated;
@item
the orientation of the mesh elements (the ordering of their nodes) is
determined by the orientation of their ``parent'' elementary
entities;
@item
elements belonging to different elementary entities cannot be linked as
being part of a larger group having a physical or mathematical meaning (like
`Left wing', `Metallic part', `Dirichlet boundary condition', @dots{}).
@end itemize
By default in the MSH file format (@pxref{File formats}), if physical
groups are defined, the output mesh only contains those elements that
belong to at least one physical group. (Other file formats each treat
physical groups in slightly different ways, depending on their
capability to define groups.)
To remedy these problems, the geometry module (@pxref{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 when they are save into a
mesh file. 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 (@pxref{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.
Note that in some mesh file formats Gmsh reindexes the mesh nodes and
elements so that they are numbered in a continuous sequence in the
output files. Note that the numbers displayed on screen after mesh
generation can thus differ from the ones saved in the mesh files,
depending on the format. To check the actual numbers saved in the output
file just load the file back using `File->Open'.
To save all mesh element wether or not physical groups are defined, use
the @code{Mesh.SaveAll} option (@pxref{Mesh options list}) or specify
@code{-save_all} on the command line.
@c -------------------------------------------------------------------------
@c Mesh commands
@c -------------------------------------------------------------------------
@node Mesh commands, Mesh options, Elementary vs physical entities, Mesh module
@node Mesh commands, Mesh options, Elementary entities vs physical groups, Mesh module
@section Mesh commands
@cindex Mesh commands
......@@ -5565,10 +5535,10 @@ system and and the full geometry.
@item How can I only save tetrahedral elements (not triangles and lines)?
If physical entities are defined, the output mesh only contains those
elements that belong to physical entities. So to save only 3D elements,
simply define one (or more) physical volume(s) and don't define any
physical surfaces or curves.
By default, if physical groups are defined, the output mesh only
contains those elements that belong to physical entities. So to save
only 3D elements, simply define one (or more) physical volume(s) and
don't define any physical surfaces, physical curves or physical points.
@item My 2D meshes of IGES files present gaps between surfaces
......@@ -5627,7 +5597,7 @@ boundary conditions or material properties---this is a job best left to
the solver. Instead, Gmsh provides a simple mechanism to tag groups of
elements, and it is up to the solver to interpret these tags as boundary
conditions, materials, etc. Associating tags with elements in Gmsh is
done by defining Physical entities (Physical Points, Physical Curves,
done by defining physical groups (Physical Points, Physical Curves,
Physical Surfaces and Physical Volumes). See the reference manual as
well as the tutorials (in particular @ref{t1.geo}) for a detailed
description and some examples.
......
......@@ -52,47 +52,32 @@ Curve Loop(1) = {4,1,-2,3} ;
Plane Surface(1) = {1} ;
// At this level, Gmsh knows everything to display the rectangular surface 6 and
// to mesh it. An optional step is needed if we want to associate specific
// region numbers to the various elements in the mesh (e.g. to the line segments
// discretizing curves 1 to 4 or to the triangles discretizing surface 1). This
// is achieved by the definition of `physical entities'. Physical entities will
// group elements belonging to several elementary entities by giving them a
// common number (a region number).
// We can for example group the points 1 and 2 into the physical entity 1:
Physical Point(1) = {1,2} ;
// Consequently, two punctual elements will be saved in the output mesh file,
// both with the region number 1. The mechanism is identical for curve or surface
// elements:
// to mesh it. An optional step is needed if we want to group elementary
// geometrical entities in more meaningful groups, e.g. to define some
// mathematical ("domain", "boundary"), functional ("left wing", "fuselage") or
// material ("steel", "carbon") properties.
//
// Such groups are called "Physical Groups" in Gmsh. By default, if physical
// groups are defined, Gmsh will export in output files only those elements that
// belong to at least one physical group. (To force Gmsh to save all elements,
// whether they belong to physical groups or not, set "Mesh.SaveAll=1;", or
// specify "-save_all" on the command line.)
//
// Here we define physical curve that groups the left, bottom and right lines in
// a single group (with prescribed tag 5); and a physical surface with name "My
// surface" (with an automatic tag):
MY_CURVE = 2;
Physical Curve(MY_CURVE) = {1,2} ;
Physical Curve("My second curve (automatic physical tag)") = {3} ;
Physical Curve("My third curve (physical tag 5)", 5) = {4} ;
Physical Curve(5) = {1, 2, 4} ;
Physical Surface("My surface") = {1} ;
// All the line elements created during the meshing of curves 1 and 2 will be
// saved in the output mesh file with the physical tag 2. The elements from curve
// 3 will be saved in the output mesh file with an automatic physical id,
// associated with the label "My second curve (automatic physical tag)". The
// elements from curve 4 will be saved with physical tag 5, associated with the
// label "My third curve (physical tag 5)". And finally, all the triangular
// elements resulting from the discretization of surface 6 will be given an
// automatic physical id associated with the label "My surface").
//
// Note that if no physical entities are defined, then all the elements in the
// mesh will be saved "as is", with their default orientation.
// Starting with Gmsh 3.0, models can also be built using constructive solid
// geometry. Instead of the built-in geometry kernel, you need to use the
// OpenCASCADE kernel:
//
// SetFactory("OpenCASCADE");
//
// In addition to the "bottom-up" geometry commands, you can now use "top-down"
// commands, like e.g.
// In addition to the "bottom-up" geometry commands, you can then also use
// "top-down" commands, like e.g.
//
// Rectangle(2) = {.2, 0, 0, 0.1, 0.3};
//
......
......@@ -101,7 +101,7 @@ Characteristic Length {103, 105, 109, 102, 28, 24, 6, 5} = lc * 3;
//
// on the command line.
// To save all the tetrahedra discretizing the volumes 129 and 130 with a common
// region number, we finally define a physical volume:
// We finally group volumes 129 and 130 in a single physical group with tag "1"
// and name "The volume":
Physical Volume("The volume", 1) = {129,130};
......@@ -49,8 +49,8 @@ out[] = Extrude { {-2*h,0,0}, {1,0,0} , {0,0.15,0.25} , angle * Pi / 180 } {
// the "top" of the extruded surface (in out[0]), the newly created volume (in
// out[1]) and the ids of the lateral surfaces (in out[2], out[3], ...)
// We can then define a new physical volume to save all the tetrahedra with a
// common region number (101):
// We can then define a new physical volume (with tag 101) to group all the
// elementary volumes:
Physical Volume(101) = {1, 2, out[1]};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment