# DMDAGlobalToNaturalBegin
Maps values from the global vector to a global vector in the "natural" grid ordering. Must be followed by `DMDAGlobalToNaturalEnd()` to complete the exchange. 
## Synopsis
```
#include "petscdmda.h"   
PetscErrorCode DMDAGlobalToNaturalBegin(DM da, Vec g, InsertMode mode, Vec n)
```
Neighbor-wise Collective on da


## Input Parameters

- ***da -*** the distributed array context
- ***g -*** the global vector
- ***mode -*** one of `INSERT_VALUES` or `ADD_VALUES`



## Output Parameter

- ***l  -*** the natural ordering values





## Notes
The global and natural vectors used here need not be the same as those
obtained from `DMCreateGlobalVector()` and `DMDACreateNaturalVector()`, BUT they
must have the same parallel data layout; they could, for example, be
obtained with `VecDuplicate()` from the `DMDA` originating vectors.

You must call `DMDACreateNaturalVector()` before using this routine


## See Also
 `DM`, `DMDA`, `DMDAGlobalToNaturalEnd()`, `DMLocalToGlobalBegin()`, `DMDACreate2d()`,
`DMGlobalToLocalBegin()`, `DMGlobalToLocalEnd()`, `DMDACreateNaturalVector()`

## Level
advanced

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/da/dagtol.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)  
