[petsc-users] Example for solving system of pde with snes

Praveen C cpraveen at gmail.com
Sun Sep 10 08:15:31 CDT 2017


>
>
> You can use SNESSetJacobian, but DMSNESSetJacobianLocal is more
> convenient in my opinion.
>
> > I still have some doubt. If
> >
> > da0 --> for residual
> > da1 --> for jacobian
> >
> > I still need to call SNESetDM. So here I pass da0 ? But then how will
> snes
> > know about da1 ?
>
> This should work.
>
> DMCreateMatrix(da1, &Jpre);
> SNESSetDM(snes, da0);
> SNESSetJacobian(snes, NULL, Jpre, NULL, NULL);
> DMDASNESSetJacobianLocal(da0, func, ctx);
>
>
> In the last line above, should it not be da1 ?

Thanks a lot for the examples.

Best
praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170910/db30fb41/attachment-0001.html>


More information about the petsc-users mailing list