See Where to find 'project'-function in dolfinx? - #2 by nate.
See also interpolation of ufl
forms in dolfinx, which I believe fits your requirements: https://github.com/FEniCS/dolfinx/blob/main/python/demo/demo_elasticity.py#L229-L232
Also bear in mind that depending on the underlying function spaces of k
and T
, projection or interpolation onto a C^0 basis is likely not appropriate. Consider a discontinuous space.