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.

Approximating the laplacian and bilaplacian of a phase field

More
3 years 7 months ago - 3 years 7 months ago #3096 by philipp
Dear NGSolve community,

recently, I got reason to numerically approximate high order derivatives (like the bilaplacian) of a phase field function.
To my surprise, I got into some trouble doing so and hope for being pointed out
a major fault in my method of using NGSolve or directed to a better method. The code I have been using to debug the issue is attached.

I noticed that the laplacian - and accordingly the bilaplacian - approximates show oscillatory behaviour. Sure, the phase field parameter I employ may be small and so I played around with making it larger or, on the other hand, refining the mesh while keeping it small.
Both approaches did not lead to a satisfactory result: The oscillatory behaviour still remains outside the
interfacial layer. To my understanding, computing gradients and divergences with NGSolve like in the attached code is based on differences of the phase field on a reference element. Am I mistaken here?

I am not very experienced in numerical issues so any recommendations will be appreciated.

All the best,
Philipp

Edit: I just substituted the phase field with the constant function 1 and even then the laplacian is not approximated correctly (Image attached), so there must be some error in using NGSolve I suppose.
Last edit: 3 years 7 months ago by philipp.
More
3 years 7 months ago #3118 by joachim
if you interpolate into a p=1 finite element space, and then numerically differentiate 4 times, you cannot expect convergence. If you interpolate into a p=4 finite element spaces, you will see convergence.

well, the picture you are showing is zero up to 1e-11. The u.Set(1) does element-wise L2-projection, and you get some roundoff errors. Interestingly, by interpolating using dual shapes, the Laplacian will be exactly 0. You get that via

u.Set(1, dual=True)

Joachim
More
3 years 7 months ago #3127 by philipp
Thank you very much for the answer.

The hint with the polynomial degree is very helpful and has the desired effect in the setup I posted
here.
I recently tried to do computations with grid functions in 2d that are given as bitmaps.
The conversion into a grid function of order p=1 is no problem. Then I let NGSolve interpolate
into a higher order space by using the Set operation of a higher order grid function.
The approximations of Laplacian and Bilaplacian are then quite bad.
Is there an obvious flaw in this method?

I completely understand if you don't answer since this might not be NGSolve related. However,
any hints are of course appreciated.

All the best,
Philipp
Time to create page: 0.164 seconds