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

How to set gmres restart in 2016.1.0

0 votes

I used to set my solver parameters via:

solver = PETScKrylovSolver("gmres", MyPrecon)
solver.set_operator(A)
solver.parameters["relative_tolerance"] = 1E-6
solver.parameters["absolute_tolerance"] = 1E-6
solver.parameters["maximum_iterations"] = 1000
solver.parameters['gmres']['restart'] = 200

but now, I get a keyerror: 'gmres'.

I get the same when I use:

solver.parameters['krylov_solver']['gmres']['restart'] = 200

but with a keyerror: 'krylov_solver'

Thanks.

asked Jul 16, 2016 by brk888 FEniCS Novice (990 points)

1 Answer

0 votes

One way is to use pets4py interface

solver.ksp().setGMRESRestart(40)
answered Jul 16, 2016 by OxbowQuest FEniCS User (1,360 points)
...