dolfinx
dolfinx copied to clipboard
Let integration entities be specified manually
Currently, Form
computes which entities to integrate over from a MeshTags
object. This is fine for many common use cases, but in more specialised applications, it is useful to be able to specify the entities to assemble over manually. For instance, the user may want to perform a "one sided" facet integral on some interior facets of the mesh, which is not currently possible.
This PR refactors Form
so that the entities to integrate over can be specified manually. A free function has been added to compute integration entities from meshtags, rather than this being computed in the form Form
class.
There are still a few issues to fix:
- In python, since a plain dictionary does not have a
ufl_id
, it causes this check to fail. However, the check may not be necessary. If it is,id
could be called on the data instead. - There are a couple of places where data is being copied. There are a few ways to avoid these copies, but I'm not sure which approach would be best. Any suggestions would be much appreciated.
- Any suggestions on the best way to do the python bindings would be very helpful. At the moment, facets are flattened in both python and C++. I think it would be better to only flatten them in C++, but I'm open to suggestions!