In the context of parametric optimization, I’m interested in seeing how a stiffness matrix is affected by changes in the mesh geometry. I accomplish this using ufl.derivative:
spatialCoordinate = ufl.SpatialCoordinate(meshComponent.domain)
dX = fem.Function(meshComponent.meshFunctionSpace)
dX.vector.array = meshDeformation
stiffnessDerivativeForm = dolfinx.fem.form(ufl.derivative(stiffnessForm, spatialCoordinate, dX))
dK = dolfinx.fem.petsc.assemble_matrix(stiffnessDerivativeForm)
However, changing the mesh will not only change the integration domain but also change the interpolation points in the space where the solution lives (e.g. high-order Lagrange). Is this change is automatically propagated through chain rule by ufl.derivative?