# KSPSetNormType

Sets the norm that is used for convergence testing.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode PETSCKSP_DLLEXPORT KSPSetNormType(KSP ksp,KSPNormType normtype)

Collective on KSP

### Input Parameter

| ksp | - Krylov solver context
| normtype | - one of

      KSP_NORM_NO - skips computing the norm, this should only be used if you are using

                    the Krylov method as a smoother with a fixed small number of iterations.

                    You must also call KSPSetConvergenceTest(ksp,KSPSkipConverged,PETSC_NULL);

                    supported only by CG, Richardson, Bi-CG-stab, CR, and CGS methods.

      KSP_NORM_PRECONDITIONED - the default for left preconditioned solves, uses the l2 norm

                    of the preconditioned residual

      KSP_NORM_UNPRECONDITIONED - uses the l2 norm of the true b - Ax residual, supported only by

                    CG, CHEBYCHEV, and RICHARDSON, automatically true for right (see KSPSetPreconditioningSide())

                    preconditioning..

      KSP_NORM_NATURAL - supported  by cg, cr, and cgs

### Options Database Key

-ksp_norm_type <none,preconditioned,unpreconditioned,natural> - Notes: Currently only works with the CG, Richardson, Bi-CG-stab, CR, and CGS methods.

### Keywords

KSP, create, context, norms

### See Also

KSPSetUp(), KSPSolve(), KSPDestroy(), KSPSkipConverged()

Level:advanced
Location: src/ksp/ksp/interface/itcreate.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages