DMGetLocalVector

Gets a Seq PETSc vector that may be used with the DMXXX routines. This vector has spaces for the ghost values.

Synopsis

#include "petscda.h"   
PetscErrorCode PETSCDM_DLLEXPORT DMGetLocalVector(DM dm,Vec* g)
Not Collective

Input Parameter

dm -the distributed array

Output Parameter

g -the local 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 DMRestoreLocalVector() DO NOT call VecDestroy() on it.

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

Keywords

distributed array, create, local, vector

See Also

DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(),
DACreate1d(), DACreate2d(), DACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobal(), DMCreateLocalVector(), DMRestoreLocalVector(), VecStrideMax(), VecStrideMin(), VecStrideNorm()

Level:beginner
Location:
src/dm/da/src/dalocal.c
Index of all DA routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex5f.F.html