Skip to main content
`Ctrl`+`K`

# PCASMGetSubKSP

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

## Synopsis

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

Collective iff first_local is requested

## 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`, all processors must request or all must pass `NULL`

- ksp - the array of `KSP` contexts

## Notes

After `PCASMGetSubKSP()` the array of `KSP`s is not to be freed.

You must call `KSPSetUp()` before calling `PCASMGetSubKSP()`.

## Fortran Note

Call `PCASMRestoreSubKSP()` when access to the array of `KSP` is no longer needed

## See Also

KSP: Linear System Solvers, `PCASM`, `PCASMSetTotalSubdomains()`, `PCASMSetOverlap()`, `PCASMCreateSubdomains2D()`,

## Level

advanced

## Location

src/ksp/pc/impls/asm/asm.c

## Examples

src/ksp/ksp/tutorials/ex8.c

## Implementations

PCASMGetSubKSP_ASM() in src/ksp/pc/impls/asm/asm.c

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