# SNESGetObjective
Returns the objective function. 
## Synopsis
```
PetscErrorCode SNESGetObjective(SNES snes, PetscErrorCode (**obj)(SNES, Vec, PetscReal *, void *), void **ctx)
```
Not Collective


## Input Parameter

- ***snes -*** the `SNES` context



## Output Parameters

- ***obj -*** objective evaluation routine (or NULL); see `SNESObjectFunction` for details
- ***ctx -*** the function context (or NULL)





## See Also
 `SNES`, `SNESSetObjective()`, `SNESGetSolution()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snesob.c.html#SNESGetObjective">src/snes/interface/snesob.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/interface/snesob.c)


[Index of all SNES routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
