# PCApplyRichardson
Applies several steps of Richardson iteration with the particular preconditioner. This routine is usually used by the Krylov solvers and not the application code directly. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCApplyRichardson(PC pc, Vec b, Vec y, Vec w, PetscReal rtol, PetscReal abstol, PetscReal dtol, PetscInt its, PetscBool guesszero, PetscInt *outits, PCRichardsonConvergedReason *reason)
```
Collective


## Input Parameters

- ***pc  -*** the preconditioner context
- ***b   -*** the right hand side
- ***w   -*** one work vector
- ***rtol -*** relative decrease in residual norm convergence criteria
- ***abstol -*** absolute residual norm convergence criteria
- ***dtol -*** divergence residual norm increase criteria
- ***its -*** the number of iterations to apply.
- ***guesszero -*** if the input x contains nonzero initial guess



## Output Parameters

- ***outits -*** number of iterations actually used (for SOR this always equals its)
- ***reason -*** the reason the apply terminated
- ***y -*** the solution (also contains initial guess if guesszero is `PETSC_FALSE`



## Notes
Most preconditioners do not support this function. Use the command
`PCApplyRichardsonExists()` to determine if one does.

Except for the `PCMG` this routine ignores the convergence tolerances
and always runs for the number of iterations




## See Also
 `PC`, `PCApplyRichardsonExists()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/interface/precon.c.html#PCApplyRichardson">src/ksp/pc/interface/precon.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCApplyRichardson_PFMG">PCApplyRichardson_PFMG in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCApplyRichardson_SysPFMG">PCApplyRichardson_SysPFMG in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCApplyRichardson_SMG">PCApplyRichardson_SMG in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCApplyRichardson_MG">PCApplyRichardson_MG in src/ksp/pc/impls/mg/mg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCApplyRichardson_Shell">PCApplyRichardson_Shell in src/ksp/pc/impls/shell/shellpc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/sor/sor.c.html#PCApplyRichardson_SOR">PCApplyRichardson_SOR in src/ksp/pc/impls/sor/sor.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/telescope/telescope.c.html#PCApplyRichardson_Telescope">PCApplyRichardson_Telescope in src/ksp/pc/impls/telescope/telescope.c</A><BR>


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


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