# SNESMultiblockSetFields
Sets the fields for one particular block in a `SNESMULTBLOCK` solver 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESMultiblockSetFields(SNES snes, const char name[], PetscInt n, const PetscInt *fields)
```
Logically Collective on snes


## Input Parameters

- ***snes   -*** the solver
- ***name   -*** name of this block, if NULL the number of the block is used
- ***n      -*** the number of fields in this block
- ***fields -*** the fields in this block





## Notes
Use `SNESMultiblockSetIS()` to set a completely general set of row indices as a block.

The `SNESMultiblockSetFields()` is for defining blocks as a group of strided indices, or fields.
For example, if the vector block size is three then one can define a block as field 0, or
1 or 2, or field 0,1 or 0,2 or 1,2 which means
0xx3xx6xx9xx12 ... x1xx4xx7xx ... xx2xx5xx8xx.. 01x34x67x... 0x1x3x5x7.. x12x45x78x....
where the numbered entries indicate what is in the block.

This function is called once per block (it creates a new block each time). Solve options
for this block will be available under the prefix -multiblock_BLOCKNAME_.


## See Also
 `SNESMULTBLOCK`, `SNESMultiblockGetSubSNES()`, `SNESMULTIBLOCK`, `SNESMultiblockSetBlockSize()`, `SNESMultiblockSetIS()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/multiblock/multiblock.c.html#SNESMultiblockSetFields">src/snes/impls/multiblock/multiblock.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/multiblock/multiblock.c.html#SNESMultiblockSetFields_Default">SNESMultiblockSetFields_Default in src/snes/impls/multiblock/multiblock.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/impls/multiblock/multiblock.c)


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