1 /* $Id: snes.h,v 1.2 1995/03/20 00:23:58 bsmith Exp bsmith $ */ 2 3 #if !defined(__SNES_PACKAGE) 4 #define __SNES_PACKAGE 5 6 typedef struct _SNES* SNES; 7 8 typedef enum { SNES_NLS1, 9 SNES_NTR1, 10 SNES_NTR2_DOG, 11 SNES_NTR2_LIN, 12 SNES_NBASIC, 13 SUMS_NLS1, 14 SUMS_NTR1 } 15 SNESMETHOD; 16 17 typedef enum { SNESINITIAL_GUESS, 18 SNESRESIDUAL, 19 SNESFUNCTION, 20 SNESGRADIENT, 21 SNESMATRIX, 22 SNESCORE, 23 SNESSTEP_SETUP, 24 SNESSTEP_COMPUTE, 25 SNESSTEP_DESTROY, 26 SNESTOTAL } 27 SNESPHASE; 28 29 typedef enum { SNES, SUMS } SNESTYPE; 30 31 extern int SNESSetResidual(SNES,Vec); 32 extern int SNESGetResidual(SNES,Vec*); 33 extern int SNESSetResidualRoutine(SNES,int (*)(void*,Vec,Vec),int,void*); 34 extern int SNESSetMaxResidualEvaluations(SNES,int); 35 36 extern int SNESDefaultMonitor ANSI_ARGS((NLCtx*, void*, void*, 37 double *)); 38 extern int SNESDefaultConverged ANSI_ARGS((NLCtx*, double*, double*, 39 double *)); 40 extern int SNESGetSLES(SNES,SLES*); 41 42 extern int SNESSetDampingFlag ANSI_ARGS((NLCtx*, int)); 43 extern int NLSlesGetDampingFlag ANSI_ARGS((NLCtx *)); 44 45 46 /* --- Miscellaneous routines --- */ 47 extern int SNESSetUp(SNES); 48 extern int NLSlesSetGeneralStep ANSI_ARGS((NLCtx*, 49 void (*)(NLCtx *, void *) )); 50 extern int NLSlesSetRoutines ANSI_ARGS((NLCtx*, 51 void (*)(NLCtx *, int *) )); 52 extern int NLSlesApplyForwardSolve ANSI_ARGS((NLCtx*, void*, void *)); 53 extern int NLSlesApplyBackwardSolve ANSI_ARGS((NLCtx*, void*, void *)); 54 int NLSlesCheck ANSI_ARGS((NLCtx*, char*)); 55 extern int NLSlesSolveScale ANSI_ARGS((NLCtx*, void*, void*, 56 void*, double*, double*, double*, 57 double*, double*, void *)); 58 59