Hello,
How can I get the local index of a facet within a cell? I see here Basix documentation how this is done, but how to actually get that IDs from 0 to 3? I am thinking of a function of the form get_facet_index(facet, cell)
.
Thanks.
Hello,
How can I get the local index of a facet within a cell? I see here Basix documentation how this is done, but how to actually get that IDs from 0 to 3? I am thinking of a function of the form get_facet_index(facet, cell)
.
Thanks.
I guess you are interested in how to Get a facet index from dolfinx to its local index relative to its cell? What you can do is to use the cell->facet connectivity, and find what local position in the corresponding list the facet has.
Hi @dokken,
Thanks a lot for the usual availability. Is the numbering above also true for a create_rectangle
mesh? Meaning, is there a dolfinx.mesh.MeshTags
for the four edges of a rectangle which is automatically there without me having to build it? Thanks.
Best,
Federico
You would need to call the appropriate calls, such as
mesh.topology.create_entities(mesh.topology.dim-1)
to compute facet indices, and mesh.topology.create_connectivity(fdim, tdim)
to Get facet to cell connectivity, and similarly for (tdim,fdim), to Get cell to facet connectivity.
Once these are compute with create, you can Get them as
c_to_f = mesh.topology.connectivity(tdim, fdim)
Where tdim=mesh.topology.dim, fdim=tdim-1
Hi @dokken,
Thanks for the answer. Is this true also for the actual edges of the mesh? How do I access these tags without defining a meshtag myself, if this is the case?
It seems like you confusing MeshTags
and connectivity maps.
A meshtag is a set of entities of some dimension (between 0 and the topological dimension of a cell in the mesh) and some corresponding marker values.
The connectives and entities mentioned above is the enumeration and connectivity betwen entities of said dimension.
The meshtag
is always used defined.
The connectivities and entity numeration is always done by dolfinx, by calling the appropriate create_*
functions.
Hi @dokken,
I used to use Firedrake and there a standard meshtag is always defined on the four edges of the unit square, this is why I was asking. But your answer now clarifies all of my doubts, thanks a lot.