FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
97 stars 64 forks source link

Replace `not isinstance(element, MixedElement)` with `element.num_sub_elements == 0` #122

Closed mscroggs closed 1 year ago

mscroggs commented 1 year ago

This allows me to use control the behaviour of (eg) TrialFunctions for custom elements.

~As a side effect, this may change the result of calling TrailFunctions on VectorElements and TensorElements, although this new behaviour is probably what I'd have expected it to do.~ Edit: VectorElement inherits from MixedElement, so the behaviour probably hasn't changed

dham commented 1 year ago

I think this looks fine. I have started https://github.com/firedrakeproject/firedrake/pull/2568 running just to make sure.

dham commented 1 year ago

I think this looks fine. I have started firedrakeproject/firedrake#2568 running just to make sure.

So it turns out that the sobolev spaces change (which hadn't yet been merged to Firedrake) failed to set the sobolev_space method on BrokenElement which causes this to fail Firedrake tests. I am testing a fix.