# ISCreateBlock

Creates a data structure for an index set containing a list of integers. The indices are relative to entries, not blocks.

### Synopsis

    #include "petscis.h"
    PetscErrorCode  ISCreateBlock(MPI_Comm comm,PetscInt bs,PetscInt n,const PetscInt idx[],IS *is)

Collective on MPI_Comm

### Input Parameters

| n | - the length of the index set (the number of blocks)
| bs | - number of elements in each block
| idx | - the list of integers
| comm | - the MPI communicator

### 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.

### Example

If you wish to index the values {0,1,4,5}, then use a block size of 2 and idx of {0,4}.

### See Also

ISCreateStride(), ISCreateGeneral(), ISAllGather()

Level:beginner
Location:src/vec/is/impls/block/block.c
Index of all IS routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/vec/is/examples/tutorials/ex3.c.html
src/vec/is/examples/tutorials/ex3f90.F.html
src/dm/ao/examples/tutorials/ex2.c.html
src/dm/da/examples/tutorials/ex6.c.html
src/dm/da/examples/tutorials/ex6f90.F.html