SNESSetFunction#

Sets the function evaluation routine and function vector for use by the SNES routines in solving systems of nonlinear equations.

Synopsis#

#include "petscsnes.h"  
PetscErrorCode SNESSetFunction(SNES snes, Vec r, SNESFunctionFn *f, void *ctx)

Logically Collective

Input Parameters#

  • snes - the SNES context

  • r - vector to store function values, may be NULL

  • f - function evaluation routine; for calling sequence see SNESFunctionFn

  • ctx - [optional] user-defined context for private data for the function evaluation routine (may be NULL)

See Also#

SNES: Nonlinear Solvers, SNES, SNESGetFunction(), SNESComputeFunction(), SNESSetJacobian(), SNESSetPicard(), SNESFunctionFn

Level#

beginner

Location#

src/snes/interface/snes.c

Examples#

src/snes/tutorials/ex1f.F90
src/snes/tutorials/ex58.c
src/snes/tutorials/ex78.c
src/snes/tutorials/ex59.c
src/snes/tutorials/ex5.c
src/snes/tutorials/ex2.c
src/snes/tutorials/ex35.c
src/snes/tutorials/ex55.c
src/snes/tutorials/ex6.c
src/snes/tutorials/ex31.c


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