1 /* $Id: snes.h,v 1.10 1995/05/02 21:45:47 curfman Exp bsmith $ */ 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 SNES_TEST } 17 SNESMethod; 18 19 typedef enum { SNES_T, SUMS_T } SNESTYPE; 20 21 extern int SNESCreate(MPI_Comm,SNES*); 22 extern int SNESSetMethod(SNES,SNESMethod); 23 extern int SNESSetMonitor(SNES, int (*)(SNES,int,double,void*),void *); 24 extern int SNESSetSolution(SNES,Vec,int (*)(SNES,Vec,void*),void *); 25 extern int SNESSetFunction(SNES, Vec, int (*)(SNES,Vec,Vec,void*),void *,int); 26 extern int SNESSetJacobian(SNES,Mat,Mat,int(*)(SNES,Vec,Mat*,Mat*,int*,void*),void *); 27 extern int SNESDestroy(SNES); 28 extern int SNESSetUp(SNES); 29 extern int SNESSolve(SNES,int*); 30 extern int SNESRegister(int, char*, int (*)(SNES)); 31 extern int SNESRegisterAll(); 32 extern int SNESGetSLES(SNES,SLES*); 33 extern int SNESNoLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 34 extern int SNESCubicLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 35 extern int SNESQuadraticLineSearch(SNES,Vec,Vec,Vec,Vec,Vec,double,double*,double*); 36 37 extern int SNESGetSolution(SNES,Vec*); 38 extern int SNESGetFunction(SNES,Vec*); 39 40 extern int SNESPrintHelp(SNES); 41 extern int SNESSetFromOptions(SNES); 42 extern int SNESGetMethodName(SNESMethod,char **); 43 extern int SNESDefaultMonitor(SNES,int,double,void *); 44 extern int SNESDefaultConverged(SNES,double,double,double,void*); 45 46 extern int SNESSetSolutionTolerance(SNES,double); 47 extern int SNESSetAbsoluteTolerance(SNES,double); 48 extern int SNESSetRelativeTolerance(SNES,double); 49 extern int SNESSetTruncationTolerance(SNES,double); 50 extern int SNESSetMaxIterations(SNES,int); 51 extern int SNESSetMaxResidualEvaluations(SNES,int); 52 53 #if defined(__DRAW_PACKAGE) 54 #define SNESLGMonitorCreate KSPLGMonitorCreate 55 #define SNESLGMonitorDestroy KSPLGMonitorDestroy 56 #define SNESLGMonitor ((int (*)(SNES,int,double,void*))KSPLGMonitor) 57 #endif 58 59 #endif 60 61