[petsc-users] a line of code is weird

Fande Kong fdkong.jd at gmail.com
Sat Mar 7 11:53:49 CST 2015


Hi all,

I am trying to understand how to compute Jacobian using finite difference
methods. There is a function called SNESComputeJacobianDefault, where a
line of code at 120th
line, MatSetValues(B,1,&j,1,&i,y+j-start,INSERT_VALUES), is difficult to
understand for me. Because I think inserting  'y' is enough, but there is
two extra values 'j-start'. Any explanation is welcome.

Thanks,

Fande,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150307/c3f3e6d7/attachment.html>


More information about the petsc-users mailing list