# 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
 `VecView()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/interface/dm.c.html#DMGetOutputSequenceNumber">src/dm/interface/dm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex18.c.html">src/ts/tutorials/ex18.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex48.c.html">src/ts/tutorials/ex48.c.html</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
