1*eafb4bcbSBarry Smith /* $Id: snes.h,v 1.6 1995/04/17 03:32:56 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, 15ce3d82beSBarry Smith SUMS_NTR } 16353a3ba4SBarry Smith SNESMETHOD; 17b1f5cb9dSBarry Smith 18ce3d82beSBarry Smith typedef enum { SNES_T, SUMS_T } SNESTYPE; 19f03417d3SBarry Smith 20ce3d82beSBarry Smith extern int SNESCreate(MPI_Comm,SNES*); 21ce3d82beSBarry Smith extern int SNESSetMethod(SNES,SNESMETHOD); 22*eafb4bcbSBarry Smith extern int SNESSetMonitor(SNES, int (*)(SNES,int,double,void*),void *); 23ce3d82beSBarry Smith extern int SNESSetSolution(SNES,Vec,int (*)(Vec,void*),void *); 24*eafb4bcbSBarry Smith extern int SNESSetFunction(SNES, Vec, int (*)(Vec,Vec,void*),void *,int); 25ce3d82beSBarry Smith extern int SNESSetJacobian(SNES,Mat,int (*)(Vec,Mat*,void*),void *); 26ce3d82beSBarry Smith extern int SNESDestroy(SNES); 27353a3ba4SBarry Smith extern int SNESSetUp(SNES); 28ce3d82beSBarry Smith extern int SNESSolve(SNES,int*); 29ce3d82beSBarry Smith extern int SNESRegister(int, char*, int (*)(SNES)); 30ce3d82beSBarry Smith extern int SNESRegisterAll(); 31ce3d82beSBarry Smith extern int SNESGetSLES(SNES,SLES*); 32ce3d82beSBarry Smith extern int SNESNoLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 33ce3d82beSBarry Smith extern int SNESCubicLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 34ce3d82beSBarry Smith extern int SNESQuadraticLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 35ce3d82beSBarry Smith 36ce3d82beSBarry Smith extern int SNESGetSolution(SNES,Vec*); 37*eafb4bcbSBarry Smith extern int SNESGetFunction(SNES,Vec*); 38ce3d82beSBarry Smith 39ce3d82beSBarry Smith extern int SNESPrintHelp(SNES); 40ce3d82beSBarry Smith extern int SNESSetFromOptions(SNES); 41a67c8522SLois Curfman McInnes extern int SNESGetMethodName(SNESMETHOD,char **); 42*eafb4bcbSBarry Smith extern int SNESDefaultMonitor(SNES,int,double,void *); 43ce3d82beSBarry Smith extern int SNESDefaultConverged(SNES,double,double,double,void*); 44ce3d82beSBarry Smith 450de89847SLois Curfman McInnes extern int SNESSetSolutionTolerance(SNES,double); 460de89847SLois Curfman McInnes extern int SNESSetAbsoluteTolerance(SNES,double); 470de89847SLois Curfman McInnes extern int SNESSetRelativeTolerance(SNES,double); 480de89847SLois Curfman McInnes extern int SNESSetTruncationTolerance(SNES,double); 490de89847SLois Curfman McInnes extern int SNESSetMaxIterations(SNES,int); 500de89847SLois Curfman McInnes extern int SNESSetMaxResidualEvaluations(SNES,int); 51*eafb4bcbSBarry Smith 52*eafb4bcbSBarry Smith #if defined(__DRAW_PACKAGE) 53*eafb4bcbSBarry Smith #define SNESLGMonitorCreate KSPLGMonitorCreate 54*eafb4bcbSBarry Smith #define SNESLGMonitorDestroy KSPLGMonitorDestroy 55*eafb4bcbSBarry Smith #define SNESLGMonitor ((int (*)(SNES,int,double,void*))KSPLGMonitor) 56*eafb4bcbSBarry Smith #endif 57*eafb4bcbSBarry Smith 58ce3d82beSBarry Smith #endif 59b1f5cb9dSBarry Smith 60