Hi all -- I'm writing a library that involves solving a nonlinear elliptic PDE, which I'll write as f(u) = 0. There is an exact solution for this PDE for a certain simplified geometry. To test everything, I check that my numerical solution is tolerably close to the analytic solution, with both bilinear and biquadratic elements, and on a mesh that has been adaptively refined in part of the domain. This all works fine.
The PDE can be derived from an action principle, i.e. there's a convex functional P such that f = dP. I've decided to reimplement some of my code to explicitly use the action principle, so I wrote a routine to calculate P. The action is analytically computable for the exact solution I'm already using to test the code, so this is already one unit test. However, I decided to take it a step further, and check that the nonlinear differential operator f is the derivative of P, and that its linearization df is the Hessian operator of P. To check that, I take some vector field u, another vector field v, and check that P(u + h * v) = P(u) + h*f(u) . v + h^2 * (df(u)v) . v / 2 + O(h^3) This test passes in the simple geometry with both bilinear and biquadratic elements, but *not* for an adaptively refined mesh. The errors in both the local linear approximation to the action functional and the local quadratic approximation do not go to 0 as the increment h is reduced. In addition, the value of the action is roughly the same for each h for both the adaptively refined and uniform meshes. The local quadratic approximation also converges as h goes to 0 on a realistic, complex geometry with real data, although we don't have an analytic solution for the problem there. I'm very confused by this result; since the solution of the PDE on an adaptively-refined mesh agrees with the analytic solution, it's kind of baffling that the local quadratic approximation to the action functional isn't working right in that case. The only other clue I have is that the error of the numerical solution against the analytic solution is actually somewhat worse on the adaptively-refined mesh than for the uniform mesh, but before I assumed this just had something to do with the linear solver. Any ideas of what I might have missed? The code is available here <https://github.com/danshapero/icepack/tree/action-functional> if that helps. Daniel -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.