# TSMonitorSPSwarmSolution
Graphically displays phase plots of `DMSWARM` particles on a scatter plot 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSMonitorSPSwarmSolution(TS ts, PetscInt step, PetscReal ptime, Vec u, void *dctx)
```

## Input Parameters

- ***ts -*** the `TS` context
- ***step -*** current time-step
- ***ptime -*** current time
- ***u -*** current solution
- ***dctx -*** the `TSMonitorSPCtx` object that contains all the options for the monitoring, this is created with `TSMonitorSPCtxCreate()`



## Options Database Keys

- ***-ts_monitor_sp_swarm <n>          -*** Monitor the solution every n steps, or -1 for plotting only the final solution
- ***-ts_monitor_sp_swarm_retain <n>   -*** Retain n old points so we can see the history, or -1 for all points
- ***-ts_monitor_sp_swarm_phase <bool> -*** Plot in phase space, as opposed to coordinate space





## Notes
This is not called directly by users, rather one calls `TSMonitorSet()`, with this function as an argument, to cause the monitor
to be used during the `TS` integration.


## See Also
 [](chapter_ts), `TS`, `TSMonitoSet()`, `DMSWARM`, `TSMonitorSPCtxCreate()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/tsmon.c.html#TSMonitorSPSwarmSolution">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)  
