dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

Let integration entities be specified manually

Open jpdean opened this issue 2 years ago • 0 comments

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:

  1. 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.
  2. 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.
  3. 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!

jpdean avatar Jul 15 '22 12:07 jpdean