-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
A user of dolfinx-externa-operator spotted that external operators are not differentiable via ufl.diff:
N = ExternalOperator(u, function_space=V) # N(u; v')
dNdu = ufl.diff(N, u)
dNdu_expanded = expand_derivatives(dNdu) # errorIs there a specific reason why this is not supported by ufl.ExternalOperator? Perhaps @dham could assist us with this?
MWE:
import ufl
from ufl.core.external_operator import ExternalOperator
from ufl import Coefficient, Argument, derivative, dx, diff
from ufl.algorithms import expand_derivatives
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1
from utils import FiniteElement, LagrangeElement
domain = ufl.Mesh(LagrangeElement(ufl.triangle, 1, (2,)))
f1 = FiniteElement("Lagrange", ufl.triangle, 1, (), identity_pullback, H1)
V = ufl.FunctionSpace(domain, f1)
u = Coefficient(V)
N = ExternalOperator(u, function_space=V) # N(u; v')
dNdu = ufl.diff(N, u)
dNdu_expanded = expand_derivatives(dNdu) # errorError message:
ValueError: Missing differentiation handler for type ExternalOperator. Have you added a new type?Metadata
Metadata
Assignees
Labels
No labels