1*0de89847SLois Curfman McInnes /* $Id: snes.h,v 1.4 1995/04/16 20:19:40 bsmith Exp curfman $ */ 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, 15ce3d82beSBarry 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 30ce3d82beSBarry Smith typedef enum { SNES_T, SUMS_T } SNESTYPE; 31f03417d3SBarry Smith 32ce3d82beSBarry Smith extern int SNESCreate(MPI_Comm,SNES*); 33ce3d82beSBarry Smith extern int SNESSetMethod(SNES,SNESMETHOD); 34ce3d82beSBarry Smith extern int SNESSetMonitor(SNES, int (*)(SNES,int,Vec,Vec,double,void*),void *); 35ce3d82beSBarry Smith extern int SNESSetSolution(SNES,Vec,int (*)(Vec,void*),void *); 36ce3d82beSBarry Smith extern int SNESSetResidual(SNES, Vec, int (*)(Vec,Vec,void*),void *,int); 37ce3d82beSBarry Smith extern int SNESSetJacobian(SNES,Mat,int (*)(Vec,Mat*,void*),void *); 38ce3d82beSBarry Smith extern int SNESDestroy(SNES); 39353a3ba4SBarry Smith extern int SNESSetUp(SNES); 40ce3d82beSBarry Smith extern int SNESSolve(SNES,int*); 41ce3d82beSBarry Smith extern int SNESRegister(int, char*, int (*)(SNES)); 42ce3d82beSBarry Smith extern int SNESRegisterAll(); 43ce3d82beSBarry Smith extern int SNESGetSLES(SNES,SLES*); 44ce3d82beSBarry Smith extern int SNESNoLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 45ce3d82beSBarry Smith extern int SNESCubicLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 46ce3d82beSBarry Smith extern int SNESQuadraticLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 47ce3d82beSBarry Smith 48ce3d82beSBarry Smith extern int SNESGetSolution(SNES,Vec*); 49ce3d82beSBarry Smith extern int SNESGetResidual(SNES,Vec*); 50ce3d82beSBarry Smith 51ce3d82beSBarry Smith extern int SNESPrintHelp(SNES); 52ce3d82beSBarry Smith extern int SNESSetFromOptions(SNES); 53ce3d82beSBarry Smith extern int SNESDefaultMonitor(SNES,int, Vec,Vec,double,void *); 54ce3d82beSBarry Smith extern int SNESDefaultConverged(SNES,double,double,double,void*); 55ce3d82beSBarry Smith 56*0de89847SLois Curfman McInnes extern int SNESSetSolutionTolerance(SNES,double); 57*0de89847SLois Curfman McInnes extern int SNESSetAbsoluteTolerance(SNES,double); 58*0de89847SLois Curfman McInnes extern int SNESSetRelativeTolerance(SNES,double); 59*0de89847SLois Curfman McInnes extern int SNESSetTruncationTolerance(SNES,double); 60*0de89847SLois Curfman McInnes extern int SNESSetMaxIterations(SNES,int); 61*0de89847SLois Curfman McInnes extern int SNESSetMaxResidualEvaluations(SNES,int); 62ce3d82beSBarry Smith #endif 63b1f5cb9dSBarry Smith 64