SNESDefaultComputeHessian

Computes the Hessian using finite differences.

Synopsis

int SNESDefaultComputeHessian(SNES snes,Vec x1,Mat *J,Mat *B,
                              MatStructure *flag,void *ctx)
Collective on SNES

Input Parameters

x1 - compute Hessian at this point
ctx - application's gradient context, as set with SNESSetGradient()

Output Parameters

J - Hessian matrix (not altered in this routine)
B - newly computed Hessian matrix to use with preconditioner (generally the same as J)
flag - flag indicating whether the matrix sparsity structure has changed

Options Database Key

 -snes_fd - Activates SNESDefaultComputeHessian()

Notes

This routine is slow and expensive, and is not currently optimizedto take advantage of sparsity in the problem. AlthoughSNESDefaultComputeHessian() is not recommended for general usein large-scale applications, It can be useful in checking thecorrectness of a user-provided Hessian.

Keywords

SNES, finite differences, Hessian

See Also

SNESSetHessian()

Location: src/snes/interface/snesj.c
SNES Index
Table of Contents