[Gmsh] Surface Loop: order in the surface list

Paolo Tricerri paolotricerri at gmail.com
Wed Oct 3 09:36:18 CEST 2012


Dear all,

I would like to define a volume starting from the surfaces which make
its boundary. Let's consider the simple case of a cube. I have defined
the six surfaces and now I would like to define a surface loop.

When I run the script for the creation of the mesh, I get that the 2D
entities are properly meshes while the volume is neither defined and
meshed. I guess the problem is in the definition of the surface loop.
I looked for some hints on the gmsh forum finding an old post (
http://geuz.org/pipermail/gmsh/2009/004627.html ) where the final
advice was to define the surface loop using the GUI. I cannot use the
GUI because I did not install it ( :( ).

My question is:

What defines the orientation of a surface? Its normal?  Does it have
to be inward the volume we want to consider or outward?

How the surfaces must be listed in the definition of the surface loop?
Any order (but with the proper orientation) is ok?

Many thanks,

Have a nice day,

Paolo

P.s. Hereafter there is the code (which is not for a cube but it does
not change) I have used to generate the surfaces:

lc = 0.1;
H= 0.44;
L = 0.48;
pH = 0.16;
thickness = pH/10;

// ############# POINTS ##############
//Base
Point(0) = {0, 0, 0, lc};
Point(1) = {0, H, 0, lc};
Point(2) = {L, H+pH, 0, lc};
Point(3) = {L, H, 0, lc};

Point(4) = {0, 0, thickness, lc};
Point(5) = {0, H, thickness, lc};
Point(6) = {L, H+pH, thickness, lc};
Point(7) = {L, H, thickness, lc};

//############### LINES ##############
//Base`
Line (1) = {0,1};
Line (2) = {1,2};
Line (3) = {2,3};
Line (4) = {3,0};

Line (5) = {4,5};
Line (6) = {5,6};
Line (7) = {6,7};
Line (8) = {7,4};

Line (9) = {0,4};
Line (10) = {1,5};
Line (11) = {3,7};
Line (12) = {2,6};

// ############# LINE LOOPS ############
Line Loop(1) = {1,2,3,4}; //on lines
Line Loop(2) = {5,6,7,8}; //on lines
Line Loop(3) = {1,10,-5,-9}; //on lines
Line Loop(4) = {3,11,-7,-12}; //on lines
Line Loop(5) = {9,-8,-11,4}; //on lines
Line Loop(6) = {10,6,-12,-2}; //on lines

// ############ SURFACES ############

Plane Surface(1) = {1}; //on line loops
Plane Surface(2) = {2}; //on line loops
Plane Surface(3) = {3}; //on line loops
Plane Surface(4) = {4}; //on line loops
Plane Surface(5) = {5}; //on line loops
Plane Surface(6) = {6}; //on line loops

// ############ TRANSFINITE LINES ############
Transfinite Line{1,3,5,7}=23; //Number of points on a 1/4 of circle
Transfinite Line{2,4,6,8}=15;       //Number of structure layers
Transfinite Line{9,10,11,12}=4;
// ############ TRANSFINITE SURFACES ############

Transfinite Surface { 1 } = { 0,1,2,3} ; //on points
Transfinite Surface { 2 } = { 4,5,6,7} ; //on points
Transfinite Surface { 3 } = { 0,4,5,1} ; //on points
Transfinite Surface { 4 } = { 3,7,6,2} ; //on points
Transfinite Surface { 5 } = { 0,4,7,3} ; //on points
Transfinite Surface { 6 } = { 1,5,6,2} ; //on points
Physical Surface(20)={1};
Physical Surface(30)={2};
Physical Surface(40)={3};
Physical Surface(50)={4};
Physical Surface(60)={5};
Physical Surface(70)={6};

Surface Loop(100) = {-20, 60, 50, 30, -70 ,40};

Volume(1) ={100};
Physical Volume(1000) = {1};