[Gmsh] Using Floating point expressions to automatically set physical entities.

Luis Parras Anguita lparras at uma.es
Tue Dec 8 12:40:35 CET 2015


Dear all.

I have created a cylinder by extruding a surface with the following commands:
lc1 = 0.01;
Point(0)={0,0,0,lc1};
Point(1)={1,0,0,lc1};
Point(2)={0,1,0,lc1};
Point(3)={-1,0,0,lc1};
Point(4)={0,-1,0,lc1};
Circle(5)={1,0,2};
Circle(6)={2,0,3};
Circle(7)={3,0,4};
Circle(8)={4,0,1};
Line Loop(1)={5,6,7,8};
Plane Surface(2)={1};
Ex1[]=Extrude {0, 0, 1} {
  Surface{2};
};
Printf("top surface = %g", Ex1[0]);
Printf("Volume = %g", Ex1[1]);
Printf("side surfaces = %g, %g, %g, %g", Ex1[2], Ex1[3],Ex1[4],Ex1[5]);

Now I would like gmsh to automatically set the different physical
entities. I know the number of the lower surface, and the name of the
upper surface, but I have three surfaces that has been created that I
can access as Ex1[2:5]. I have tried several possibilities but I do
not know how to do what I want:

Physical Surface('interface_stationary_1')={Ex1[2:5]};

Best regards.

-- 
Luis Parras Anguita
Profesor Contratado Doctor
Departamento de Ing. Mecánica y Mecánica de Fluidos
ETSII Industriales, Málaga.
-----------------------------------------
Edificio Escuela de Ingenierías
C/ Arquitecto Francisco Peñalosa Nº 6
29071 Málaga