Cell index in facet integral


I’m looking for a way to get an index to the cell that a facet belongs to during integration over said facet, which I can then use to find that cell’s physical region given by a MeshFunction.

I have two subregions in my mesh with a different constant on each of them and I need to use the appropriate value during integration over the facets along their interface (something like my_constant(’-’)).

Is there a way to do this?

Thank you

See @MiroK’s answer here:

You can use the MeshFunction to control which subregion is the - side of an interior facet, which should allow you to do what it sounds like you’re trying to.