:orphan:
# KSPHPDDMSetDeflationMat
Sets the deflation space used by Krylov methods in `KSPHPDDM` with recycling. This space is viewed as a set of vectors stored in a `MATDENSE` (column major). 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPHPDDMSetDeflationMat(KSP ksp, Mat U)
```

## Input Parameters

- ***ksp -*** iterative context
- ***U -*** deflation space to be used during KSPSolve()





## See Also
 [](ch_ksp), `KSPHPDDM`, `KSPCreate()`, `KSPType`, `KSPHPDDMGetDeflationMat()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/hpddm/hpddm.cxx.html#KSPHPDDMSetDeflationMat">src/ksp/ksp/impls/hpddm/hpddm.cxx</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex75.c.html">src/ksp/ksp/tutorials/ex75.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex75f.F90.html">src/ksp/ksp/tutorials/ex75f.F90</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/hpddm/hpddm.cxx.html#KSPHPDDMSetDeflationMat_HPDDM">KSPHPDDMSetDeflationMat_HPDDM in src/ksp/ksp/impls/hpddm/hpddm.cxx</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/impls/hpddm/hpddm.cxx)


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