Help in getting the boundary from gmsh to Fenics

Hi all,

I’ve been trying out gmsh and am mystified by the numbering of the physical surfaces. I found out that the physical surface I need as a boundary has number 24 by opening the GUI and moving the cursor on the desired surface. How are these numbers set? How can I find out which number it is without the GUI?
My .geo file is as follows:

msh = 1;
m = 1;

x0 = 0;
y0 = 0;
z0 = 0;
x1 = 0.99;
y1 = 0.1;
x2 = 0.93;
y2 = 0.075;
x3 = 1.0;
y3 = 0.05;
x4 = 0.93;
y4 = 0.025;
z1 = 0.01;

Point(1) = {x0, y0, z0,msh};
Point(2) = {x0, y1, z0,msh};
Point(3) = {x1, y1, z0,msh};
Point(4) = {x2, y2, z0,msh};
Point(5) = {x3, y3, z0,msh};
Point(6) = {x4, y4, z0,msh};
Point(7) = {x1, y0, z0,msh};

Line(1) = {1, 2};
Line(2) = {2, 3};
Spline(3) = {3, 4, 5, 6, 7};
Line(4) = {7, 1};
Line Loop(5) = {1, 2, 3, 4};
Line Loop(7) = {3};
Plane Surface(6) = {5};

Extrude {0, 0, z1}{ Surface{6}; }

//+
Physical Surface(1) = {24};
Physical Volume(“all”) = {1};

Thank you so much!

Hi,
this is a pure Gmsh question so I recommend asking for help on Gmsh elsewhere. But anyway, from the Gmsh documentation 5.1.5 Extrusions:

As explained in Floating point expressions, extrude can be used in an expression, in which case it returns a list of tags. By default, the list contains the “top” of the extruded entity at index 0 and the extruded entity at index 1, followed by the “sides” of the extruded entity at indices 2, 3, etc. For example:

Point(1) = {0,0,0}; 
Point(2) = {1,0,0}; 
Line(1) = {1, 2}; 
out[] = Extrude{0,1,0}{ Curve{1}; }; 
Printf("top curve = %g", out[0]); 
Printf("surface = %g", out[1]); 
Printf("side curves = %g and %g", out[2], out[3]);

it also applies to extrusion of surfaces

1 Like