petsc-3.3-p7 2013-05-11

SNESSetConvergenceTest

Sets the function that is to be used to test for convergence of the nonlinear iterative solution.

Synopsis

#include "petscsnes.h"  
#include "petscdmshell.h" 
#include "petscsys.h" 
PetscErrorCode  SNESSetConvergenceTest(SNES snes,PetscErrorCode (*func)(SNES,PetscInt,PetscReal,PetscReal,PetscReal,SNESConvergedReason*,void*),void *cctx,PetscErrorCode (*destroy)(void*))
Logically Collective on SNES

Input Parameters

snes - the SNES context
func - routine to test for convergence
cctx - [optional] context for private data for the convergence routine (may be PETSC_NULL)
destroy - [optional] destructor for the context (may be PETSC_NULL; PETSC_NULL_FUNCTION in Fortran)

Calling sequence of func

    PetscErrorCode func (SNES snes,PetscInt it,PetscReal xnorm,PetscReal gnorm,PetscReal f,SNESConvergedReason *reason,void *cctx)

snes - the SNES context
it - current iteration (0 is the first and is before any Newton step)
cctx - [optional] convergence context
reason - reason for convergence/divergence
xnorm - 2-norm of current iterate
gnorm - 2-norm of current step
f - 2-norm of function

Keywords

SNES, nonlinear, set, convergence, test

See Also

SNESDefaultConverged(), SNESSkipConverged()

Level:advanced
Location:
src/snes/interface/snes.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex30.c.html