Thank you, but this is not really helping; why are there two slots to supply the Jacobian of the same function, i.e. Amat and J ?
On 22 October 2015 at 16:30, Matthew Knepley <[email protected]> wrote: > On Thu, Oct 22, 2015 at 9:20 AM, Marco Zocca <[email protected]> > wrote: > >> The signature of SNESSetJacobian is >> >> PetscErrorCode SNESSetJacobian(SNES snes,Mat Amat,Mat >> Pmat,PetscErrorCode (*J)(SNES,Vec,Mat,Mat,void*),void *ctx) >> >> however it would seem redundant to supply both a constant matrix and a >> function to compute the Jacobian. >> The manual says of J "(if NULL then SNES retains any previously set >> value": this would only apply to linear functions, is this correct? >> > > It means, if you give NULL, but have previously called SetJacobian() then > it uses the function pointer previously passed > rather than setting it to NULL. > > >
