Gradient projection from DG to Lagrange space

Hello there friends from Fenics,

I was wondering if anyone had some thoughts on if it is possible to project a DG1 function into a Lagrange-2 function space but without having to solve a projection problem.

I have followed what was suggested in: How to get the first order derivative of the solution and store it in a numpy array - #20 by kalosu

to obtain the gradient of a Lagrange-1 space function from a DG0 space based gradient interpolation evaluation.

As suggested by @dokken, the approach based on neighbor cell averaging avoids the introduction of Gibbs phenomena and works fine for the DG0 to L1 “projection” case.

However, once I want to apply this to the higher continuity Lagrange-2 element case, then I am not sure on how to apply this approach.

In this case, I guess I should take a DG1 space for interpolating the gradient of my Lagrange-2 functions right? How could I then map back the obtained gradient values into the degrees of freedom of a Lagrange-2 function?

Any thoughts and help will be appreciated.