[petsc-users] Problem with SNES

Barry Smith bsmith at mcs.anl.gov
Sat Aug 27 12:55:21 CDT 2011


On Aug 27, 2011, at 12:52 PM, Milan Mitrovic wrote:

> for the jacobian i use:
> 
>    call MatCreateShell(PETSC_COMM_WORLD, Np, Np, Ng, Ng, 0, Jac, info)
>    call MatShellSetOperation(Jac, MATOP_MULT, &
>         jacobian_multiplication, info)
> 
> and do the multiplication myself because it is much faster. I tried
> using parallel AIJ format but constructing the matrix took more than a
> minute for my problem with only ~150 nonzero entries per row... (maybe
> I was doing something very wrong)
> 
> should I return to the AIJ version to see if the jacobian is correct?

   If you have the code for both then add a simple switch in the code to allow changing back and forth very easily to debug things like Newton. For example with AIJ you can use a direct solver to eliminate most of the issues related to the linear solver from the problem of Newton's method.

   Barry




More information about the petsc-users mailing list