Skip to main content
`Ctrl`+`K`

# MFNSetErrorIfNotConverged

Causes `MFNSolve()` to generate an error if the solver has not converged.

## Synopsis

    #include "slepcmfn.h"
    PetscErrorCode MFNSetErrorIfNotConverged(MFN mfn,PetscBool flg)

Logically Collective

## Input Parameters

- mfn - the matrix function solver context

- flg - `PETSC_TRUE` indicates you want the error generated

## Options Database Key

- -mfn_error_if_not_converged (true|false) - generate an error and stop the program

## Note

Normally SLEPc continues if the solver fails to converge, you can call `MFNGetConvergedReason()` after a `MFNSolve()` to determine if it has converged.

## See Also

MFN: Matrix Function, `MFNGetErrorIfNotConverged()`

## Level

intermediate

## Location

src/mfn/interface/mfnopts.c

## Examples

src/mfn/tutorials/ex39.c
src/mfn/tutorials/ex26.c

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