# DMStagGetOwnershipRanges
get elements per rank in each direction 
## Synopsis
```
PetscErrorCode DMStagGetOwnershipRanges(DM dm, const PetscInt *lx[], const PetscInt *ly[], const PetscInt *lz[])
```
Not Collective


## Input Parameter

- ***dm -*** the `DMSTAG` object



## Output Parameters

- ***lx -*** ownership along x direction (optional)
- ***ly -*** ownership along y direction (optional)
- ***lz -*** ownership along z direction (optional)





## Notes
These correspond to the optional final arguments passed to `DMStagCreate1d()`, `DMStagCreate2d()`, and `DMStagCreate3d()`.

Arguments corresponding to higher dimensions are ignored for 1D and 2D grids. These arguments may be set to `NULL` in this case.

In C you should not free these arrays, nor change the values in them.
They will only have valid values while the `DMSTAG` they came from still exists (has not been destroyed).


## See Also
 [](chapter_stag), `DMSTAG`, `DMStagSetGlobalSizes()`, `DMStagSetOwnershipRanges()`, `DMStagCreate1d()`, `DMStagCreate2d()`, `DMStagCreate3d()`, `DMDAGetOwnershipRanges()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/stagutils.c.html#DMStagGetOwnershipRanges">src/dm/impls/stag/stagutils.c</A>


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


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