petsc-master 2020-11-24
Report Typos and Errors


populate an internal 1-to-1 local-to-global map


PetscErrorCode DMStagPopulateLocalToGlobalInjective(DM dm)

Creates an internal object which explicitly maps a single local degree of freedom to each global degree of freedom. This is used, if populated, instead of SCATTER_REVERSE_LOCAL with the (1-to-many, in general) global-to-local map, when DMLocalToGlobal() is called with INSERT_VALUES. This allows usage, for example, even in the periodic, 1-rank case, where the inverse of the global-to-local map, even when restricted to on-rank communication, is non-injective. This is at the cost of storing an additional VecScatter object inside each DMStag object.

Input Parameter

dm - the DMStag object


In normal usage, library users shouldn't be concerned with this function, as it is called during DMSetUp(), when required.

Returns immediately if the internal map is already populated.

Developer Notes

This could, if desired, be moved up to a general DM routine. It would allow, for example, DMDA to support DMLocalToGlobal() with INSERT_VALUES, even in the single-rank periodic case.

See Also

DMSTAG, DMLocalToGlobal(), VecScatter






DMStagPopulateLocalToGlobalInjective_1d in src/dm/impls/stag/stag1d.c
DMStagPopulateLocalToGlobalInjective_2d in src/dm/impls/stag/stag2d.c
DMStagPopulateLocalToGlobalInjective_3d in src/dm/impls/stag/stag3d.c

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