# AOApplicationToPetsc
Maps a set of integers in the application-defined ordering to the PETSc ordering. 
## Synopsis
```
#include "petscao.h" 
PetscErrorCode AOApplicationToPetsc(AO ao, PetscInt n, PetscInt ia[])
```
Collective


## Input Parameters

- ***ao -*** the application ordering context
- ***n -*** the number of integers
- ***ia -*** the integers; these are replaced with their mapped value



## Output Parameter

- ***ia -*** the mapped integers





## Notes
Any integers in ia[] that are negative are left unchanged. This
allows one to convert, for example, neighbor lists that use negative
entries to indicate nonexistent neighbors due to boundary conditions, etc.

Integers that are out of range are mapped to -1


## See Also
 [](sec_ao), `AOCreateBasic()`, `AOView()`, `AOPetscToApplication()`,
`AOPetscToApplicationIS()`, `AOApplicationToPetsc()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/ao/interface/ao.c.html#AOApplicationToPetsc">src/vec/is/ao/interface/ao.c</A>

## Examples
<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>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/ao/impls/basic/aobasic.c.html#AOApplicationToPetsc_Basic">AOApplicationToPetsc_Basic in src/vec/is/ao/impls/basic/aobasic.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/ao/impls/mapping/aomapping.c.html#AOApplicationToPetsc_Mapping">AOApplicationToPetsc_Mapping in src/vec/is/ao/impls/mapping/aomapping.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/ao/impls/memscalable/aomemscalable.c.html#AOApplicationToPetsc_MemoryScalable">AOApplicationToPetsc_MemoryScalable in src/vec/is/ao/impls/memscalable/aomemscalable.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/ao/interface/ao.c)


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