This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Is it possible to print the iteration count of a solver?

+1 vote

I am running a subproblem where I need to solve a problem.

Additional to the outer iteration count it would be interesting to get the steps every subproblem needed to be computed.

Is there a command like

 solver.solve("steps"=a)
 print a

where I can get the steps, so that i can save them into a file.

I am using PETScSNES Solver.

asked May 27, 2016 by Whistler FEniCS Novice (460 points)

1 Answer

+1 vote
 
Best answer

Ok sorry...

found the solution by myself

counters = solver.solve(problem, u.vector(), lb.vector(), ub.vector())  # Bounded solve

counters = (int, bool)
Pair of number of Newton iterations, and whether iteration converged)

answered May 27, 2016 by Whistler FEniCS Novice (460 points)
...