Skip to content

Allow the use of "self error" to estimate convergence with "-snes_convergence_estimate_self"

Toby Isaac requested to merge tisaac/feature-conv-est-self-similar into main

PetscConvEst is an experimental feature to create a mesh hierarchy and test the convergence rate of a combination of a solver and a discretization. The convergence rate has been defined wrt the L2 error between the approximate solutions and the exact solution.

A typical approximation theory says that the convergence should have a specified rate, regardless of whether we can write down the exact solution in closed form. We can still verify the rate by checking the "self error": the error, by the same metric, between successive solutions, \|u_h - u_H\|. These errors should converge at the same rate as \|u_h - u^*\|.

This MR enables this kind of error estimate through minimal changes to PetscConvEst. It can be accessed with the command line options -snes_convergence_estimate -snes_convergence_estimate_self.

Regression tests are added to snes tutorial ex13 that demonstrate the correct behavior.

Working on this MR revealed some bugs that affected interpolating Hdiv spaces from one mesh to the next, and they have been fixed.

A remaining bug---that we do not interpolate functions with inhomogeneous dirichlet BCs correctly---is also demonstrated by the tests added by this MR. To reveal this, I added a homogeneous BC exact solution to snes tutorial ex13 to demonstrate the difference.

Edited by Toby Isaac

Merge request reports