# DMCompositeGather
Gathers into a global packed vector from its individual local vectors 
## Synopsis
```
#include "petscdmcomposite.h"  
PetscErrorCode DMCompositeGather(DM dm, InsertMode imode, Vec gvec, ...)
```
Collective on dm


## Input Parameters

- ***dm -*** the `DMCOMPOSITE` object
- ***gvec -*** the global vector
- ***imode -*** `INSERT_VALUES` or `ADD_VALUES`
- ***Vec ... -*** the individual sequential vectors, NULL for any that are not needed





## Fortran Note
Fortran users should use `DMCompositeGatherArray()`


## See Also
 `DMCOMPOSITE`, `DM`, `DMDestroy()`, `DMCompositeAddDM()`, `DMCreateGlobalVector()`,
`DMCompositeScatter()`, `DMCompositeCreate()`, `DMCompositeGetISLocalToGlobalMappings()`, `DMCompositeGetAccess()`,
`DMCompositeGetLocalVectors()`, `DMCompositeRestoreLocalVectors()`, `DMCompositeGetEntries()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex21.c.html">src/snes/tutorials/ex21.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)  
