# KSPView
Prints the `KSP` data structure. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPView(KSP ksp, PetscViewer viewer)
```
Collective


## Input Parameters

- ***ksp -*** the Krylov space context
- ***viewer -*** visualization context



## Options Database Keys

- ***-ksp_view -*** print the `KSP` data structure at the end of each `KSPSolve()` call



## Notes
The available visualization contexts include

- ***`PETSC_VIEWER_STDOUT_SELF` -*** standard output (default)
- ***`PETSC_VIEWER_STDOUT_WORLD` -*** synchronized standard
output where only the first processor opens
the file.  All other processors send their
data to the first processor to print.


The available formats include

- ***`PETSC_VIEWER_DEFAULT` -*** standard output (default)
- ***`PETSC_VIEWER_ASCII_INFO_DETAIL` -*** more verbose output for PCBJACOBI and PCASM


The user can open an alternative visualization context with
`PetscViewerASCIIOpen()` - output to a specified file.

In the debugger you can do call `KSPView(ksp,0)` to display the `KSP`. (The same holds for any PETSc object viewer).




## See Also
 `KSP`, `PetscViewer`, `PCView()`, `PetscViewerASCIIOpen()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/itcreate.c.html#KSPView">src/ksp/ksp/interface/itcreate.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex1.c.html">src/ksp/ksp/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex1f.F90.html">src/ksp/ksp/tutorials/ex1f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex23.c.html">src/ksp/ksp/tutorials/ex23.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex72.c.html">src/ksp/ksp/tutorials/ex72.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/bcgsl/bcgsl.c.html#KSPView_BCGSL">KSPView_BCGSL in src/ksp/ksp/impls/bcgsl/bcgsl.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/cg/cg.c.html#KSPView_CG">KSPView_CG in src/ksp/ksp/impls/cg/cg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/cg/pipelcg/pipelcg.c.html#KSPView_PIPELCG">KSPView_PIPELCG in src/ksp/ksp/impls/cg/pipelcg/pipelcg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/cheby/cheby.c.html#KSPView_Chebyshev">KSPView_Chebyshev in src/ksp/ksp/impls/cheby/cheby.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/fcg/fcg.c.html#KSPView_FCG">KSPView_FCG in src/ksp/ksp/impls/fcg/fcg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/fcg/pipefcg/pipefcg.c.html#KSPView_PIPEFCG">KSPView_PIPEFCG in src/ksp/ksp/impls/fcg/pipefcg/pipefcg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/fetidp/fetidp.c.html#KSPView_FETIDP">KSPView_FETIDP in src/ksp/ksp/impls/fetidp/fetidp.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gcr/gcr.c.html#KSPView_GCR">KSPView_GCR in src/ksp/ksp/impls/gcr/gcr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gcr/pipegcr/pipegcr.c.html#KSPView_PIPEGCR">KSPView_PIPEGCR in src/ksp/ksp/impls/gcr/pipegcr/pipegcr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/agmres/agmres.c.html#KSPView_AGMRES">KSPView_AGMRES in src/ksp/ksp/impls/gmres/agmres/agmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/dgmres/dgmres.c.html#KSPView_DGMRES">KSPView_DGMRES in src/ksp/ksp/impls/gmres/dgmres/dgmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/gmres.c.html#KSPView_GMRES">KSPView_GMRES in src/ksp/ksp/impls/gmres/gmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/lgmres/lgmres.c.html#KSPView_LGMRES">KSPView_LGMRES in src/ksp/ksp/impls/gmres/lgmres/lgmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/pipefgmres/pipefgmres.c.html#KSPView_PIPEFGMRES">KSPView_PIPEFGMRES in src/ksp/ksp/impls/gmres/pipefgmres/pipefgmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/hpddm/hpddm.cxx.html#KSPView_HPDDM">KSPView_HPDDM in src/ksp/ksp/impls/hpddm/hpddm.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/lcd/lcd.c.html#KSPView_LCD">KSPView_LCD in src/ksp/ksp/impls/lcd/lcd.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/lsqr/lsqr.c.html#KSPView_LSQR">KSPView_LSQR in src/ksp/ksp/impls/lsqr/lsqr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/rich/rich.c.html#KSPView_Richardson">KSPView_Richardson in src/ksp/ksp/impls/rich/rich.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/itcreate.c)


[Index of all KSP routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
