# ISGetIndices
Returns a pointer to the indices.  The user should call ISRestoreIndices() after having looked at the indices.  The user should NOT change the indices. 
## Synopsis
```
#include "petscis.h" 
PetscErrorCode ISGetIndices(IS is, const PetscInt *ptr[])
```
Not Collective


## Input Parameter

- ***is -*** the index set



## Output Parameter

- ***ptr -*** the location to put the pointer to the indices



## Fortran Note
This routine has two different interfaces from Fortran; the first is not recommend, it does not require Fortran 90
```none
IS          is
```
```none
integer     is_array(1)
```
```none
PetscOffset i_is
```
```none
int         ierr
```
```none
call ISGetIndices(is,is_array,i_is,ierr)
```
```none
```
```none
Access first local entry in list
```
```none
value = is_array(i_is + 1)
```
```none
```
```none
...... other code
```
```none
call ISRestoreIndices(is,is_array,i_is,ierr)
```
The second Fortran interface is recommended.
```none
use petscisdef
```
```none
PetscInt, pointer :: array(:)
```
```none
PetscErrorCode  ierr
```
```none
IS       i
```
```none
call ISGetIndicesF90(i,array,ierr)
```

See the Fortran chapter of the users manual and
petsc/src/is/[tutorials,tests] for details.




## See Also
 `ISRestoreIndices()`, `ISGetIndicesF90()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/interface/index.c.html#ISGetIndices">src/vec/is/is/interface/index.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/tagger/tutorials/ex1.c.html">src/vec/vec/utils/tagger/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/tutorials/ex1.c.html">src/vec/is/is/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/tutorials/ex1f.F90.html">src/vec/is/is/tutorials/ex1f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/tutorials/ex2.c.html">src/vec/is/is/tutorials/ex2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/tutorials/ex2f.F90.html">src/vec/is/is/tutorials/ex2f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/tutorials/ex3.c.html">src/vec/is/is/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/tutorials/ex10.c.html">src/dm/impls/plex/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex22.c.html">src/dm/tutorials/ex22.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/swarm_ex3.c.html">src/dm/tutorials/swarm_ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex71.c.html">src/ksp/ksp/tutorials/ex71.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex76.c.html">src/ksp/ksp/tutorials/ex76.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/impls/block/block.c.html#ISGetIndices_Block">ISGetIndices_Block in src/vec/is/is/impls/block/block.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/impls/general/general.c.html#ISGetIndices_General">ISGetIndices_General in src/vec/is/is/impls/general/general.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/impls/stride/stride.c.html#ISGetIndices_Stride">ISGetIndices_Stride in src/vec/is/is/impls/stride/stride.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/is/interface/index.c)


[Index of all IS routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
