DMGetLocalToGlobalMapping#

Accesses the local-to-global mapping in a DM.

Synopsis#

#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMGetLocalToGlobalMapping(DM dm, ISLocalToGlobalMapping *ltog)

Collective

Input Parameter#

  • dm - the DM that provides the mapping

Output Parameter#

  • ltog - the mapping

Notes#

The global to local mapping allows one to set values into the global vector or matrix using VecSetValuesLocal() and MatSetValuesLocal()

Vectors obtained with DMCreateGlobalVector() and matrices obtained with DMCreateMatrix() already contain the global mapping so you do need to use this function with those objects.

This mapping can then be used by VecSetLocalToGlobalMapping() or MatSetLocalToGlobalMapping().

If the DM has a local section, it must have been set up with PetscSectionSetUp() before the mapping is built, otherwise an error is raised.

The mapping is owned by the DM: do not destroy it. A mapping derived from the sections is invalidated by a subsequent call to DMSetLocalSection() or DMSetGlobalSection().

See Also#

DM Basics, DM, DMCreateLocalVector(), DMCreateGlobalVector(), VecSetLocalToGlobalMapping(), MatSetLocalToGlobalMapping(), DMCreateMatrix()

Level#

advanced

Location#

src/dm/interface/dm.c

Examples#

src/tao/bound/tutorials/plate2.c
src/snes/tutorials/ex48.c
src/tao/bound/tutorials/plate2f.F90
src/ksp/ksp/tutorials/ex71.c
src/ksp/ksp/tutorials/ex43.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex14f.F90
src/ksp/ksp/tutorials/ex70.c

Implementations#

DMGetLocalToGlobalMapping_Composite() in src/dm/impls/composite/pack.c


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