# DMPlexGetOrdering
Calculate a reordering of the mesh 
## Synopsis
```
#include "petscdmplex.h"   
#include "petscmat.h"      
PetscErrorCode DMPlexGetOrdering(DM dm, MatOrderingType otype, DMLabel label, IS *perm)
```
Collective on dm


## Input Parameters

- ***dm -*** The DMPlex object
- ***otype -*** type of reordering, one of the following:

```none
MATORDERINGNATURAL - Natural
```
```none
MATORDERINGND - Nested Dissection
```
```none
MATORDERING1WD - One-way Dissection
```
```none
MATORDERINGRCM - Reverse Cuthill-McKee
```
```none
MATORDERINGQMD - Quotient Minimum Degree
```
- ***label -*** [Optional] Label used to segregate ordering into sets, or NULL



## Output Parameter

- ***perm -*** The point permutation as an IS, perm[old point number] = new point number


Note: The label is used to group sets of points together by label value. This makes it easy to reorder a mesh which
has different types of cells, and then loop over each set of reordered cells for assembly.




## See Also
 `DMPlexPermute()`, `MatGetOrdering()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexreorder.c.html#DMPlexGetOrdering">src/dm/impls/plex/plexreorder.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/plex/plexreorder.c)


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