petsc-3.7.1 2016-05-15
Report Typos and Errors

# DMDAGetElements

Gets an array containing the indices (in local coordinates) of all the local elements

### Synopsis

    #include "petscdmda.h"
    #undef __FUNCT__
    #define __FUNCT__ "DMDAGetElements"
    PetscErrorCode  DMDAGetElements(DM dm,PetscInt *nel,PetscInt *nen,const PetscInt *e[])

Not Collective Many br

### Input Parameter

dm -the DM object Many br

### Output Parameters

| nel | - number of local elements Many br
| nen | - number of element nodes Many br
| e | - the local indices of the elements' vertices Many br

Many br

### Notes

Call DMDARestoreElements() once you have finished accessing the elements. Many br

Each process uniquely owns a subset of the elements. That is no element is owned by two or more processes. Many br

If on each process you integrate over its owned elements and use ADD_VALUES in Vec/MatSetValuesLocal() then you'll obtain the correct result. Many br

### See Also

DMDAElementType, DMDASetElementType(), VecSetValuesLocal(), MatSetValuesLocal(), DMGlobalToLocalBegin(), DMLocalToGlobalBegin()

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

### Examples

src/dm/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex31.c.html