[petsc-users] SNES line search

Barry Smith bsmith at mcs.anl.gov
Wed Oct 17 14:38:13 CDT 2012


On Oct 17, 2012, at 2:02 PM, Shiyuan Gu <sgu at anl.gov> wrote:

> Hi, 
>     I am using petsc-3.3-p2.  For my particular equation, for the first few iterations, the residual norm is effectively reduced and the solution X is very close to the exact solution (the residual norm is e-17). Then in the next iteration, SNES_KSPSolve(....) returns a newton step very close to zero which is correct, but the line search after it fails, and the function SNESLSCheckLocalMin_Private(...) is called. In the function SNESLSCheckLocalMin_Private(), 
> the solution vector X is rewritten to X=J^T*F where J is the Jacobian and F is the residual. Since F is very close to zero, X is also zero which is wrong.  
> Is there a way to skip the line search?(if the line search is not performed, there would be no problem for this particular equation).  How should we handle this situation? 
> 
> Also, after the solution vector X is rewritten by SNESLSCheckLocalMin_Private(),


    SNESLSCheckLocalMin_Private()  is just a "sanity check" to help understand why the line search may have gone wrong. It does not  change or "rewrite" the solution, in fact it doesn't affect the solution process at all. 

    You can run the code with -ksp_monitor_true_residual -ksp_converged_reason -snes_monitor -snes_linesearch_monitor  -info 

   and send all the output to petsc-maint at mcs.anl.gov and we'll take a look at it.   Normally if the Newton step is very very small the algorithm will "jump out" as converged.

   Barry



> the new residual  norm is not printed on screen (which is huge for this particular problem).  Since the residual norm printed on the screen is going to machine accuracy,  users might think that the SNESSolve converges nicely and the returned solution is correct. This seems a bit misleading in my opinion.
> 
> Thanks. 
> 
> Shiyuan  
>  



More information about the petsc-users mailing list