3D case,label of triangles, not tetrahedra

Hi everyone,

I am a new user of Freefem. I have a question about getting the labels of triangles from a 3D mesh. The situation is like this, I have a 3D mesh generated by Gmsh and save it as .mesh format. In the mesh, I have three labelled surfaces, so that I can clearly define them as inlet/outlet/wall boundaries for my CFD simulation.

When I import this mesh to Freefem, it works fine, I used the code as follow:

+ on(2, u=-400*uin*(y-0.05)^2+uin, v=0)
+ on(3, p=0)
+ on(1, u=0, v=0);

However, I need to write a function to play with the label in the mesh data. What I have found in the documentation is that I can get the label of a vertex by Th[i][j].label or a Tetrahedra by Th[i].label in the 3D case. But the exact label in my mesh is actually attached to the triangle data instead of vertice or tetrahedra. Is there is a way to get the information of triangles in the mesh?

like the total number of triangles; the label of triangles and their corresponding vertices, XYZ coordinates etc?

Thank you in advance!

Best wishes
Dongwei

1 Like

Yes , see the example FreeFem-sources/Connectivite-3d.edp at develop · FreeFem/FreeFem-sources · GitHub (but sorry it is in develop branch but i think it also work on previous version).

Thank you! I will try it out