DMCreateGlobalVector#

Creates a global vector from a DM object. A global vector is a parallel vector that has no duplicate values shared between MPI ranks, that is it has no ghost locations.

Synopsis#

#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMCreateGlobalVector(DM dm, Vec *vec)

Collective

Input Parameter#

  • dm - the DM object

Output Parameter#

  • vec - the global vector

Note#

PETSc Vec always have all zero entries when created with DMCreateGlobalVector() until routines such as VecSet() or VecSetValues() are used to change the values. There is no reason to call VecZeroEntries() after creation.

See Also#

DM Basics, DM, Vec, DMCreateLocalVector(), DMGetGlobalVector(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd()

Level#

beginner

Location#

src/dm/interface/dm.c

Examples#

src/snes/tutorials/ex12.c
src/snes/tutorials/ex23.c
src/snes/tutorials/ex17.c
src/snes/tutorials/ex40f90.F90
src/snes/tutorials/ex15.c
src/snes/tutorials/ex8.c
src/snes/tutorials/ex28.c
src/snes/tutorials/ex21.c
src/snes/tutorials/ex14.c
src/snes/tutorials/ex35.c

Implementations#

DMCreateGlobalVector_Composite() in src/dm/impls/composite/pack.c
DMCreateGlobalVector_DA() in src/dm/impls/da/dadist.c
DMCreateGlobalVector_pforest() in src/dm/impls/forest/p4est/pforest.h
DMCreateGlobalVector_Moab() in src/dm/impls/moab/dmmbvec.cxx
DMCreateGlobalVector_Network() in src/dm/impls/network/networkcreate.c
DMCreateGlobalVector_Patch() in src/dm/impls/patch/patch.c
DMCreateGlobalVector_Plex() in src/dm/impls/plex/plexcreate.c
DMCreateGlobalVector_Redundant() in src/dm/impls/redundant/dmredundant.c
DMCreateGlobalVector_Shell() in src/dm/impls/shell/dmshell.c
DMCreateGlobalVector_Sliced() in src/dm/impls/sliced/sliced.c
DMCreateGlobalVector_Stag() in src/dm/impls/stag/stag.c
DMCreateGlobalVector_Swarm() in src/dm/impls/swarm/swarm.c
DMCreateGlobalVector_SNESVI() in src/snes/impls/vi/rs/virs.c


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