Actual source code: petscsnes.h

      1: /*
      2:     User interface for the nonlinear solvers package.
      3: */
     6:  #include petscksp.h

      9: /*S
     10:      SNES - Abstract PETSc object that manages all nonlinear solves

     12:    Level: beginner

     14:   Concepts: nonlinear solvers

     16: .seealso:  SNESCreate(), SNESSetType(), SNESType, TS, KSP, KSP, PC
     17: S*/
     18: typedef struct _p_SNES* SNES;

     20: /*E
     21:     SNESType - String with the name of a PETSc SNES method or the creation function
     22:        with an optional dynamic library name, for example
     23:        http://www.mcs.anl.gov/petsc/lib.a:mysnescreate()

     25:    Level: beginner

     27: .seealso: SNESSetType(), SNES
     28: E*/
     29: #define SNESLS          "ls"
     30: #define SNESTR          "tr"
     31: #define SNESTEST        "test"
     32: #define SNESType const char*

     34: /* Logging support */

     40: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESInitializePackage(const char[]);

     42: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESCreate(MPI_Comm,SNES*);
     43: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDestroy(SNES);
     44: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetType(SNES,SNESType);
     45: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetMonitor(SNES,PetscErrorCode(*)(SNES,PetscInt,PetscReal,void*),void *,PetscErrorCode (*)(void*));
     46: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESClearMonitor(SNES);
     47: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetConvergenceHistory(SNES,PetscReal[],PetscInt[],PetscInt,PetscTruth);
     48: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetConvergenceHistory(SNES,PetscReal*[],PetscInt *[],PetscInt *);
     49: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetUp(SNES);
     50: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSolve(SNES,Vec,Vec);

     52: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESAddOptionsChecker(PetscErrorCode (*)(SNES));

     54: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetUpdate(SNES, PetscErrorCode (*)(SNES, PetscInt));
     55: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDefaultUpdate(SNES, PetscInt);

     58: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterDestroy(void);
     59: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESRegisterAll(const char[]);

     61: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESRegister(const char[],const char[],const char[],PetscErrorCode (*)(SNES));

     63: /*MC
     64:    SNESRegisterDynamic - Adds a method to the nonlinear solver package.

     66:    Synopsis:
     67:    PetscErrorCode SNESRegisterDynamic(char *name_solver,char *path,char *name_create,PetscErrorCode (*routine_create)(SNES))

     69:    Not collective

     71:    Input Parameters:
     72: +  name_solver - name of a new user-defined solver
     73: .  path - path (either absolute or relative) the library containing this solver
     74: .  name_create - name of routine to create method context
     75: -  routine_create - routine to create method context

     77:    Notes:
     78:    SNESRegisterDynamic() may be called multiple times to add several user-defined solvers.

     80:    If dynamic libraries are used, then the fourth input argument (routine_create)
     81:    is ignored.

     83:    Environmental variables such as ${PETSC_ARCH}, ${PETSC_DIR}, ${PETSC_LIB_DIR},
     84:    and others of the form ${any_environmental_variable} occuring in pathname will be
     85:    replaced with appropriate values.

     87:    Sample usage:
     88: .vb
     89:    SNESRegisterDynamic("my_solver",/home/username/my_lib/lib/libg/solaris/mylib.a,
     90:                 "MySolverCreate",MySolverCreate);
     91: .ve

     93:    Then, your solver can be chosen with the procedural interface via
     94: $     SNESSetType(snes,"my_solver")
     95:    or at runtime via the option
     96: $     -snes_type my_solver

     98:    Level: advanced

    100:     Note: If your function is not being put into a shared library then use SNESRegister() instead

    102: .keywords: SNES, nonlinear, register

    104: .seealso: SNESRegisterAll(), SNESRegisterDestroy()
    105: M*/
    106: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
    107: #define SNESRegisterDynamic(a,b,c,d) SNESRegister(a,b,c,0)
    108: #else
    109: #define SNESRegisterDynamic(a,b,c,d) SNESRegister(a,b,c,d)
    110: #endif

    112: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetKSP(SNES,KSP*);
    113: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetSolution(SNES,Vec*);
    114: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetSolutionUpdate(SNES,Vec*);
    115: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetFunction(SNES,Vec*,PetscErrorCode(**)(SNES,Vec,Vec,void*),void**);
    116: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESView(SNES,PetscViewer);

    118: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetOptionsPrefix(SNES,const char[]);
    119: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESAppendOptionsPrefix(SNES,const char[]);
    120: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetOptionsPrefix(SNES,const char*[]);
    121: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetFromOptions(SNES);

    123: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatCreateSNESMF(SNES,Vec,Mat*);
    124: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatCreateMF(Vec,Mat*);
    125: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetBase(Mat,Vec);
    126: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFComputeJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*);
    127: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetFunction(Mat,Vec,PetscErrorCode(*)(SNES,Vec,Vec,void*),void*);
    128: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetFunctioni(Mat,PetscErrorCode (*)(PetscInt,Vec,PetscScalar*,void*));
    129: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetFunctioniBase(Mat,PetscErrorCode (*)(Vec,void*));
    130: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFAddNullSpace(Mat,MatNullSpace);
    131: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetHHistory(Mat,PetscScalar[],PetscInt);
    132: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFResetHHistory(Mat);
    133: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetFunctionError(Mat,PetscReal);
    134: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetPeriod(Mat,PetscInt);
    135: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFGetH(Mat,PetscScalar *);
    136: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFKSPMonitor(KSP,PetscInt,PetscReal,void *);
    137: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetFromOptions(Mat);
    138: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFCheckPositivity(Vec,Vec,PetscScalar*,void*);
    139: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetCheckh(Mat,PetscErrorCode (*)(Vec,Vec,PetscScalar*,void*),void*);

    141: typedef struct _p_MatSNESMFCtx   *MatSNESMFCtx;

    143: #define MATSNESMF_DEFAULT "default"
    144: #define MATSNESMF_WP      "wp"
    145: #define MatSNESMFType char*
    146: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetType(Mat,const MatSNESMFType);
    147: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFRegister(const char[],const char[],const char[],PetscErrorCode (*)(MatSNESMFCtx));

    149: /*MC
    150:    MatSNESMFRegisterDynamic - Adds a method to the MatSNESMF registry.

    152:    Synopsis:
    153:    PetscErrorCode MatSNESMFRegisterDynamic(char *name_solver,char *path,char *name_create,PetscErrorCode (*routine_create)(MatSNESMF))

    155:    Not Collective

    157:    Input Parameters:
    158: +  name_solver - name of a new user-defined compute-h module
    159: .  path - path (either absolute or relative) the library containing this solver
    160: .  name_create - name of routine to create method context
    161: -  routine_create - routine to create method context

    163:    Level: developer

    165:    Notes:
    166:    MatSNESMFRegisterDynamic) may be called multiple times to add several user-defined solvers.

    168:    If dynamic libraries are used, then the fourth input argument (routine_create)
    169:    is ignored.

    171:    Sample usage:
    172: .vb
    173:    MatSNESMFRegisterDynamic"my_h",/home/username/my_lib/lib/libO/solaris/mylib.a,
    174:                "MyHCreate",MyHCreate);
    175: .ve

    177:    Then, your solver can be chosen with the procedural interface via
    178: $     MatSNESMFSetType(mfctx,"my_h")
    179:    or at runtime via the option
    180: $     -snes_mf_type my_h

    182: .keywords: MatSNESMF, register

    184: .seealso: MatSNESMFRegisterAll(), MatSNESMFRegisterDestroy()
    185: M*/
    186: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
    187: #define MatSNESMFRegisterDynamic(a,b,c,d) MatSNESMFRegister(a,b,c,0)
    188: #else
    189: #define MatSNESMFRegisterDynamic(a,b,c,d) MatSNESMFRegister(a,b,c,d)
    190: #endif

    192: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFRegisterAll(const char[]);
    193: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFRegisterDestroy(void);
    194: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFDefaultSetUmin(Mat,PetscReal);
    195: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFWPSetComputeNormA(Mat,PetscTruth);
    196: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFWPSetComputeNormU(Mat,PetscTruth);

    198: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT MatDAADSetSNES(Mat,SNES);

    200: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetType(SNES,SNESType*);
    201: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDefaultMonitor(SNES,PetscInt,PetscReal,void *);
    202: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESRatioMonitor(SNES,PetscInt,PetscReal,void *);
    203: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetRatioMonitor(SNES);
    204: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESVecViewMonitor(SNES,PetscInt,PetscReal,void *);
    205: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESVecViewResidualMonitor(SNES,PetscInt,PetscReal,void *);
    206: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESVecViewUpdateMonitor(SNES,PetscInt,PetscReal,void *);
    207: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDefaultSMonitor(SNES,PetscInt,PetscReal,void *);
    208: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetTolerances(SNES,PetscReal,PetscReal,PetscReal,PetscInt,PetscInt);
    209: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetTolerances(SNES,PetscReal*,PetscReal*,PetscReal*,PetscInt*,PetscInt*);
    210: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetTrustRegionTolerance(SNES,PetscReal);
    211: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetIterationNumber(SNES,PetscInt*);
    212: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetFunctionNorm(SNES,PetscScalar*);
    213: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetNumberUnsuccessfulSteps(SNES,PetscInt*);
    214: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetMaximumUnsuccessfulSteps(SNES,PetscInt);
    215: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetMaximumUnsuccessfulSteps(SNES,PetscInt*);
    216: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetNumberLinearIterations(SNES,PetscInt*);
    217: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNES_KSP_SetParametersEW(SNES,PetscInt,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal);
    218: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNES_KSP_SetConvergenceTestEW(SNES);

    220: /*
    221:      Reuse the default KSP monitor routines for SNES
    222: */
    223: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLGMonitorCreate(const char[],const char[],int,int,int,int,PetscDrawLG*);
    224: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLGMonitor(SNES,PetscInt,PetscReal,void*);
    225: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLGMonitorDestroy(PetscDrawLG);

    227: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetApplicationContext(SNES,void *);
    228: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetApplicationContext(SNES,void **);

    230: /*E
    231:     SNESConvergedReason - reason a SNES method was said to
    232:          have converged or diverged

    234:    Level: beginner

    236:    Notes: this must match finclude/petscsnes.h

    238:    Developer note: The string versions of these are in
    239:      src/snes/interface/snes.c called convergedreasons.
    240:      If these enums are changed you much change those.

    242: .seealso: SNESSolve(), SNESGetConvergedReason(), KSPConvergedReason, SNESSetConvergenceTest()
    243: E*/
    244: typedef enum {/* converged */
    245:               SNES_CONVERGED_FNORM_ABS         =  2, /* F < F_minabs */
    246:               SNES_CONVERGED_FNORM_RELATIVE    =  3, /* F < F_mintol*F_initial */
    247:               SNES_CONVERGED_PNORM_RELATIVE    =  4, /* step size small */
    248:               SNES_CONVERGED_TR_DELTA          =  7,
    249:               /* diverged */
    250:               SNES_DIVERGED_FUNCTION_DOMAIN    = -1,
    251:               SNES_DIVERGED_FUNCTION_COUNT     = -2,
    252:               SNES_DIVERGED_FNORM_NAN          = -4,
    253:               SNES_DIVERGED_MAX_IT             = -5,
    254:               SNES_DIVERGED_LS_FAILURE         = -6,
    255:               SNES_DIVERGED_LOCAL_MIN          = -8,  /* || J^T b || is small, implies converged to local minimum of F() */
    256:               SNES_CONVERGED_ITERATING         =  0} SNESConvergedReason;

    259: /*MC
    260:      SNES_CONVERGED_FNORM_ABS - 2-norm(F) <= abstol

    262:    Level: beginner

    264: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    266: M*/

    268: /*MC
    269:      SNES_CONVERGED_FNORM_RELATIVE - 2-norm(F) <= rtol*2-norm(F(x_0)) where x_0 is the initial guess

    271:    Level: beginner

    273: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    275: M*/

    277: /*MC
    278:      SNES_CONVERGED_PNORM_RELATIVE - The 2-norm of the last step <= xtol * 2-norm(x) where x is the current
    279:           solution and xtol is the 4th argument to SNESSetTolerances()

    281:    Level: beginner

    283: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    285: M*/

    287: /*MC
    288:      SNES_DIVERGED_FUNCTION_COUNT - The user provided function has been called more times then the final
    289:          argument to SNESSetTolerances()

    291:    Level: beginner

    293: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    295: M*/

    297: /*MC
    298:      SNES_DIVERGED_FNORM_NAN - the 2-norm of the current function evaluation is not-a-number (NaN), this
    299:       is usually caused by a division of 0 by 0.

    301:    Level: beginner

    303: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    305: M*/

    307: /*MC
    308:      SNES_DIVERGED_MAX_IT - SNESSolve() has reached the maximum number of iterations requested

    310:    Level: beginner

    312: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    314: M*/

    316: /*MC
    317:      SNES_DIVERGED_LS_FAILURE - The line search has failed. This only occurs for a SNESType of SNESLS

    319:    Level: beginner

    321: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    323: M*/

    325: /*MC
    326:      SNES_DIVERGED_LOCAL_MIN - the algorithm seems to have stagnated at a local minimum that is not zero

    328:    Level: beginner

    330: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    332: M*/

    334: /*MC
    335:      SNES_CONERGED_ITERATING - this only occurs if SNESGetConvergedReason() is called during the SNESSolve()

    337:    Level: beginner

    339: .seealso:  SNESSolve(), SNESGetConvergedReason(), SNESConvergedReason, SNESSetTolerances()

    341: M*/

    343: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetConvergenceTest(SNES,PetscErrorCode (*)(SNES,PetscReal,PetscReal,PetscReal,SNESConvergedReason*,void*),void*);
    344: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESConverged_LS(SNES,PetscReal,PetscReal,PetscReal,SNESConvergedReason*,void*);
    345: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESConverged_TR(SNES,PetscReal,PetscReal,PetscReal,SNESConvergedReason*,void*);
    346: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetConvergedReason(SNES,SNESConvergedReason*);

    348: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDAFormFunction(SNES,Vec,Vec,void*);
    349: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDAComputeJacobianWithAdic(SNES,Vec,Mat*,Mat*,MatStructure*,void*);
    350: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDAComputeJacobianWithAdifor(SNES,Vec,Mat*,Mat*,MatStructure*,void*);
    351: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDAComputeJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*);

    353: /* --------- Solving systems of nonlinear equations --------------- */
    354: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetFunction(SNES,Vec,PetscErrorCode(*)(SNES,Vec,Vec,void*),void *);
    355: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESComputeFunction(SNES,Vec,Vec);
    356: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetJacobian(SNES,Mat,Mat,PetscErrorCode(*)(SNES,Vec,Mat*,Mat*,MatStructure*,void*),void *);
    357: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetJacobian(SNES,Mat*,Mat*,PetscErrorCode(**)(SNES,Vec,Mat*,Mat*,MatStructure*,void*),void **);
    358: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDefaultComputeJacobian(SNES,Vec,Mat*,Mat*,MatStructure*,void*);
    359: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESDefaultComputeJacobianColor(SNES,Vec,Mat*,Mat*,MatStructure*,void*);
    360: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetRhs(SNES,Vec);
    361: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESGetRhs(SNES,Vec*);

    363: /* --------- Routines specifically for line search methods --------------- */
    364: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchSet(SNES,PetscErrorCode(*)(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal*,PetscReal*,PetscTruth*),void*);
    365: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchNo(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal*,PetscReal*,PetscTruth*);
    366: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchNoNorms(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal*,PetscReal*,PetscTruth*);
    367: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchCubic(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal*,PetscReal*,PetscTruth*);
    368: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchQuadratic(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal*,PetscReal*,PetscTruth*);

    370: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchSetPostCheck(SNES,PetscErrorCode(*)(SNES,Vec,Vec,Vec,void*,PetscTruth*,PetscTruth*),void*);
    371: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchSetPreCheck(SNES,PetscErrorCode(*)(SNES,Vec,Vec,void*,PetscTruth*),void*);
    372: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchSetParams(SNES,PetscReal,PetscReal,PetscReal);
    373: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchGetParams(SNES,PetscReal*,PetscReal*,PetscReal*);

    375: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESTestLocalMin(SNES snes);
    376: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESSetSolution(SNES,Vec);

    378: /* Should this routine be private? */
    379: EXTERN PetscErrorCode PETSCSNES_DLLEXPORT SNESComputeJacobian(SNES,Vec,Mat*,Mat*,MatStructure*);

    382: #endif