What if the following does not work?
File('saved_u.xml') << u
Is there another way how to export solution?
Yes, there is. There are many output formats but only XML and XDMF can be read.
XML
XDMF
What error message is raised by File('saved_u.xml') << u?
Solved already, sorry. My problem was I was trying to export the solution, not the projected version of it. This worked.
h_proj = project(h, spaceT) hfile << h_proj