Finding facet index in imported mesh

Hi,

I am new to FEniCS. I am working on importing a tetrahedral mesh generated in an external mesh generator and available in numpy, as a (N x 3) array of nodes, (M x 4) array defining the tetrahedra. Additionally I have a (H x 3) array defining surface triangular facets, and a (H x 1) vector of integers that defines certain values on the boundary.

I have successfully created a mesh object from the nodes and tetrahedra definitions. A call mesh.topology.create_connectivity(3,2) will probably generate internally the triangular facets.

I am however not able to find ways, given my list of facets in a (H x 3) array, to find for each facet in my list, the local index to the facet defined by dolfinx. In other words, given the facet [2, 10, 15] in my list of facets, how do I find the index of the corresponding facet generated by dolfin in the mesh object?

Any pointer to documentation / examples / or suggestions is very welcome.

Thanks for any help,

Best Regards,

Andrea

You can use distribute_entity_data

as done in dolfinx/gmshio.py at 513d933eee37062b7847f51c48cbe1a6ee4083da · FEniCS/dolfinx · GitHub

Thanks for the pointer. I will study the code.

Andrea