Open blechta opened 6 months ago
I think this is just purely a UFL issue. apply_geometry_lowering
will turn n
into some function of the jacobian hitting the reference normal, which in turn produces a ReferenceGrad(SpatialCoordinate(...))
, so we have CoefficientDerivative(...RGrad(X), u)
and this eventually fails.
What's surprising to me is that this doesn't show up in simpler examples.
What about:
x, *_ = SpatialCoordinate(mesh)
F = (1 + x.dx(0))*u*v*dx
J = derivatve(F, u)
?
See also https://github.com/firedrakeproject/firedrake/issues/2595, all UFL only related.
Coefficient derivative of a form featuring a spatial derivative of facet normal fails in form preprocessing. This is possibly a UFL and/or TSFC issue, but filing here a Firedrake MWE for reference
MWE:
Error message:
Changing the coordinate degree to 1 or supplying the Jacobian without
n
avoids the problem, thus demonstrating the culprit.Expected behavior: This error should not happen. Derivative of
grad(n)
w.r.t.u
should simplify to zero.Environment: This has been reproduced with Firedrake
0.13.0+5906.g7eaa7842d
(Dockerfiredrakeproject/firedrake:2023-11
) as well as0.13.0+5994.gc5e939dde
(Dockerfiredrakeproject/firedrake:latest
of January 8, 2024, digestd22b43594971
).