[petsc-users] SNESSetJacobian and TSSetRHSJacobian

Jed Brown jedbrown at mcs.anl.gov
Wed May 22 19:33:36 CDT 2013


Peter Brune <prbrune at gmail.com> writes:

>> And get the SNES context from TS, then set the Jacobian option this way:
>>
>> SNES snes;
>>
>> TSGetSNES(ts, &snes);
>>
>> SNESSetJacobian(snes, J, J, SNESDefaultComputeJacobian, PETSC_NULL);
>>
>>
>>
> This should work as well.  Note that SNESDefaultComputeJacobian is quite
> expensive and should be used for testing only, which is why I would
> hesitate to hard-code its use.

Also note that SNESDefaultComputeJacobian is named
SNESComputeJacobianDefault now.  If you already configured the nonzero
structure, you can use -snes_fd_color or
SNESComputeJacobianDefaultColor.


More information about the petsc-users mailing list