petsc-3.4.2 2013-07-02

# SNESGetFunction

Returns the vector where the function is stored.

### Synopsis

    #include "petscsnes.h"
    PetscErrorCode  SNESGetFunction(SNES snes,Vec *r,PetscErrorCode (**SNESFunction)(SNES,Vec,Vec,void*),void **ctx)

Not Collective, but Vec is parallel if SNES is parallel. Collective if Vec is requested, but has not been created yet.

### Input Parameter

snes - the SNES context

### Output Parameter

| r | - the vector that is used to store residuals (or NULL if you don't want it)
| SNESFunction | - the function (or NULL if you don't want it)
| ctx | - the function context (or NULL if you don't want it)

### Keywords

SNES, nonlinear, get, function

### See Also

SNESSetFunction(), SNESGetSolution(), SNESFunction

Level:advanced
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/ex21.c.html
src/snes/examples/tutorials/ex22.c.html
src/snes/examples/tutorials/ex30.c.html