# ISCreateBlock
Creates a data structure for an index set containing a list of integers. Each integer represents a fixed block size set of indices. 
## Synopsis
```
#include "petscis.h"     
PetscErrorCode ISCreateBlock(MPI_Comm comm, PetscInt bs, PetscInt n, const PetscInt idx[], PetscCopyMode mode, IS *is)
```
Collective


## Input Parameters

- ***comm -*** the MPI communicator
- ***bs -*** number of elements in each block
- ***n -*** the length of the index set (the number of blocks)
- ***idx -*** the list of integers, one for each block, the integers contain the index of the first entry of each block divided by the block size
- ***mode -*** see `PetscCopyMode`, only `PETSC_COPY_VALUES` and `PETSC_OWN_POINTER` are supported in this routine



## Output Parameter

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





## Notes
When the communicator is not `MPI_COMM_SELF`, the operations on the
index sets, `IS`, are NOT conceptually the same as `MPI_Group` operations.
The index sets are then distributed sets of indices and thus certain operations
on them are collective.

The routine `ISBlockSetIndices()` can be used to provide the indices to a preexisting block `IS`


## Example
If you wish to index the values {0,1,6,7}, then use
a block size of 2 and idx of {0,3}.


## See Also
 [](sec_scatter), `IS`, `ISCreateStride()`, `ISCreateGeneral()`, `ISAllGather()`, `ISBlockSetIndices()`, `ISBLOCK`, `ISGENERAL`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/impls/block/block.c.html#ISCreateBlock">src/vec/is/is/impls/block/block.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/ex3.c.html">src/vec/is/is/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/tutorials/ex3f90.F90.html">src/vec/is/is/tutorials/ex3f90.F90.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>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/is/impls/block/block.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)  
