Code_Aster ®
Version
7.4
Titrate:
Interface file of grid GMSH with Aster


Date:
07/06/05
Author (S):
Key COURTEOUS Mr.
:
U3.02.01-B Page
: 1/4

Organization (S): EDF-R & D/AMA
Handbook of Utilization
U3.0- booklet: Grid
Document: U3.02.01
Interface file of grid GMSH with Aster

Summary:

GMSH is a tool for modelling, grid and postprocessing diffused under license GNU LPG
(executable http://www.geuz.org/gmsh,, sources and documentation available on this site).

One describes here the principle of the interface which makes it possible to use in Aster a file resulting from GMSH.

This interface is implemented in Aster by command PRE_GMSH [U7.01.31].
Handbook of Utilization
U3.0- booklet: Grid HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Interface file of grid GMSH with Aster


Date:
07/06/05
Author (S):
Key COURTEOUS Mr.
:
U3.02.01-B Page
: 2/4

1
Use of GMSH

GMSH is a free or regulated tool for grid which integrates a modeller and functionalities of post-
processing. The modeller, easy to use, allows to prepare the grid of structures by
geometrical constructions (creation of lines, surfaces, translations/rotations, extrusions…).
The model of the structure can be built interactivement (with the mouse) or by a file of
commands.
The documentation of GMSH is available at this address (it is possible that this direct link is
modified, pass by the welcome page in this case): http://www.geuz.org/gmsh/doc/texinfo/gmsh.html.

The description of the geometry of the structure is contained in a file .geo, the produced grid
is recorded with the extension .msh; this file which will be converted by command PRE_GMSH with
Aster format.

2
Entities GMSH and Aster groups

The modeller of GMSH handles points, lines, surfaces or volumes as entities
geometrical (nonwith a grid). Grid GMSH is built by netting in this order the lines, them
surfaces then the volumes supported on those.

In general, one handles parts of the grid to apply the properties materials, them
boundary conditions or the loadings. To reach these under-parts of the grid, it is
necessary to define “physical” in GMSH. A physical is made up of one or more
geometrical entities. The GMSH-Aster interface produces a group of meshs for each physical: if
the physical 21 consists of two volumes, the group of mesh GM21 contains the meshs of these
two volumes.

Note:

In GMSH, one visualizes the entities constituting a physical by small Tools/Visibility
and by selecting the number. One can then use command DEFI_GROUP in
Aster to handle a more explicit name of group of meshs.

Caution:

Physicals should not be created gathering others physicals, because that would lead to
to produce double meshs.
The number of the physicals must be lower than 1.000.000.

Handbook of Utilization
U3.0- booklet: Grid HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Interface file of grid GMSH with Aster


Date:
07/06/05
Author (S):
Key COURTEOUS Mr.
:
U3.02.01-B Page
: 3/4

3 Examples

3.1
Geometry and grid GMSH

A very simple geometry is created: a square on side 1. Here, one creates the points, the lines, surface;
one could also have done it by translation/extrusion…

NB:

One creates a physical which contains the square surface of number 107.

L=1;
d=0.45;

Not (1) = {0, 0, 0, D};
Not (2) = {L, 0, 0, D};
Not (3) = {L, L, 0, D};
Not (4) = {0, L, 0, D};
Line (1) = {1, 2};
Line (2) = {2, 3};
Line (3) = {3, 4};
Line (4) = {4, 1};
Line Loop (106) = {2, 3, 4, 1};
Plane Surface (6) = {106};
Physical Surfaces (107) = {6};

The grid created with the anisotropic algorithm 2D is:



The file of grid GMSH contains the description of the nodes and the meshs:

$NOD
9
1 0 0 0
2 1 0 0
3 1 1 0
4 0 1 0
5 0.4999999999999931 0 0
6 1 0.4999999999999931 0
7 0.500000000000007 1 0
8 0 0.500000000000007 0
13 0.5000000000000001 0.5 0
$ENDNOD
$ELM
8
1 2.107 6 3 13 1 5
Handbook of Utilization
U3.0- booklet: Grid HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Interface file of grid GMSH with Aster


Date:
07/06/05
Author (S):
Key COURTEOUS Mr.
:
U3.02.01-B Page
: 4/4

2 2.107 6 3 8 1 13
3 2.107 6 3 5 2 13
4 2.107 6 3 13 2 6
5 2.107 6 3 6 3 13
6 2.107 6 3 13 3 7
7 2.107 6 3 7 4 13
8 2.107 6 3 13 4 8
$ENDELM

The syntax of this file is described in the section “File formats/Gmsh mesh file format” of the handbook of
GMSH.

3.2
File of Aster grid produced by operator PRE_GMSH

TITER
AUTEUR=INTERFACE_GMSH DATE=17/07/2003
FINSF
%
COOR_3D NBOBJ=9
% FORMAT= (1 * NOM_DE_NOEUD, 3 * COORD)
N1 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
N2 1.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
N3 1.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
N4 0.00000000000000E+00 1.00000000000000E+00 0.00000000000000E+00
N5 4.99999999999993E-01 0.00000000000000E+00 0.00000000000000E+00
N6 1.00000000000000E+00 4.99999999999993E-01 0.00000000000000E+00
N7 5.00000000000007E-01 1.00000000000000E+00 0.00000000000000E+00
N8 0.00000000000000E+00 5.00000000000007E-01 0.00000000000000E+00
N13 5.00000000000000E-01 5.00000000000000E-01 0.00000000000000E+00
FINSF
%
TRIA3 NOM=INDEFINI NBOBJ=8
M1 N13 N1 N5
M2 N8 N1 N13
M3 N5 N2 N13
M4 N13 N2 N6
M5 N6 N3 N13
M6 N13 N3 N7
M7 N7 N4 N13
M8 N13 N4 N8
FINSF
%
GROUP_MA NOM=GM107
M1 m2 m3 M4 M5 M6 M7 M8
FINSF
%
FIN

The eight triangles composing the square with a grid are then accessible in Aster in the group from
net GM107.
Handbook of Utilization
U3.0- booklet: Grid HT-66/05/004/A

Outline document