Solving magnetostatic problems, I found some strange behaviour concerning
stopping criteria for Conjugate Gradients (and may be also for other Krylov methods)
using the Eigen linear algebra backend in version 2016.1.
Starting the solver with
problem = LinearVariationalProblem(...)
solver = LinearVariationalSolver(problem)
solver.parameters["linear_solver"] = 'cg'
solver.parameters["preconditioner"] = 'default'
solver.solve()
and solver.parameters['krylov_solver']
('absolute_tolerance', None)
('divergence_limit', None)
('error_on_nonconvergence', None)
('maximum_iterations', None)
('monitor_convergence', None)
('nonzero_initial_guess', None)
('relative_tolerance', None)
('report', None)
always ends up with
*** Warning: Krylov solver did not converge in ... iterations
The same code works fine with PETSc in version 2016.1 (and also
older versions).
Explicitely setting
solver.parameters["krylov_solver"]["relative_tolerance"]
to some reasonable value leads to a proper behaviour of the solver.
It seems, that in the case of Eigen there is no reasonable default
stopping criterium defined whereas for PETSc it is.
This is pretty strange to me.
Is there any reason for this difference between Eigen and PETSc?
This is the first time I am using Eigen, so may be this difference
is something well known to the 'experienced user'.