xref: /petsc/src/snes/impls/ls/lsimpl.h (revision 5d4cbb4e3d04d144604f832291a7ad3563495787)
1 /*
2    Private context for a Newton line search method for solving
3    systems of nonlinear equations
4  */
5 
6 #ifndef __SNES_LS_H
7 #define __SNES_LS_H
8 #include <private/snesimpl.h>
9 
10 typedef struct {
11   PetscErrorCode           (*LineSearch)(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal*,PetscReal*,PetscBool *);
12   void                     *lsP;                              /* user-defined line-search context (optional) */
13   /* --------------- Parameters used by line search method ----------------- */
14   PetscReal                alpha;		                                                   /* used to determine sufficient reduction */
15   PetscReal                maxstep;                                                          /* maximum step size */
16   PetscReal                minlambda;                                                        /* determines smallest line search lambda used */
17   PetscErrorCode           (*precheckstep)(SNES,Vec,Vec,void*,PetscBool *);                  /* step-checking routine (optional) */
18   void                     *precheck;                                                        /* user-defined step-checking context (optional) */
19   PetscErrorCode           (*postcheckstep)(SNES,Vec,Vec,Vec,void*,PetscBool *,PetscBool *); /* step-checking routine (optional) */
20   void                     *postcheck;                                                       /* user-defined step-checking context (optional) */
21   PetscViewer              monitor;
22 } SNES_LS;
23 
24 #endif
25 
26