# PCFieldSplitSetFields
Sets the fields that define one particular split in the field split preconditioner 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCFieldSplitSetFields(PC pc, const char splitname[], PetscInt n, const PetscInt *fields, const PetscInt *fields_col)
```
Logically Collective on pc


## Input Parameters

- ***pc  -*** the preconditioner context
- ***splitname -*** name of this split, if NULL the number of the split is used
- ***n -*** the number of fields in this split
- ***fields -*** the fields in this split
- ***fields_col -*** generally the same as fields, if it does not match fields then the matrix block that is solved for this set of fields comes from an off-diagonal block
of the matrix and fields_col provides the column indices for that block





## Notes
Use `PCFieldSplitSetIS()` to set a  general set of indices as a split.

`PCFieldSplitSetFields()` is for defining fields as strided blocks. For example, if the block
size is three then one can define a split as 0, or 1 or 2 or 0,1 or 0,2 or 1,2 which mean
0xx3xx6xx9xx12 ... x1xx4xx7xx ... xx2xx5xx8xx.. 01x34x67x... 0x1x3x5x7.. x12x45x78x....
where the numbered entries indicate what is in the split.

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

`PCFieldSplitSetIS()` does not support having a fields_col different from fields


## Developer Note
This routine does not actually create the `IS` representing the split, that is delayed
until `PCSetUp_FieldSplit()`, because information about the vector/matrix layouts may not be
available when this routine is called.


## See Also
 `PCFieldSplitGetSubKSP()`, `PCFIELDSPLIT`, `PCFieldSplitSetBlockSize()`, `PCFieldSplitSetIS()`, `PCFieldSplitRestrictIS()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/fieldsplit/fieldsplit.c.html#PCFieldSplitSetFields">src/ksp/pc/impls/fieldsplit/fieldsplit.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex42.c.html">src/ksp/ksp/tutorials/ex42.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex43.c.html">src/ksp/ksp/tutorials/ex43.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex70.c.html">src/ksp/ksp/tutorials/ex70.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/fieldsplit/fieldsplit.c.html#PCFieldSplitSetFields_FieldSplit">PCFieldSplitSetFields_FieldSplit in src/ksp/pc/impls/fieldsplit/fieldsplit.c</A><BR>


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


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