petsc-3.3-p7 2013-05-11

DMLocalToGlobalBegin

updates global vectors from local vectors

Synopsis

#include "petscdm.h"     
PetscErrorCode  DMLocalToGlobalBegin(DM dm,Vec l,InsertMode mode,Vec g)
Neighbor-wise Collective on DM

Input Parameters

dm - the DM object
l - the local vector
mode - if INSERT_VALUES then no parallel communication is used, if ADD_VALUES then all ghost points from the same base point accumulate into that base point.
- the global vector- Notes: In the ADD_VALUES case you normally would zero the receiving vector before beginning this operation. If you would like to simply add the non-ghosted values in the local array into the global array you need to either (1) zero the ghosted locations and use ADD_VALUES or (2) use INSERT_VALUES into a work global array and then add the work global array to the final global array with VecAXPY().

See Also

DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocalEnd(), DMGlobalToLocalBegin()

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

Examples

src/dm/examples/tutorials/ex1.c.html
src/dm/examples/tutorials/ex3.c.html
src/dm/examples/tutorials/ex5.c.html
src/dm/examples/tutorials/ex7.c.html
src/dm/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex31.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html
src/ksp/ksp/examples/tutorials/ex43.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html
src/ksp/ksp/examples/tutorials/ex14f.F.html
src/snes/examples/tutorials/ex5.c.html