Shape Derivatives in UFL

I suggest having a look at the following papers:

As you can see here, to get the shape derivative of a function, you need to solve the corresponding adjoint equation. This can be done by hand (as in the first paper) or by using dolfin-adjoint (as implemented in the second paper). You cannot use Expressions in either case, and you need to use SpatialCoordinate for purely geometrical dependencies

1 Like