# DMCompositeGetAccessArray
Allows one to access the individual packed vectors in their global representation. 
## Synopsis
```
#include "petscdmcomposite.h"  
PetscErrorCode DMCompositeGetAccessArray(DM dm, Vec pvec, PetscInt nwanted, const PetscInt *wanted, Vec *vecs)
```
Collective on dm


## Input Parameters

- ***dm -*** the `DMCOMPOSITE`
- ***pvec -*** packed vector
- ***nwanted -*** number of vectors wanted
- ***wanted -*** sorted array of vectors wanted, or NULL to get all vectors



## Output Parameters

- ***vecs -*** array of requested global vectors (must be allocated)





## Note
Use `DMCompositeRestoreAccessArray()` to return the vectors when you no longer need them


## See Also
 `DMCOMPOSITE`, `DM`, `DMCompositeGetAccess()`, `DMCompositeGetEntries()`, `DMCompositeScatter()`, `DMCompositeGather()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/composite/pack.c.html#DMCompositeGetAccessArray">src/dm/impls/composite/pack.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex73f90t.F90.html">src/snes/tutorials/ex73f90t.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/utils/dmplexlandau/tutorials/ex2.c.html">src/ts/utils/dmplexlandau/tutorials/ex2.c.html</A><BR>


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


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