On Sun, Sep 10, 2017 at 9:15 AM, Praveen C <[email protected]> wrote:
>
>
>>
>> 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 ?
>
No, Jed is saying that using a DA with a wider stencil on that Jacobian is
alright as long as
you do not try to input values outside the more restricted sparsity pattern.
Thanks,
Matt
> Thanks a lot for the examples.
>
> Best
> praveen
>
>
--
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
http://www.caam.rice.edu/~mk51/