ISRestoreIndices#

Restores an index set to a usable state after a call to ISGetIndices().

Synopsis#

#include "petscis.h" 
PetscErrorCode ISRestoreIndices(IS is, const PetscInt *ptr[])

Not Collective

Input Parameters#

  • is - the index set

  • ptr - the pointer obtained by ISGetIndices()

Fortran Note#

This routine is used differently from Fortran

IS          is
integer     is_array(1)
int         ierr
call ISGetIndices(is,is_array,i_is,ierr)

Access first local entry in list
value = is_array(i_is + 1)

...... other code
call ISRestoreIndices(is,is_array,i_is,ierr)

See the Fortran chapter of the users manual and petsc/src/vec/is/tests for details.

Note#

This routine zeros out ptr. This is to prevent accidental us of the array after it has been restored.

See Also#

ISGetIndices(), ISRestoreIndicesF90()

Level#

intermediate

Location#

src/vec/is/is/interface/index.c

Examples#

src/vec/vec/utils/tagger/tutorials/ex1.c.html
src/vec/is/is/tutorials/ex1.c.html
src/vec/is/is/tutorials/ex1f.F90.html
src/vec/is/is/tutorials/ex2.c.html
src/vec/is/is/tutorials/ex2f.F90.html
src/vec/is/is/tutorials/ex3.c.html
src/dm/impls/plex/tutorials/ex10.c.html
src/dm/tutorials/ex22.c.html
src/dm/tutorials/swarm_ex3.c.html
src/ksp/ksp/tutorials/ex71.c.html
src/ksp/ksp/tutorials/ex76.c.html

Implementations#

ISRestoreIndices_Block in src/vec/is/is/impls/block/block.c
ISRestoreIndices_General in src/vec/is/is/impls/general/general.c
ISRestoreIndices_Stride in src/vec/is/is/impls/stride/stride.c


Edit on GitLab

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