Skip to main content
`Ctrl`+`K`

# DMSNESSetFunctionLocal

set a local residual evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and `DMSNES` will automatically accumulate the overlapping values.

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode DMSNESSetFunctionLocal(DM dm, PetscErrorCode (*func)(DM dm, Vec x, Vec f, void *ctx), void *ctx)

Logically Collective

## Input Parameters

- dm - `DM` to associate callback with

- func - local residual evaluation

- ctx - optional context for local residual evaluation

## Calling sequence of `func`

- dm - `DM` for the function

- x - vector to state at which to evaluate residual

- f - vector to hold the function evaluation

- ctx - optional context passed above

## See Also

SNES: Nonlinear Solvers, `DMSNESSetFunction()`, `DMSNESSetJacobianLocal()`

## Level

advanced

## Location

src/snes/utils/dmlocalsnes.c

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