1724775ccSBarry Smith /* 2724775ccSBarry Smith Private context for a Newton line search method for solving 3724775ccSBarry Smith systems of nonlinear equations 4724775ccSBarry Smith */ 5724775ccSBarry Smith 6724775ccSBarry Smith #ifndef __SNES_LS_H 7724775ccSBarry Smith #define __SNES_LS_H 8*c6db04a5SJed Brown #include <private/snesimpl.h> 9724775ccSBarry Smith 10724775ccSBarry Smith typedef struct { 11ace3abfcSBarry Smith PetscErrorCode (*LineSearch)(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal*,PetscReal*,PetscBool *); 12724775ccSBarry Smith void *lsP; /* user-defined line-search context (optional) */ 13724775ccSBarry Smith /* --------------- Parameters used by line search method ----------------- */ 14724775ccSBarry Smith PetscReal alpha; /* used to determine sufficient reduction */ 15724775ccSBarry Smith PetscReal maxstep; /* maximum step size */ 16724775ccSBarry Smith PetscReal minlambda; /* determines smallest line search lambda used */ 17ace3abfcSBarry Smith PetscErrorCode (*precheckstep)(SNES,Vec,Vec,void*,PetscBool *); /* step-checking routine (optional) */ 18724775ccSBarry Smith void *precheck; /* user-defined step-checking context (optional) */ 19ace3abfcSBarry Smith PetscErrorCode (*postcheckstep)(SNES,Vec,Vec,Vec,void*,PetscBool *,PetscBool *); /* step-checking routine (optional) */ 20724775ccSBarry Smith void *postcheck; /* user-defined step-checking context (optional) */ 21724775ccSBarry Smith PetscViewerASCIIMonitor monitor; 22724775ccSBarry Smith } SNES_LS; 23724775ccSBarry Smith 24724775ccSBarry Smith #endif 25724775ccSBarry Smith 26