:orphan:
# SNESLineSearchMonitorSet
Sets an ADDITIONAL function that is to be used at every iteration of the nonlinear solver to display the iteration's progress. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchMonitorSet(SNESLineSearch ls, PetscErrorCode (*f)(SNESLineSearch, void *), void *mctx, PetscErrorCode (*monitordestroy)(void **))
```
Logically Collective


## Input Parameters

- ***ls -*** the `SNESLineSearch` context
- ***f -*** the monitor function
- ***mctx -*** [optional] user-defined context for private data for the
monitor routine (use `NULL` if no context is desired)
- ***monitordestroy -*** [optional] routine that frees monitor context
(may be `NULL`)





## Note
Several different monitoring routines may be set by calling
`SNESLineSearchMonitorSet()` multiple times; all will be called in the
order in which they were set.


## Fortran Note
Only a single monitor function can be set for each `SNESLineSearch` object


## See Also
 `SNESLineSearch`, `SNESGetLineSearch()`, `SNESLineSearchMonitorDefault()`, `SNESLineSearchMonitorCancel()`

## Level
intermediate

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


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


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