# DMPlexCreateRankField
Create a cell field whose value is the rank of the owner 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexCreateRankField(DM dm, Vec *ranks)
```

## Input Parameter

- ***dm -*** The `DMPLEX` object



## Output Parameter

- ***ranks -*** The rank field



## Options Database Key

- ***-dm_partition_view -*** Adds the rank field into the DM output from -dm_view using the same viewer





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMView()`

## Level
intermediate

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/plex/plex.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)  
