- Thank you received: 0
Projection of a high order solution on to the lowest order basis.
- BenWilson94
- Topic Author
- Offline
- Junior Member
Less
More
4 years 11 months ago #2177
by BenWilson94
Hi,
I have a H(curl) finite element space solution computed for some order (say order=3) and would like to project this solution on to a low order discretisation for the same mesh, but with order =0 elements. I'm guessing this might be through the projector operator
Projector(mask, range) # mask: bit array; range: bool
Is this possible?
Thanks
Ben
I have a H(curl) finite element space solution computed for some order (say order=3) and would like to project this solution on to a low order discretisation for the same mesh, but with order =0 elements. I'm guessing this might be through the projector operator
Projector(mask, range) # mask: bit array; range: bool
Is this possible?
Thanks
Ben
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
4 years 11 months ago #2178
by mneunteufel
Replied by mneunteufel on topic Projection of a high order solution on to the lowest order basis.
Hi Ben,
yes, it is possible to use the projection operator. However, it just neglects the information about the high order functions
If you use an HCurl space of order 0 and then use the Set method
also the high order functions will be locally projected yielding to a better approximation, see attached file.
Best,
Michael
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)
Best,
Michael
Attachments:
- BenWilson94
- Topic Author
- Offline
- Junior Member
Less
More
- Thank you received: 0
4 years 11 months ago #2181
by BenWilson94
Replied by BenWilson94 on topic Projection of a high order solution on to the lowest order basis.
Hi Michael,
That's excellent, thank you.
Kind regards,
Ben
That's excellent, thank you.
Kind regards,
Ben
Time to create page: 0.126 seconds