Hi,
In order to compute the solutions of an elasticity problem on a 1D domain thanks to a manually implemented Newton's method I need to compute a function and its second derivative prior to passing it in the weak form as an initial guess. Although I have no problem computing the function, I have some issues trying to compute its second derivative near the boundaries of the domain. I'll try to reproduce what's happening in a short example:
Having a unit interval mesh, I have defined R, a vector valued function and projected it on V which is a vector function space of Lagrange finite elements. Then I compute its first derivative calling Dx(R,0)
. To this point everything goes smoothly and the output of the function looks as follow:
Then I basically try to compute the second derivative of this function by first projecting Dx(R,0)
on V and calling again Dx()
:
dR=project(dR,V)
ddR=Dx(dR,0)
Which returns this function:
As you can see, there are each time wiggles near the domain's boundaries and I think it may impede the convergence of my Newton method. So far, I tried to:
- Refine the mesh near the boundaries, which led to the same result plus another set of wiggles on the interface between the refined and non-refined parts of the mesh.
- Use higher order Lagrange elements for the computation, which led to the same results
- Compute the derivative on high order elements then projecting on lower order to get some averaging but it didn't work out as well.
As none of these brought satisfying results I begin to think that computation of derivative is not as clear as I thought it was, if anyone has already encountered such problem and/or have ideas of workarounds it would be much appreciated. As this function is the initial guess of a Newton's method I think that anything that could smoothen the second derivative enough to get convergence will do the trick.
Many thanks!
Regards,
MFV.