On Wed, Feb 23, 2011 at 11:12, Roman Vetter <vetterro@student.ethz.ch> wrote:
- The PETSc linear solver provides a print_converged_reason() member,
which includes the KSPConvergedReason enums, but not all of them!

Having a switch statement like that is pretty silly. You can get the reason in string form (const char *) with

KSPConvergedReasons[reason]

The solver has converged if reason>0 and diverged if reason<0.

The same applies to SNES, use SNESConvergedReasons[reason] to get the string.