# SNESMultiblockGetSubSNES
Gets the `SNES` contexts for all blocks in a `SNESMULTBLOCK` solver.
## Synopsis
```
#include "petscsnes.h"
PetscErrorCode SNESMultiblockGetSubSNES(SNES snes, PetscInt *n, SNES *subsnes[])
```
Not Collective but each `SNES` obtained is parallel
## Input Parameter
- ***snes -*** the solver context
## Output Parameters
- ***n -*** the number of blocks
- ***subsnes -*** the array of `SNES` contexts
## Note
After `SNESMultiblockGetSubSNES()` the array of `SNES`s MUST be freed by the user
(not each `SNES`, just the array that contains them).
You must call `SNESSetUp()` before calling `SNESMultiblockGetSubSNES()`.
## See Also
`SNESMULTBLOCK`, `SNESMultiblockSetIS()`, `SNESMultiblockSetFields()`
## Level
advanced
## Location
src/snes/impls/multiblock/multiblock.c
## Implementations
SNESMultiblockGetSubSNES_Default in src/snes/impls/multiblock/multiblock.c
---
[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)