How to differentiate if solver divergence is from code error or from unstable element choice?

Hi everyone! I have a more general question, but I can provide an MWE if that would be helpful.

I am currently working on some mixed element modeling, and I am pretty consistently getting solvers that immediately diverge (r (abs) = inf (tol = 1e-08), r (rel) = -nan (tol = 1e-08) after the second iteration). I have been seeing a lot of information about the instability of certain mixed element combinations, and I am not seeing any obvious issues with my codes (when I compile forms, I am not finding any nans in my functions). Would you expect the solver to diverge immediately with unstable element pairings, or would you expect to see some iterations before failing?

Generally speaking, are there debugging methods, tools, etc. that you would recommend to figure out if solver divergences are due to issues in the formulation (i.e., even with a perfect numerics setup, they would diverge because of something like a divide by 0) or due to the choice of elements in a mixed element situation (i.e., if the correct elements were chosen, things would be fine)?

Any advice would be greatly appreciated!

For many classical mixed forms, the stability of the pair relates to the full-rankedness of the mixed part block of the matrix. Additionally, a certain eigenvalueproblem should yield a minimal eigenvalue independent of the element size.

So that’s something you could check… See these two lectures:

2 Likes