# 3D case,label of triangles, not tetrahedra

**URL:** <https://community.freefem.org/t/3d-case-label-of-triangles-not-tetrahedra/1640>\
**Category:** General Discussion\
**Created:** [April 2, 2022, 1:41pm UTC](https://community.freefem.org/t/3d-case-label-of-triangles-not-tetrahedra/1640 "2022-04-02T13:41:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DongweiYe](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/dongweiye/32/1073_2.png) [@DongweiYe](https://community.freefem.org/u/DongweiYe)\
**Post date:** [April 2, 2022, 1:41pm UTC](https://community.freefem.org/t/3d-case-label-of-triangles-not-tetrahedra/1640/1 "2022-04-02T13:41:44Z")

</div>

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:

```auto
+ 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

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [April 4, 2022, 4:21pm UTC](https://community.freefem.org/t/3d-case-label-of-triangles-not-tetrahedra/1640/2 "2022-04-04T16:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DongweiYe](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/dongweiye/32/1073_2.png) [@DongweiYe](https://community.freefem.org/u/DongweiYe)\
**Post date:** [April 5, 2022, 12:23pm UTC](https://community.freefem.org/t/3d-case-label-of-triangles-not-tetrahedra/1640/3 "2022-04-05T12:23:40Z")

</div>

Thank you! I will try it out
