# DAGetGlobalIndices

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

### Synopsis

    #include "petscda.h"
    PetscErrorCode PETSCDM_DLLEXPORT DAGetGlobalIndices(DA 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 DA_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 DAXXXToXXX().

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

### Fortran Note

This routine is used differently from Fortran

            DA          da
            integer     n,da_array(1)
            PetscOffset i_da
            integer     ierr
            call DAGetGlobalIndices(da,n,da_array,i_da,ierr)

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

See the Fortran chapter of the users manual for details

### Keywords

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

### See Also

DACreate2d(), DAGetGhostCorners(), DAGetCorners(), DALocalToGlobal()
DAGlobalToLocalBegin(), DAGlobalToLocalEnd(), DALocalToLocalBegin(), DAGetAO(), DAGetGlobalIndicesF90() DAGetISLocalToGlobalMapping(), DACreate3d(), DACreate1d(), DALocalToLocalEnd()

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

### Examples

src/ksp/examples/tutorials/ex14f.F.html
src/snes/examples/tutorials/ex5f.F.html