Hi Ben,
yes, it is possible to use the projection operator. However, it just neglects the information about the high order functions
Code:
gf_proj = GridFunction(fes_ho)
bt = BitArray(fes_ho.FreeDofs())
bt[:]=True
bt[mesh.nedge:] = False
P = Projector(bt, True)
gf_proj.vec.data = P*gf_ho.vec
If you use an HCurl space of order 0 and then use the Set method
Code:
fes_ho = HCurl(mesh, order=3)
fes_lo = HCurl(mesh, order=0)
gf_ho = GridFunction(fes_ho)
gf_lo = GridFunction(fes_lo)
#Set something
gf_ho.Set( CoefficientFunction( (x**2*y*(1-y),-y**3*x**2) ) )
#Interpolate high order solution to low order space
gf_lo.Set(gf_ho)
also the high order functions will be locally projected yielding to a better approximation, see attached file.
Best,
Michael