SNESDefaultComputeHessian

Computes the Hessian using finite differences.

Synopsis

#include "petscsnes.h"  
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 optimized to take advantage of sparsity in the problem. Although SNESDefaultComputeHessian() is not recommended for general use in large-scale applications, It can be useful in checking the correctness of a user-provided Hessian.

Keywords

SNES, finite differences, Hessian

See Also

SNESSetHessian()

Level:intermediate
Location:
src/snes/interface/snesj.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages