[petsc-users] about snes

Barry Smith bsmith at mcs.anl.gov
Wed May 5 13:40:24 CDT 2010


On May 5, 2010, at 10:08 AM, Matthew Knepley wrote:

> Try using -snes_mf which will approximate the Jacobian automatically.

  You can also use -snes_type test -snes_test_display (for a small problem). Also try runs with -snes_monitor -ksp_monitor -ksp_converged_reason -snes_converged_reason and try also -info for lots of information about the line search. 

 You can also try running with -pc_type lu to eliminate any chance that failure of the linear solver is the problem.


   Barry

> 
>    Matt
> 
> 2010/5/5 陈乐平(Leping Chen) <chenleping at yahoo.cn>
> petsc teams,
>  
> When I use SNES, I find my program iterated many times but x vector and residual vector
>  
> remained unchanged, that is to say,no convergence.I used finite difference jacobian approximations,
>  
> but I cannot confirm the jacobian matrix structure is right.Whether the matrix structure will influence
>  
> the convergence of SNES or not? Why does my x vector and residual vector remained unchanged?
>  
>       call FormJacobian(snes,x,J,J,flag,dummy,ierr)
>       call MatGetColoring(J,MATCOLORING_SL,iscoloring,ierr)
>       call MatFDColoringCreate(J,iscoloring,fdcoloring,ierr)
>       call ISColoringDestroy(iscoloring,ierr)
>       call MatFDColoringSetFromOptions(fdcoloring,ierr)
>       call MatFDColoringSetFunction(fdcoloring,FormFunction,
>      &   PETSC_NULL_OBJECT,ierr)
>        call SNESSetJacobian(snes,J,J,SNESDefaultComputeJacobianColor,
>      & fdcoloring,ierr)
>       call SNESGetKSP(snes,ksp,ierr)
>       call KSPGetPC(ksp,pc,ierr)
>       call SNESSolve(snes,PETSC_NULL_OBJECT,petscu,ierr)
> Thanks,
> leping
>  
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100505/4ce9ebae/attachment.htm>


More information about the petsc-users mailing list