Taking the derivative of a form containing a vector coefficient w.r.t. a scalar coefficient and supplying a coefficient derivative map results in an error, e.g.:
test.py:
from ufl import (triangle, FiniteElement, VectorElement, TestFunction, Coefficient, inner, dx, derivative)
V = FiniteElement("Lagrange", triangle, 1)
VV = VectorElement("Lagrange", triangle, 1)
dv = TestFunction(V)
df = Coefficient(VV)
g = Coefficient(VV)
f = Coefficient(VV)
u = Coefficient(V)
cd = {f: df}
integrand = inner(f, g)
F = integrand*dx
J = derivative(F, u, dv, cd)
forms = [F, J]
ffcx test.py results in:
ufl.log.UFLException: Component and shape length don't match.
I have a fix that's working for my usage case that I'll put in a PR for comment.
Taking the derivative of a form containing a vector coefficient w.r.t. a scalar coefficient and supplying a coefficient derivative map results in an error, e.g.:
test.py
:ffcx test.py
results in:I have a fix that's working for my usage case that I'll put in a PR for comment.