PCBJacobiGetSubKSP — PETSc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# PCBJacobiGetSubKSP

Gets the local `KSP` contexts for all blocks on this processor.

## Synopsis

    #include "petscpc.h"
    PetscErrorCode PCBJacobiGetSubKSP(PC pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp[])

Not Collective

## Input Parameter

- pc - the preconditioner context

## Output Parameters

- n_local - the number of blocks on this processor, or NULL

- first_local - the global number of the first block on this processor, or NULL

- ksp - the array of KSP contexts

## Notes

After `PCBJacobiGetSubKSP()` the array of `KSP` contexts is not to be freed.

Currently for some matrix implementations only 1 block per processor is supported.

You must call `KSPSetUp()` or `PCSetUp()` before calling `PCBJacobiGetSubKSP()`.

## Fortran Note

Call `PCBJacobiRestoreSubKSP()` when you no longer need access to the array of `KSP`

## See Also

KSP: Linear System Solvers, `PCBJACOBI`, `PCASM`, `PCASMGetSubKSP()`

## Level

advanced

## Location

src/ksp/pc/impls/bjacobi/bjacobi.c

## Examples

src/ksp/ksp/tutorials/ex7.c
src/ksp/ksp/tutorials/ex7f.F90
src/snes/tutorials/ex3.c

## Implementations

PCBJacobiGetSubKSP_BJacobi() in src/ksp/pc/impls/bjacobi/bjacobi.c

Index of all PC routines
Table of Contents for all manual pages
Index of all manual pages