DMDAGlobalToNaturalBegin — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# DMDAGlobalToNaturalBegin

Maps values from the global vector obtained with `DMCreateGlobalVector()` 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

## Input Parameters

- da - the `DMDA` context

- g - the global vector, see `DMCreateGlobalVector()`

- mode - one of `INSERT_VALUES` or `ADD_VALUES`

## Output Parameter

- n - the natural ordering values, see `DMDACreateNaturalVector()`

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

DMDA - Creating vectors for structured grids, `DM`, `DMDA`, `DMDAGlobalToNaturalEnd()`, `DMLocalToGlobalBegin()`, `DMDACreate2d()`, `DMGlobalToLocalBegin()`, `DMGlobalToLocalEnd()`, `DMDACreateNaturalVector()`

## Level

advanced

## Location

src/dm/impls/da/dagtol.c

Index of all DMDA routines
Table of Contents for all manual pages
Index of all manual pages