How to L2 projection of the trial function on a coarser mesh then map back to finer mesh

Sorry, the code as you posted it is unreadable. I removed it, please try again by editing the post and using “```” when posting your code.

Furthermore, make sure to read Read before posting: How do I get my question answered? . We won’t be able to do much with a short code snippet that we can’t run, so please make an effort to post a minimal (but complete) example.