#include "petscksp.h" PetscErrorCode KSPSetDiagonalScale(KSP ksp,PetscBool scale)Logically Collective on ksp
ksp | - the KSP context | |
scale | - PETSC_TRUE or PETSC_FALSE |
-ksp_diagonal_scale | - | |
-ksp_diagonal_scale_fix | - scale the matrix back AFTER the solve |
BE CAREFUL with this routine: it actually scales the matrix and right hand side that define the system. After the system is solved the matrix and right hand side remain scaled unless you use KSPSetDiagonalScaleFix()
This should NOT be used within the SNES solves if you are using a line search.
If you use this with the PCType Eisenstat preconditioner than you can use the PCEisenstatSetNoDiagonalScaling() option, or -pc_eisenstat_no_diagonal_scaling to save some unneeded, redundant flops.