<div dir="ltr"><div>The signature of SNESSetJacobian is </div><div><br></div>PetscErrorCode  SNESSetJacobian(SNES snes,Mat Amat,Mat Pmat,PetscErrorCode (*J)(SNES,Vec,Mat,Mat,void*),void *ctx)         <div><br></div><div>however it would seem redundant to supply both a constant matrix and a function to compute the Jacobian.</div><div>The manual says of J "(if NULL then SNES retains any previously set value": this would only apply to linear functions, is this correct?</div><div><br></div><div>Why then are there not two monomorphic "SetJacobian" functions, one for linear maps that wouldn't require recomputation and one for every other case ? </div><div><br></div><div>Coming from a functional background, I find reasoning with "NULL" to be very error-prone.</div><div><br></div><div>Thank you,</div><div>Marco</div></div>