PetscErrorCode SNESDMComputeJacobian(SNES snes,Vec X,Mat *J,Mat *B,MatStructure *flag,void *ptr)
{
PetscErrorCode ierr;
DM dm;
PetscFunctionBegin;
ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr);
ierr = DMComputeJacobian(dm,X,*J,*B,flag);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
The SNES is not available from the callback.