# SNES Convergence

Matthew Knepley knepley at gmail.com
Mon Jan 7 15:35:33 CST 2008

```Are you sure that this problem (or at least what is coded) has real
solutions? The behavior you see, Newton crapping out due to small
updates, can easily happen when you have imaginary solutions,
such as x^2 + 2 = 0. I would first try to test it in a regime in which
you have an exact or asymptotic solution.

Matt

On Jan 7, 2008 3:30 PM, Sean Dettrick <sdettrick at gmail.com> wrote:
> Hi,
>
>  I am solving a version of the Grad-Shafranov equation, F(x)=0, which but
> for some extra spatial dependences is similar in form to the 2D Bratu
> equation in snes/examples/tutorials/ex5.c.  I started with the ex5.c code,
> introducing just enough changes to model the new system.  The analytic
> Jacobian function appears to be correct, with a Norm of matrix ratio < 1.e9
> (found using -snes_type test).
>
> The problem I am having is that in most cases the SNES solver does not
> converge to a solution x of F(x)=0.  Rather, what happens is that the fnorm
> (obtained in a monitor function) converges to some large non-zero value, and
> F(x) seems to get "stuck", i.e. it converges to a large non-zero result.
> Even though it is clearly not a solution, the  -snes_converged_reason is
> reported as "Nonlinear solve converged due to CONVERGED_TR_DELTA".  The
> intermediate KSP steps have -ksp_converged_reason reported as "Linear solve
> converged due to CONVERGED_STEP_LENGTH".  I have been typically running with
> parameters -da_grid_x 100 -da_grid_y 101 -snes_converged_reason
> -ksp_converged_reason -snes_type tr -ksp_type gmres -snes_max_it 100.
>
> Does this sound like a familiar scenario with a familiar solution?  Or can
> anyone point me to some documentation that describes the SNES tr and ls
> parameters in more detail than the manual.pdf?
> Or can anyone recommend the best SNES and KSP parameters for the Bratu
> example?
>
> Any help or advice would be greatly appreciated.
>
> Thanks,
> Sean Dettrick
>

--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which