# DMDAGetAO
Gets the application ordering context for a distributed array. 
## Synopsis
```
#include "petscdmda.h"   
PetscErrorCode DMDAGetAO(DM da, AO *ao)
```
Collective on da


## Input Parameter

- ***da -*** the distributed array



## Output Parameters

- ***ao -*** the application ordering context for `DMDA`





## Notes
In this case, the `AO` maps to the natural grid ordering that would be used
for the `DMDA` if only 1 processor were employed (ordering most rapidly in the
x-direction, then y, then z).  Multiple degrees of freedom are numbered
for each node (rather than 1 component for the whole grid, then the next
component, etc.)

Do NOT call `AODestroy()` on the ao returned by this function.


## See Also
 `DM`, `DMDA`, `DMDACreate2d()`, `DMDASetAOType()`, `DMDAGetGhostCorners()`, `DMDAGetCorners()`, `DMLocalToGlobal()`
`DMGlobalToLocalBegin()`, `DMGlobalToLocalEnd()`, `DMLocalToLocalBegin()`, `DMLocalToLocalEnd()`, `DMDAGetOwnershipRanges()`,
`AO`, `AOPetscToApplication()`, `AOApplicationToPetsc()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/daindex.c.html#DMDAGetAO">src/dm/impls/da/daindex.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex22.c.html">src/dm/tutorials/ex22.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex6.c.html">src/dm/tutorials/ex6.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex59.c.html">src/ksp/ksp/tutorials/ex59.c.html</A><BR>


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


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