Describe the bug
when using solver = NonlinearVariationalSolver(problem, solver_parameters, appctx={"deflation": deflation}) and call solver.snes.its will always return 0.
Expected behavior
solver.snes.its should return the number of snes iterations.
Additional Info
Can be solved by replacing the solve method in class DeflatedSNES with:
def solve(self, snes, b, x):
from firedrake import Function
out = self.inner.solve(b, x)
snes.reason = self.inner.reason
snes.its = self.inner.its # update here
# Record the solution we've just found
self.deflation.append(Function(self.problem.u))
return out
Describe the bug
when using solver = NonlinearVariationalSolver(problem, solver_parameters, appctx={"deflation": deflation}) and call solver.snes.its will always return 0.
Expected behavior
solver.snes.its should return the number of snes iterations.
Additional Info
Can be solved by replacing the
solvemethod in classDeflatedSNESwith: