set error_on_nonconvergence to True by default

Issue #842 resolved
Nico Schlömer created an issue

Right now, if a solver fails to converge with the given parameters (maximum_iterations, relative_tolerance etc.), Dolfin writes a message like

*** Warning: Krylov solver did not converge in 100 iterations (PETSc reason DIVERGED_ITS, residual norm ||r|| = 4.626070e+04).

to the screen and continues as normal. This message can easily drown in whatever output your code generates.

According to The Zen of Python,

Errors should never pass silently.

Unless explicitly silenced.

This should also apply here: The setting

solver.parameters['error_on_nonconvergence'] = True

should be the default. If anyone really wants allow a failing solver to pass, this can be set to False.

Comments (5)

  1. Log in to comment