petsc-3.3-p7 2013-05-11

DMDAGetGlobalIndices

Returns the global node number of all local nodes, including ghost nodes.

Synopsis

#include "petscdmda.h"   
PetscErrorCode  DMDAGetGlobalIndices(DM da,PetscInt *n,PetscInt **idx)
Not Collective

Input Parameter

da -the distributed array

Output Parameters

n - the number of local elements, including ghost nodes (or PETSC_NULL)
idx - the global indices

Note

For DMDA_STENCIL_STAR stencils the inactive corner ghost nodes are also included in the list of local indices (even though those nodes are not updated during calls to DMDAXXXToXXX().

Essentially the same data is returned in the form of a local-to-global mapping with the routine DMDAGetISLocalToGlobalMapping();

Fortran Note

This routine is used differently from Fortran
        DM          da
        integer     n,da_array(1)
        PetscOffset i_da
        integer     ierr
        call DMDAGetGlobalIndices(da,n,da_array,i_da,ierr)

   C Access first local entry in list
        value = da_array(i_da + 1)

See the <A href="../../docs/manual.pdf#nameddest=Chapter 9 PETSc for Fortran Users">Fortran chapter</A> of the users manual for details.

Keywords

distributed array, get, global, indices, local-to-global

See Also

DMDACreate2d(), DMDAGetGhostCorners(), DMDAGetCorners(), DMLocalToGlobalBegin()
DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMDALocalToLocalBegin(), DMDAGetAO(), DMDAGetGlobalIndicesF90() DMDAGetISLocalToGlobalMapping(), DMDACreate3d(), DMDACreate1d(), DMDALocalToLocalEnd(), DMDAGetOwnershipRanges()

Level:intermediate
Location:
src/dm/impls/da/daindex.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages

Examples

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/ex5f.F.html