Looks like old DOLFIN intercepts a PETSc error and then throws its own should the KSP iterations exceed their limit. Quick solution is to handle it with python:
try:
custom_solver.solve(problem, u.vector())
except Exception as e:
# Handle the error within your time stepping algorithm gracefully...
Consider using a PETScSNESSolver
and its underlying SNES
and KSP
objects to get more information about the lack of convergence. Also consider foregoing DOLFIN’s implementations of Newton and Krylov solvers altogether and just use a SNES
and KSP
directly.