Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Adaptive mesh refinement: Interpolation operator

More
4 years 5 months ago #2037 by anandes
Hello,

When I use adaptive mesh refinement in NGSolve and obtain a refined mesh, is it possible to access an interpolation/update operator such that the following transformation can be computed.
Let uH be a solution on the coarse grid and uh be the equivalent interpolated field on the hierarchically refined grid. uh is obtained by interpolating the values of uH on the finer grid:
uh=P*uH.
This is useful to compute error norms of the coarse-grid solution on the refined grid and to compare these to norms of the solution on the refined grid . Is there a way to access this operator P?

Thank you,
Anand
More
4 years 5 months ago #2041 by mneunteufel
Hello Anand,

maybe the attached file, where a MultiGrid preconditioner is build with coarse grid correction can help you.

Especially these lines:
Code:
prol = space.Prolongation() ... prol.Restrict(level, d) ... prol.Prolongate(level, w)

File Attachment:

File Name: multigrid.py
File Size:2 KB


Best,
Michael
Attachments:
More
4 years 5 months ago #2045 by anandes
Hello Michael,

Thank you for pointing me to the relevant operator. I'll try this and get back to you if I have more questions.

Thank you,
Anand
More
4 years 5 months ago #2142 by anandes
Hi Michael,

I'm following up on my earlier question here. Is it possible to use the Prolongation/Restriction operator outside of the multigrid preconditioner environment?

For example, consider the Poisson example in the NGSolve documentation. Once I obtain the solution at some discretization level can I refine the mesh and use the prolongation operator to interpolate the coarse grid solution on the refined mesh? Can you please give an example of how this can be done?

Thank you,
Anand
More
4 years 5 months ago #2144 by joachim
Hi,

you can use the Prolongation here as well, see the attached example.
But, you have to do some data copying.

As an alternative, you define
Code:
gfu = GridFunction(fes, nested=True)

then the prolongation is done within GridFunction.Update()

The prolongation must be provided by the FESpace, not all have it implemented.
E.g. some high order spaces use just the prolongation of the low order space..

Best, Joachim
Attachments:
More
4 years 5 months ago #2145 by anandes
Hi Joachim,

Thank you for the detailed example with the comments. This is very helpful!

The prolongation works as expected for linear H1 spaces. If I use a higher-order H1 space, the error norm of the interpolated field on the refined grid is much larger - probably because the prolongation uses linear H1 space - as you mentioned.

However, prolongation does not seem to work on HDiv spaces. The field quantity on the refined grid is just zero in the whole domain. Is prolongation not implemented for HDiv?

Thank you,
Anand
Time to create page: 0.114 seconds