PCGalerkinGetKSP — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PCGalerkinGetKSP

Gets the `KSP` object in the `PCGALERKIN`

## Synopsis

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

Not Collective

## Input Parameter

- pc - the preconditioner context

## Output Parameter

- ksp - the `KSP` object

## Note

Once you have called this routine you can call `KSPSetOperators()` on the resulting `KSP` to provide the operator for the Galerkin problem, an alternative is to use `PCGalerkinSetComputeSubmatrix()` to provide a routine that computes the submatrix as needed.

## See Also

KSP: Linear System Solvers, `PC`, `PCCreate()`, `PCSetType()`, `PCType`, `PCGALERKIN`, `PCGalerkinSetRestriction()`, `PCGalerkinSetInterpolation()`, `PCGalerkinSetComputeSubmatrix()`

## Level

intermediate

## Location

src/ksp/pc/impls/galerkin/galerkin.c

## Implementations

PCGalerkinGetKSP_Galerkin() in src/ksp/pc/impls/galerkin/galerkin.c

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