# TSMonitorSet

Sets an ADDITIONAL function that is to be used at every timestep to display the iteration's progress.

### Synopsis

    #include "petscts.h"
    PetscErrorCode PETSCTS_DLLEXPORT TSMonitorSet(TS ts,PetscErrorCode (*monitor)(TS,PetscInt,PetscReal,Vec,void*),void *mctx,PetscErrorCode (*mdestroy)(void*))

Collective on TS

### Input Parameters

| ts | - the TS context obtained from TSCreate()
| func | - monitoring routine
| mctx | - [optional] user-defined context for private data for the monitor routine (use PETSC_NULL if no context is desired)
| monitordestroy | - [optional] routine that frees monitor context (may be PETSC_NULL)

### Calling sequence of func

       int func(TS ts,PetscInt steps,PetscReal time,Vec x,void *mctx)

| ts | - the TS context
| steps | - iteration number
| time | - current time
| x | - current iterate
| mctx | - [optional] monitoring context

### Notes

This routine adds an additional monitor to the list of monitors that already has been loaded.

### Keywords

TS, timestep, set, monitor

### See Also

TSMonitorDefault(), TSMonitorCancel()

Level:intermediate
Location:src/ts/interface/ts.c
Index of all TS routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ts/examples/tutorials/ex2.c.html
src/ts/examples/tutorials/ex3.c.html
src/ts/examples/tutorials/ex4.c.html
src/ts/examples/tutorials/ex5.c.html
src/ts/examples/tutorials/ex6.c.html
src/ts/examples/tutorials/ex7.c.html
src/ts/examples/tutorials/ex2f.F.html