How to interpolate the derivative of CG functions in DG space

You can use dolfinx::fem::Expression.
See: Hyperelasticity — DOLFINx 0.3.1 documentation for C++ or Solving a time-dependent problem — FEniCS 22 tutorial for a Python example

1 Like