Skip to main content
`Ctrl`+`K`

# KSPSetConvergedNegativeCurvature

Allows to declare convergence and return `KSP_CONVERGED_NEG_CURVE` when negative curvature is detected

## Synopsis

    #include "petscksp.h"
    PetscErrorCode KSPSetConvergedNegativeCurvature(KSP ksp, PetscBool flg)

Collective

## Input Parameters

- ksp - iterative context

- flg - the Boolean value

## Options Database Key

- -ksp_converged_neg_curve <bool> - Declare convergence if negative curvature is detected

## Note

This is currently used only by a subset of the Krylov solvers, namely `KSPCG`, `KSPSTCG`, `KSPQCG`, `KSPGLTR`, `KSPNASH`, and `KSPMINRES`.

## See Also

KSP: Linear System Solvers, `KSP`, `KSPConvergedReason`, `KSPGetConvergedNegativeCurvature()`

## Level

advanced

## Location

src/ksp/ksp/interface/iterativ.c

Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages