petsc-3.4.2 2013-07-02

# DMGetGlobalVector

Gets a MPI PETSc vector that may be used with the DMXXX routines.

### Synopsis

    #include "petscdm.h"
    PetscErrorCode  DMGetGlobalVector(DM dm,Vec *g)

Collective on DM

### Input Parameter

dm -the distributed array

### Output Parameter

g -the global vector

### Note

The vector values are NOT initialized and may have garbage in them, so you may need to zero them.

The output parameter, g, is a regular PETSc vector that should be returned with DMRestoreGlobalVector() DO NOT call VecDestroy() on it.

VecStride*() operations can be useful when using DM with dof > 1

### Keywords

distributed array, create, Global, vector

### See Also

DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(),
DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMRestoreLocalVector() VecStrideMax(), VecStrideMin(), VecStrideNorm()

Level:beginner
Location:src/dm/interface/dmget.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/dm/examples/tutorials/ex6.c.html
src/dm/examples/tutorials/ex12.c.html
src/dm/examples/tutorials/ex51.c.html
src/dm/examples/tutorials/ex6f90.F.html
src/dm/examples/tutorials/ex11f90.F.html
src/ksp/ksp/examples/tutorials/ex31.c.html
src/snes/examples/tutorials/ex22.c.html
src/snes/examples/tutorials/ex31.c.html
src/snes/examples/tutorials/ex33.c.html
src/snes/examples/tutorials/ex52.c.html
src/snes/examples/tutorials/ex62.c.html