:orphan:
# ISCreateSubIS
Create a sub index set from a global index set selecting some components. 
## Synopsis
```
#include "petscis.h" 
PetscErrorCode ISCreateSubIS(IS is, IS comps, IS *subis)
```
Collective


## Input Parameters

- ***is -*** the index set
- ***comps -*** which components we will extract from `is`



## Output Parameters

- ***subis -*** the new sub index set



## Example usage

## We have an index set (is) living on 3 processes with the following values
| 4 9 0 | 2 6 7 | 10 11 1|
and another index set (comps) used to indicate which components of is  we want to take,
| 7 5  | 1 2 | 0 4|

## The output index set (subis) should look like
| 11 7 | 9 0 | 4 6|




## See Also
 `IS`, `VecGetSubVector()`, `MatCreateSubMatrix()`

## Level
intermediate

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


---
[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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
