xref: /petsc/include/petscsnes.h (revision df60cc224878ed2ef3f52954bb2c505c4f71966d)
1*df60cc22SBarry Smith /* $Id: snes.h,v 1.14 1995/05/12 21:11:15 curfman Exp bsmith $ */
2b1f5cb9dSBarry Smith 
3f03417d3SBarry Smith #if !defined(__SNES_PACKAGE)
4f03417d3SBarry Smith #define __SNES_PACKAGE
5ce3d82beSBarry Smith #include "sles.h"
6b1f5cb9dSBarry Smith 
7353a3ba4SBarry Smith typedef struct _SNES* SNES;
8ce3d82beSBarry Smith #define SNES_COOKIE PETSC_COOKIE+13
9b1f5cb9dSBarry Smith 
10ce3d82beSBarry Smith typedef enum { SNES_NLS,
11ce3d82beSBarry Smith                SNES_NTR,
12ce3d82beSBarry Smith                SNES_NTR_DOG_LEG,
13353a3ba4SBarry Smith                SNES_NTR2_LIN,
14ce3d82beSBarry Smith                SUMS_NLS,
15c6abb9f5SBarry Smith                SUMS_NTR,
16748e9f0dSBarry Smith                SNES_NTEST }
1794a5d57cSLois Curfman McInnes   SNESMethod;
18b1f5cb9dSBarry Smith 
19ce3d82beSBarry Smith typedef enum { SNES_T, SUMS_T } SNESTYPE;
20f03417d3SBarry Smith 
21ce3d82beSBarry Smith extern int SNESCreate(MPI_Comm,SNES*);
2294a5d57cSLois Curfman McInnes extern int SNESSetMethod(SNES,SNESMethod);
23eafb4bcbSBarry Smith extern int SNESSetMonitor(SNES, int (*)(SNES,int,double,void*),void *);
244d08eca6SBarry Smith extern int SNESSetSolution(SNES,Vec,int (*)(SNES,Vec,void*),void *);
254d08eca6SBarry Smith extern int SNESSetFunction(SNES, Vec, int (*)(SNES,Vec,Vec,void*),void *,int);
26722fc279SLois Curfman McInnes extern int SNESSetJacobian(SNES,Mat,Mat,int(*)(SNES,Vec,Mat*,Mat*,MatStructure*,void*),void *);
27ce3d82beSBarry Smith extern int SNESDestroy(SNES);
28353a3ba4SBarry Smith extern int SNESSetUp(SNES);
29ce3d82beSBarry Smith extern int SNESSolve(SNES,int*);
30ce3d82beSBarry Smith extern int SNESRegister(int, char*, int (*)(SNES));
31ce3d82beSBarry Smith extern int SNESRegisterAll();
32ce3d82beSBarry Smith extern int SNESGetSLES(SNES,SLES*);
33ce3d82beSBarry Smith extern int SNESNoLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
34ce3d82beSBarry Smith extern int SNESCubicLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
35ce3d82beSBarry Smith extern int SNESQuadraticLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*);
36ce3d82beSBarry Smith 
37ce3d82beSBarry Smith extern int SNESGetSolution(SNES,Vec*);
38eafb4bcbSBarry Smith extern int SNESGetFunction(SNES,Vec*);
39ce3d82beSBarry Smith 
40ce3d82beSBarry Smith extern int SNESPrintHelp(SNES);
41ce3d82beSBarry Smith extern int SNESSetFromOptions(SNES);
4294a5d57cSLois Curfman McInnes extern int SNESGetMethodName(SNESMethod,char **);
43eafb4bcbSBarry Smith extern int SNESDefaultMonitor(SNES,int,double,void *);
44ce3d82beSBarry Smith extern int SNESDefaultConverged(SNES,double,double,double,void*);
45ce3d82beSBarry Smith 
460de89847SLois Curfman McInnes extern int SNESSetSolutionTolerance(SNES,double);
470de89847SLois Curfman McInnes extern int SNESSetAbsoluteTolerance(SNES,double);
480de89847SLois Curfman McInnes extern int SNESSetRelativeTolerance(SNES,double);
490de89847SLois Curfman McInnes extern int SNESSetTruncationTolerance(SNES,double);
500de89847SLois Curfman McInnes extern int SNESSetMaxIterations(SNES,int);
5106be10caSBarry Smith extern int SNESSetMaxFunctionEvaluations(SNES,int);
52eafb4bcbSBarry Smith 
53eafb4bcbSBarry Smith #if defined(__DRAW_PACKAGE)
54eafb4bcbSBarry Smith #define SNESLGMonitorCreate  KSPLGMonitorCreate
55eafb4bcbSBarry Smith #define SNESLGMonitorDestroy KSPLGMonitorDestroy
56eafb4bcbSBarry Smith #define SNESLGMonitor        ((int (*)(SNES,int,double,void*))KSPLGMonitor)
57eafb4bcbSBarry Smith #endif
58eafb4bcbSBarry Smith 
59748e9f0dSBarry Smith extern int SNESComputeInitialGuess(SNES,Vec);
60*df60cc22SBarry Smith 
61722fc279SLois Curfman McInnes extern int SNESDefaultComputeJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*);
62722fc279SLois Curfman McInnes extern int SNESDefaultMatrixFreeComputeJacobian(SNES,Vec,Mat*,Mat*,
63722fc279SLois Curfman McInnes                                                 MatStructure*,void*);
64748e9f0dSBarry Smith 
65ce3d82beSBarry Smith #endif
66b1f5cb9dSBarry Smith 
67