I am trying to replace the SOLVE step of the adaptive refinement algorithm with Newton’s iteration since I am trying to solve for a nonlinear Poisson equation. Therefore, I am willing to keep the numerical solution from the last SOLVE and set it as the initial solution for the next SOLVE.

However, I noticed that whether I set autoupdate=True for the gfu or not, the mesh.Refine() always has gfu forget its values for dofs. I came up with some tricks like saving the mesh to a file and then reading it to construct another mesh. Then construct gfu2 correspond to that mesh and the corresponding fe space and use gfu2.Set() to store the value. But I am also curious if there is a more decent way to deal with this.

Thanks in advance for any help!