petsc-dev 2014-04-18
Report Typos and Errors


Computes the gradient of a user provided objective


PetscErrorCode SNESObjectiveComputeFunctionDefaultFD(SNES snes,Vec X,Vec F,void *ctx)
Collective on SNES

Input Parameter

snes - the SNES context
X - the state vector
ctx - the (ignored) function context

Output Parameter

F -the function value

Options Database Key

-snes_fd_function_eps - The differencing parameter
-snes_fd_function - Compute function from user provided objective with finite difference


SNESObjectiveComputeFunctionDefaultFD is similar in character to SNESComputeJacobianDefault. Therefore, it should be used for debugging purposes only. Using it in conjunction with SNESComputeJacobianDefault is excessively costly and produces a Jacobian that is quite noisy. This is often necessary, but should be done with a grain of salt, even when debugging small problems.

Note that this uses quadratic interpolation of the objective to form each value in the function.


SNES, objective, debugging, finite differences, function

See Also

SNESSetFunction(), SNESComputeObjective(), SNESComputeJacobianDefault()

Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages