[petsc-users] about snes

Matthew Knepley knepley at gmail.com
Wed May 5 10:08:23 CDT 2010


Try using -snes_mf which will approximate the Jacobian automatically.

   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/9bc3cf02/attachment.htm>


More information about the petsc-users mailing list