Prolongation for higher order

Hi everyone,

for a mesh convergence study on a non-linear problem, I want to use the coarse mesh solution as a good initial guess for a Newton method after mesh refinement. However, for order>1, the prolongation appears to modify the solution, (so that the GridFunction on the fine space is the prolonged P1 function from the coarse mesh). I may have misunderstood something, so is this behaviour expected?

Best wishes,
Henry

from ngsolve import H1, Mesh, GridFunction, x
from netgen.geom2d import unit_square
from ngsolve.webgui import Draw

mesh = Mesh(unit_square.GenerateMesh(maxh=0.2))

fes = H1(mesh, order=2)
gfu = GridFunction(fes, nested=True)  # nested=True to do the prolongation
gfu.Set(x * (1 - x))

Draw(gfu)

mesh.Refine()
fes.Update()
gfu.Update()

Draw(gfu)

I think that’s expected. The H1 prolongation operator seems to only support P1 in the current version.
Maybe you can simply implement an L2 projection, with coarse grid solution as the source.

If you work only with degree 2, you may checkout the ngsxfem’s P2Prolongation

There is no H1 prolongation operator for degree greater than 2. It is very cubersome to manually implement such an operator on unstrctured grids.

Hi Guosheng,

thanks for the quick reply and the hint :slight_smile: !

Best wishes,
Henry