xref: /petsc/include/petscsnes.h (revision edae2e7dd0bdd187ac013a59d14cdeee7e201c06)
1 /* $Id: snes.h,v 1.9 1995/05/02 02:21:55 bsmith Exp curfman $ */
2 
3 #if !defined(__SNES_PACKAGE)
4 #define __SNES_PACKAGE
5 #include "sles.h"
6 
7 typedef struct _SNES* SNES;
8 #define SNES_COOKIE PETSC_COOKIE+13
9 
10 typedef enum { SNES_NLS,
11                SNES_NTR,
12                SNES_NTR_DOG_LEG,
13                SNES_NTR2_LIN,
14                SUMS_NLS,
15                SUMS_NTR }
16   SNESMethod;
17 
18 typedef enum { SNES_T, SUMS_T } SNESTYPE;
19 
20 extern int SNESCreate(MPI_Comm,SNES*);
21 extern int SNESSetMethod(SNES,SNESMethod);
22 extern int SNESSetMonitor(SNES, int (*)(SNES,int,double,void*),void *);
23 extern int SNESSetSolution(SNES,Vec,int (*)(SNES,Vec,void*),void *);
24 extern int SNESSetFunction(SNES, Vec, int (*)(SNES,Vec,Vec,void*),void *,int);
25 extern int SNESSetJacobian(SNES,Mat,Mat,int(*)(SNES,Vec,Mat*,Mat*,int*,void*),void *);
26 extern int SNESDestroy(SNES);
27 extern int SNESSetUp(SNES);
28 extern int SNESSolve(SNES,int*);
29 extern int SNESRegister(int, char*, int (*)(SNES));
30 extern int SNESRegisterAll();
31 extern int SNESGetSLES(SNES,SLES*);
32 extern int SNESNoLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
33 extern int SNESCubicLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
34 extern int SNESQuadraticLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
35 
36 extern int SNESGetSolution(SNES,Vec*);
37 extern int SNESGetFunction(SNES,Vec*);
38 
39 extern int SNESPrintHelp(SNES);
40 extern int SNESSetFromOptions(SNES);
41 extern int SNESGetMethodName(SNESMethod,char **);
42 extern int SNESDefaultMonitor(SNES,int,double,void *);
43 extern int SNESDefaultConverged(SNES,double,double,double,void*);
44 
45 extern int SNESSetSolutionTolerance(SNES,double);
46 extern int SNESSetAbsoluteTolerance(SNES,double);
47 extern int SNESSetRelativeTolerance(SNES,double);
48 extern int SNESSetTruncationTolerance(SNES,double);
49 extern int SNESSetMaxIterations(SNES,int);
50 extern int SNESSetMaxResidualEvaluations(SNES,int);
51 
52 #if defined(__DRAW_PACKAGE)
53 #define SNESLGMonitorCreate  KSPLGMonitorCreate
54 #define SNESLGMonitorDestroy KSPLGMonitorDestroy
55 #define SNESLGMonitor        ((int (*)(SNES,int,double,void*))KSPLGMonitor)
56 #endif
57 
58 #endif
59 
60