:orphan:
# DMGetOutputSequenceNumber
Retrieve the sequence number/value for output
## Synopsis
```
#include "petscdm.h"
#include "petscdmlabel.h"
#include "petscds.h"
PetscErrorCode DMGetOutputSequenceNumber(DM dm, PetscInt *num, PetscReal *val)
```
## Input Parameter
- ***dm -*** The original `DM`
## Output Parameters
- ***num -*** The output sequence number
- ***val -*** The output sequence value
## Note
This is intended for output that should appear in sequence, for instance
a set of timesteps in an `PETSCVIEWERHDF5` file, or a set of realizations of a stochastic system.
## Developer Note
The `DM` serves as a convenient place to store the current iteration value. The iteration is not
not directly related to the `DM`.
## See Also
[](ch_dmbase), `DM`, `VecView()`
## Level
intermediate
## Location
src/dm/interface/dm.c
## Examples
src/ts/tutorials/ex18.c
src/ts/tutorials/ex48.c
src/ts/utils/dmplexlandau/tutorials/ex1.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.c)
[Index of all DM routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)