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

How to switch to a different nonlinear solver?

+3 votes

I'm currently using the Newton solver to solve my system of coupled nonlinear PDEs like this:

solve(F==0, fullsol, [bc1,bc2,bc3,bc4,bc5,bc6,bc7], solver_parameters={"newton_solver":
                                                                           {"relative_tolerance": 1e-10, "absolute_tolerance": 1e-10}})

In some cases, the Newton solver fails to converge. Are there other algorithms implemented in Fenics that I could try? How do I change between the algorithms and where can I find a list of them?

asked Jun 3, 2014 by Ech FEniCS Novice (570 points)

1 Answer

0 votes

Newton's method is pretty robust but relies heavily on a reasonable initial guess. Do you have one?

answered Jun 3, 2014 by mwelland FEniCS User (8,410 points)

I have. I basically solve the equation for a range of different parameter values, one of which gives a trivial solution, and use the result from previous parameter as an initial guess for the next solution. I actually already managed to make my solver perform much better by adjusting one of the boundary conditions a bit. It seems that the solver didn't like to have a discontinuous boundary condition

Hmmm... could you try a bounded newton solver? Depending on your problem it might help get to the right solution.

See:
http://fenicsproject.org/qa/3642/box-constrained-petsc-krylov-solvers-in-fenics?show=3727#c3727

What linear solver are you using? A direct one?

...