int SNESSetHessian(SNES snes,Mat A,Mat B,int (*func)(SNES,Vec,Mat*,Mat*, MatStructure*,void*),void *ctx)Collective on SNES and Mat
snes | - the SNES context |
A | - Hessian matrix |
B | - preconditioner matrix (usually same as the Hessian) |
func | - Jacobian evaluation routine |
ctx | - [optional] user-defined context for private data for the Hessian evaluation routine (may be PETSC_NULL) |
func (SNES snes,Vec x,Mat *A,Mat *B,int *flag,void *ctx);
x | - input vector |
A | - Hessian matrix |
B | - preconditioner matrix, usually the same as A |
flag | - flag indicating information about the preconditioner matrix structure (same as flag in SLESSetOperators()) |
ctx | - [optional] user-defined Hessian context |
The function func() takes Mat * as the matrix arguments rather than Mat. This allows the Hessian evaluation routine to replace A and/or B with acompletely new new matrix structure (not just different matrix elements) when appropriate, for instance, if the nonzero structure is changingthroughout the global iterations.
Location: src/snes/interface/snes.c
SNES Index
Table of Contents