SNESSetMaxNonlinearStepFailures#

Sets the maximum number of unsuccessful steps attempted by the nonlinear solver before it gives up and returns unconverged or generates an error

Synopsis#

#include "petscsnes.h"  
#include "petscsnes.h"  
PetscErrorCode SNESSetMaxNonlinearStepFailures(SNES snes, PetscInt maxFails)

Not Collective

Input Parameters#

  • snes - SNES context

  • maxFails - maximum of unsuccessful steps allowed, use PETSC_UNLIMITED to have no limit on the number of failures

Options Database Key#

  • -snes_max_fail - maximum number of unsuccessful steps allowed

Note#

A failed step is a step that was generated and taken but did not satisfy the requested criteria. For example, the SNESLineSearchApply() could not generate a sufficient decrease in the function norm (in fact it may have produced an increase).

Taken steps that produce a infinity or NaN in the function evaluation or generate a SNESSetFunctionDomainError() will always immediately terminate the SNESSolve() regardless of the value of maxFails.

Developer Note#

The options database key is wrong for this function name

See Also#

SNES: Nonlinear Solvers, SNESSetErrorIfNotConverged(), SNESGetMaxLinearSolveFailures(), SNESGetLinearSolveIterations(), SNESSetMaxLinearSolveFailures(), SNESGetLinearSolveFailures(), SNESGetMaxNonlinearStepFailures(), SNESGetNonlinearStepFailures(), SNESCheckLineSearchFailure()

Level#

intermediate

Location#

src/snes/interface/snes.c


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