Mesh connectivity in 3d

Hi FreeFem community,

I have a 3d mesh and I need to get the data about the number of tetrahedrons and to obtain the adjacent elements of each one. According to the documentation, in 2d i can compute the number of triangles according to the command Th.nt and the adjacencies by Th.adj

https://doc.freefem.org/documentation/mesh-generation.html#mesh-connectivity-and-data

However, it is not specified how to obtain the number of tetrahedrons in 3d. Also, I need to specify each element by its number to compute its adjacencies by using the above command.

Best Regards
Jacob

Hello,
You can use the following code to test and visualize:

load "msh3"

mesh3 Th = cube(2, 1, 1);
cout << "Volume: " << Th.measure << endl;
cout << "Number of tetrahedron: " << Th.nt << endl;
cout << "Number of vertex: " << Th.nv << endl;
cout << "Number of boundary triangle: " << Th.nbe << endl;
plot(Th);

This section explains a little bit.

Hello,

Thank you very much for your reply. Yes, finally worked by using the commands you mentioned in the previous post.

Best regards