# TSMonitorSetFromOptions
Sets a monitor function and viewer appropriate for the type indicated by the user 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSMonitorSetFromOptions(TS ts, const char name[], const char help[], const char manual[], PetscErrorCode (*monitor)(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *), PetscErrorCode (*monitorsetup)(TS, PetscViewerAndFormat *))
```
Collective


## Input Parameters

- ***ts -*** `TS` object you wish to monitor
- ***name -*** the monitor type one is seeking
- ***help -*** message indicating what monitoring is done
- ***manual -*** manual page for the monitor
- ***monitor -*** the monitor function
- ***monitorsetup -*** a function that is called once ONLY if the user selected this monitor that may set additional features of the `TS` or `PetscViewer` objects





## See Also
 [](chapter_ts), `TS`, `TSMonitorSet()`, `PetscOptionsGetViewer()`, `PetscOptionsGetReal()`, `PetscOptionsHasName()`, `PetscOptionsGetString()`,
`PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`
`PetscOptionsInt()`, `PetscOptionsString()`, `PetscOptionsReal()`, `PetscOptionsBool()`,
`PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`,
`PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
`PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
`PetscOptionsFList()`, `PetscOptionsEList()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/tsmon.c.html#TSMonitorSetFromOptions">src/ts/interface/tsmon.c</A>


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


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