:orphan:
# AOCreateMapping
Creates an application mapping using two integer arrays. 
## Synopsis
```
#include "petscao.h" 
PetscErrorCode AOCreateMapping(MPI_Comm comm, PetscInt napp, const PetscInt myapp[], const PetscInt mypetsc[], AO *aoout)
```

## Input Parameters

- ***comm    -*** MPI communicator that is to share the `AO`
- ***napp    -*** size of integer arrays
- ***myapp   -*** integer array that defines an ordering
- ***mypetsc -*** integer array that defines another ordering (may be NULL to indicate the identity ordering)



## Output Parameter

- ***aoout   -*** the new application mapping



## Options Database Key

- ***-ao_view -*** call `AOView()` at the conclusion of `AOCreateMapping()`





## Note
The arrays myapp and mypetsc need NOT contain the all the integers 0 to napp-1, that is there CAN be "holes"  in the indices.
Use `AOCreateBasic()` or `AOCreateBasicIS()` if they do not have holes for better performance.


## See Also
 [](sec_ao), `AOCreateBasic()`, `AOCreateBasic()`, `AOCreateMappingIS()`, `AODestroy()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/ao/impls/mapping/aomapping.c.html#AOCreateMapping">src/vec/is/ao/impls/mapping/aomapping.c</A>


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


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