Skip to main content
`Ctrl`+`K`

# KSPPSolveFn

A function prototype for functions provided to `KSPSetPreSolve()` and `KSPSetPostSolve()`

## Synopsis

    PETSC_EXTERN_TYPEDEF typedef PetscErrorCode KSPPSolveFn(KSP ksp, Vec rhs, Vec x, void *ctx);

## Calling Sequence

- ksp - the `KSP` context

- rhs - the right-hand side vector

- x - the solution vector

- ctx - optional context that was provided with `KSPSetPreSolve()` or `KSPSetPostSolve()`

## See Also

SNES: Nonlinear Solvers, `KSP`, `KSPSetPreSolve()`, `KSPSetPostSolve()`, `PCShellPSolveFn`

## Level

intermediate

## Location

include/petscksp.h

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