Get all parent tetrahedra from a triangle element


I am using your 3D library with the Fortran interfacing.
In my problem I need to know all the different tetrahedra to which belongs a given triangle. I am using the subroutine MMG3D_Get_TetFromTria, but it only returns one of the parent tetrahedron.
I’ve tried to call the function a second time, but the same tetrahedron is returned.

Is there a way to get the index of this second tetrahedron ?

Thanks a lot !

Hi Kévin,

Yes, you can call the MMG3D_Get_TetsFromTria function (note the “s” in the function name). In the prototype:

  • ktet is and array of size 2 that will store the index of the two tetrahedra that share a boundary triangle;
  • iface is an array of size 2 that will store the local index of the triangle in the tretra;
  • if the boundary triangle belongs to one tetra only, ktet(2) = iface(2) = 0.

Do not hesitate to get back to me if you have issues with this function.


Thanks for the quick answer. It looks exactly like what I need.
Unfortunately, I haven’t been able to test it as our servers are still running the 5.3.10 version of MMG. But I’ll give it a try as soon as possible.