MeshEntities in dolfinx

Hi all,

How can I get the mesh entities of dim1 associated with a mesh entity of dim0 in dolfinx?

I am converting code from dolfin to dolfinx, and I have mesh tags associated with cells that I need to convert to be associated with facets in order to integrate over surface domains between materials (so surfaces that aren’t necessarily on the boundaries).

This answered question is similar, using dolfinx.cpp.mesh.entities_to_geometry, but this gives vertices of an entity only.

Thanks!

1 Like

You can use

mesh.topology.create_connectivity(dim0, dim1)
dim0_to_dim1 = mesh.topology.connectivity(dim0, dim1)
dim1_entities = dim0_to_dim1.links(dim1_entity)
3 Likes