1 /* $Id: snes.h,v 1.1 1995/03/20 00:12:47 bsmith Exp bsmith $ */ 2 3 #if !defined(__SNES_PACKAGE) 4 #define __SNES_PACKAGE 5 6 typedef enum { NLE_NLS1, 7 NLE_NTR1, 8 NLE_NTR2_DOG, 9 NLE_NTR2_LIN, 10 NLE_NBASIC, 11 NLM_NLS1, 12 NLM_NTR1 } 13 NLMETHOD; 14 15 typedef enum { NLINITIAL_GUESS, 16 NLRESIDUAL, 17 NLFUNCTION, 18 NLGRADIENT, 19 NLMATRIX, 20 NLCORE, 21 NLSTEP_SETUP, 22 NLSTEP_COMPUTE, 23 NLSTEP_DESTROY, 24 NLTOTAL } 25 NLPHASE; 26 27 typedef enum { NLE, NLM } NLTYPE; 28 29 extern void NLSetResidual ANSI_ARGS((NLCtx*, void *)); 30 extern void NLSetResidualRoutine ANSI_ARGS((NLCtx*, 31 void (*)(NLCtx*, void*, void*), int )); 32 extern void NLSetMaxResidualEvaluations ANSI_ARGS((NLCtx*, int )); 33 extern void *NLGetResidual ANSI_ARGS((NLCtx *)); 34 extern void NLiResid ANSI_ARGS((NLCtx*, void *, void *)); 35 36 extern void NLENewtonStatisticsMonitor ANSI_ARGS((NLCtx*, void*, void*, 37 double *)); 38 extern void NLENewtonDefaultMonitor ANSI_ARGS((NLCtx*, void*, void*, 39 double *)); 40 extern int NLENewtonDefaultConverged ANSI_ARGS((NLCtx*, double*, double*, 41 double *)); 42 extern char *NLENewtonDefaultConvergedType ANSI_ARGS((NLCtx *)); 43 44 extern int SNESGetSLES(SNES,SLES*); 45 46 extern void NLSlesSetDampingFlag ANSI_ARGS((NLCtx*, int)); 47 extern void NLSlesSetSaveSolverCtx ANSI_ARGS((NLCtx *)); 48 49 /* ---- Routines to extract information from the NLSles context ---- */ 50 extern int NLSlesGetDampingFlag ANSI_ARGS((NLCtx *)); 51 extern int NLSlesSaveSolverCtx ANSI_ARGS((NLCtx *)); 52 53 /* --- Miscellaneous routines --- */ 54 extern void NLSlesSetUp ANSI_ARGS((NLCtx*, void *)); 55 extern void NLSlesSetGeneralStep ANSI_ARGS((NLCtx*, 56 void (*)(NLCtx *, void *) )); 57 extern void NLSlesSetRoutines ANSI_ARGS((NLCtx*, 58 void (*)(NLCtx *, void *) )); 59 extern void NLSlesApplyForwardSolve ANSI_ARGS((NLCtx*, void*, void *)); 60 extern void NLSlesApplyBackwardSolve ANSI_ARGS((NLCtx*, void*, void *)); 61 void NLSlesCheck ANSI_ARGS((NLCtx*, char*)); 62 extern int NLSlesSolveScale ANSI_ARGS((NLCtx*, void*, void*, 63 void*, double*, double*, double*, 64 double*, double*, void *)); 65 66