petsc-3.7.1 2016-05-15
Report Typos and Errors

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,PetscErrorCode (*f)(SNES,Vec,Vec,void*),void *ctx)
Logically Collective on SNES Many br

Input Parameters

snes - the SNES context Many br
r - vector to store function value Many br
f - function evaluation routine; see SNESFunction for calling sequence details Many br
ctx - [optional] user-defined context for private data for the Many brfunction evaluation routine (may be NULL) Many br

Notes

The Newton-like methods typically solve linear systems of the form Many br
     f'(x) x = -f(x),
where f'(x) denotes the Jacobian matrix and f(x) is the function. Many br

Many br

Keywords

SNES, nonlinear, set, function

See Also

SNESGetFunction(), SNESComputeFunction(), SNESSetJacobian(), SNESSetPicard(), SNESFunction

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

Examples

src/snes/examples/tutorials/ex1.c.html
src/snes/examples/tutorials/ex2.c.html
src/snes/examples/tutorials/ex3.c.html
src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex5s.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex15.c.html
src/snes/examples/tutorials/ex18.c.html
src/snes/examples/tutorials/ex20.c.html
src/snes/examples/tutorials/ex21.c.html
src/snes/examples/tutorials/ex22.c.html