Skip to main content
`Ctrl`+`K`

# PCKSPSetKSP

Sets the `KSP` context for a `PCKSP`.

## Synopsis

    #include "petscksp.h"
    PetscErrorCode PCKSPSetKSP(PC pc, KSP ksp)

Collective

## Input Parameters

- pc - the preconditioner context

- ksp - the `KSP` solver

## Notes

The `PC` and the `KSP` must have the same communicator

This would rarely be used, the standard usage is to call `PCKSPGetKSP()` and then change options on that `KSP`

## See Also

KSP: Linear System Solvers, `PCKSP`, `PCKSPGetKSP()`

## Level

advanced

## Location

src/ksp/pc/impls/ksp/pcksp.c

## Implementations

PCKSPSetKSP_KSP() in src/ksp/pc/impls/ksp/pcksp.c

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