petsc-3.7.1 2016-05-15
Report Typos and Errors

# KSPSetDiagonalScale

Tells KSP to symmetrically diagonally scale the system before solving. This actually CHANGES the matrix (and right hand side).

### Synopsis

    #include "petscksp.h"
    PetscErrorCode  KSPSetDiagonalScale(KSP ksp,PetscBool scale)

Logically Collective on KSP Many br

### Input Parameter

| ksp | - the KSP context Many br
| scale | - PETSC_TRUE or PETSC_FALSE Many br

### Options Database Key

| -ksp_diagonal_scale | - Many br
| -ksp_diagonal_scale_fix | - scale the matrix back AFTER the solve Many br

Notes: Scales the matrix by D^(-1/2) A D^(-1/2) [D^(1/2) x ] = D^(-1/2) b Many brwhere D_{ii} is 1/abs(A_{ii}) unless A_{ii} is zero and then it is 1. Many br

BE CAREFUL with this routine: it actually scales the matrix and right Many brhand side that define the system. After the system is solved the matrix Many brand right hand side remain scaled unless you use KSPSetDiagonalScaleFix() Many br

This should NOT be used within the SNES solves if you are using a line Many brsearch. Many br

If you use this with the PCType Eisenstat preconditioner than you can Many bruse the PCEisenstatSetNoDiagonalScaling() option, or -pc_eisenstat_no_diagonal_scaling Many brto save some unneeded, redundant flops. Many br

Many br

### Keywords

KSP, set, options, prefix, database

### See Also

KSPGetDiagonalScale(), KSPSetDiagonalScaleFix()

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