Hi all,
is it possible to return the convergence history of the standard nonlinear solver? A simple list containing the residuals printed on the screen.
Thanks in advance, David
Well, I guess the answer is no. However, I managed doing it via PETScSNESSolver.
problem = GeneralProblem(F, w, bcs=bcs) # own class inherits NonlinearProblem solver = PETScSNESSolver("newtontr") solver.parameters["linear_solver"] = "lu" solver.init(problem, w.vector()) snes = solver.snes() snes.setConvergenceHistory() snes.setTolerances(rtol=1e-13, atol=1e-13, stol=0.0, max_it=30) snes.solve(None, as_backend_type(w.vector()).vec()) residuals = snes.getConvergenceHistory() # and here they are