#include "petscsnes.h" PetscErrorCode SNESSetJacobian(SNES snes,Mat Amat,Mat Pmat,PetscErrorCode (*J)(SNES,Vec,Mat,Mat,void*),void *ctx)Logically Collective on SNES and Mat Many br
snes | - the SNES context Many br | |
Amat | - the matrix that defines the (approximate) Jacobian Many br | |
Pmat | - the matrix to be used in constructing the preconditioner, usually the same as Amat. Many br | |
J | - Jacobian evaluation routine (if NULL then SNES retains any previously set value), see SNESJacobianFunction for details Many br | |
ctx | - [optional] user-defined context for private data for the Many brJacobian evaluation routine (may be NULL) (if NULL then SNES retains any previously set value) Many br |
If you know the operator Amat has a null space you can use MatSetNullSpace() and MatSetTransposeNullSpace() to supply the null Many brspace to Amat and the KSP solvers will automatically use that null space as needed during the solution process. Many br
If using SNESComputeJacobianDefaultColor() to assemble a Jacobian, the ctx argument Many brmust be a MatFDColoring. Many br
Other defect-correction schemes can be used by computing a different matrix in place of the Jacobian. One common Many brexample is to use the "Picard linearization" which only differentiates through the highest order parts of each term. Many br
Many br
Level:beginner
Location:src/snes/interface/snes.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages