xref: /petsc/include/petscsnes.h (revision ce3d82be170ec3abe7bd7fd1faee9bf85da28120)
1*ce3d82beSBarry Smith /* $Id: snes.h,v 1.3 1995/03/20 00:43:49 bsmith Exp bsmith $ */
2b1f5cb9dSBarry Smith 
3f03417d3SBarry Smith #if !defined(__SNES_PACKAGE)
4f03417d3SBarry Smith #define __SNES_PACKAGE
5*ce3d82beSBarry Smith #include "sles.h"
6b1f5cb9dSBarry Smith 
7353a3ba4SBarry Smith typedef struct _SNES* SNES;
8*ce3d82beSBarry Smith #define SNES_COOKIE PETSC_COOKIE+13
9b1f5cb9dSBarry Smith 
10*ce3d82beSBarry Smith typedef enum { SNES_NLS,
11*ce3d82beSBarry Smith                SNES_NTR,
12*ce3d82beSBarry Smith                SNES_NTR_DOG_LEG,
13353a3ba4SBarry Smith                SNES_NTR2_LIN,
14*ce3d82beSBarry Smith                SUMS_NLS,
15*ce3d82beSBarry Smith                SUMS_NTR }
16353a3ba4SBarry Smith   SNESMETHOD;
17b1f5cb9dSBarry Smith 
18353a3ba4SBarry Smith typedef enum { SNESINITIAL_GUESS,
19353a3ba4SBarry Smith                SNESRESIDUAL,
20353a3ba4SBarry Smith                SNESFUNCTION,
21353a3ba4SBarry Smith                SNESGRADIENT,
22353a3ba4SBarry Smith                SNESMATRIX,
23353a3ba4SBarry Smith                SNESCORE,
24353a3ba4SBarry Smith                SNESSTEP_SETUP,
25353a3ba4SBarry Smith                SNESSTEP_COMPUTE,
26353a3ba4SBarry Smith                SNESSTEP_DESTROY,
27353a3ba4SBarry Smith                SNESTOTAL }
28353a3ba4SBarry Smith    SNESPHASE;
29f03417d3SBarry Smith 
30*ce3d82beSBarry Smith typedef enum { SNES_T, SUMS_T } SNESTYPE;
31f03417d3SBarry Smith 
32*ce3d82beSBarry Smith extern int SNESCreate(MPI_Comm,SNES*);
33*ce3d82beSBarry Smith extern int SNESSetMethod(SNES,SNESMETHOD);
34*ce3d82beSBarry Smith extern int SNESSetMonitor(SNES, int (*)(SNES,int,Vec,Vec,double,void*),void *);
35*ce3d82beSBarry Smith extern int SNESSetSolution(SNES,Vec,int (*)(Vec,void*),void *);
36*ce3d82beSBarry Smith extern int SNESSetResidual(SNES, Vec, int (*)(Vec,Vec,void*),void *,int);
37*ce3d82beSBarry Smith extern int SNESSetJacobian(SNES,Mat,int (*)(Vec,Mat*,void*),void *);
38*ce3d82beSBarry Smith extern int SNESDestroy(SNES);
39353a3ba4SBarry Smith extern int SNESSetUp(SNES);
40*ce3d82beSBarry Smith extern int SNESSolve(SNES,int*);
41*ce3d82beSBarry Smith extern int SNESRegister(int, char*, int (*)(SNES));
42*ce3d82beSBarry Smith extern int SNESRegisterAll();
43*ce3d82beSBarry Smith extern int SNESGetSLES(SNES,SLES*);
44*ce3d82beSBarry Smith extern int SNESNoLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
45*ce3d82beSBarry Smith extern int SNESCubicLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
46*ce3d82beSBarry Smith extern int SNESQuadraticLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
47*ce3d82beSBarry Smith 
48*ce3d82beSBarry Smith extern int SNESGetSolution(SNES,Vec*);
49*ce3d82beSBarry Smith extern int SNESGetResidual(SNES,Vec*);
50*ce3d82beSBarry Smith 
51*ce3d82beSBarry Smith extern int SNESPrintHelp(SNES);
52*ce3d82beSBarry Smith extern int SNESSetFromOptions(SNES);
53*ce3d82beSBarry Smith extern int SNESDefaultMonitor(SNES,int, Vec,Vec,double,void *);
54*ce3d82beSBarry Smith extern int SNESDefaultConverged(SNES,double,double,double,void*);
55*ce3d82beSBarry Smith 
56*ce3d82beSBarry Smith extern int SNESSetSolutionTol(SNES,double);
57*ce3d82beSBarry Smith extern int SNESSetAbsConvergenceTol(SNES,double);
58*ce3d82beSBarry Smith extern int SNESSetRelConvergenceTol(SNES,double);
59*ce3d82beSBarry Smith #endif
60b1f5cb9dSBarry Smith 
61