CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Mesh Generation & Pre-Processing (
-   -   GMSH - Predicting extruded entities identifiers (

heitorvitorc March 19, 2019 09:07

GMSH - Predicting extruded entities identifiers

I'm writting a script to help me constructing geometries for OpenFOAM by reading a .png file (picture) bynarizing it, reading the contours and creating the line loops using pygmsh package. However, OF requires a minimal extrusion for 2D simulation (the 3d boundary condition is set to empty for 2D simulations).

I need to find a solution for this given example:

Point(1) = {0,0,0};
Point(2) = {1,0,0};
Point(3) = {0,1,0};

Line(1) = {1,2};
Line(2) = {1,3};
Line(3) = {2,3};

Line Loop(1) = {1,2,3};
Plane Surface(1) = {1};

// We have now a triangle. The lines compose a plane surface whose //identification is "2".

Extrude {0,0,0.1}{

// Now the surface has been extruded, thus forming a volume.

The newly formed triangular geometry in this example has 4 new surfaces and 3 new points.

Given this situation, how do I predict the identifiers of those new entities? Does the indexes have any relation to its projected origins?

To be clearer: Is there a logical ordination between the three points from the geometry base and the top, or the surface from the base and the surface from the top?

I need to solve this small case in order to work with more complex extrusions, but I simply cant find a logical pattern.

Thanks in advance.

All times are GMT -4. The time now is 09:40.