Actual source code: petsc-linesearchimpl.h
petsc-3.5.3 2015-01-31
1: #ifndef __LINESEARCHIMPL_H
4: #include <petscsnes.h>
5: #include <petsc-private/petscimpl.h>
7: typedef struct _LineSearchOps *LineSearchOps;
9: struct _LineSearchOps {
10: PetscErrorCode (*view)(SNESLineSearch, PetscViewer);
11: SNESLineSearchApplyFunc apply;
12: PetscErrorCode (*precheck)(SNESLineSearch,Vec,Vec,PetscBool*,void*);
13: SNESLineSearchVIProjectFunc viproject;
14: SNESLineSearchVINormFunc vinorm;
15: PetscErrorCode (*postcheck)(SNESLineSearch,Vec,Vec,Vec,PetscBool *,PetscBool *,void*);
16: PetscErrorCode (*setfromoptions)(SNESLineSearch);
17: PetscErrorCode (*reset)(SNESLineSearch);
18: PetscErrorCode (*destroy)(SNESLineSearch);
19: PetscErrorCode (*setup)(SNESLineSearch);
20: PetscErrorCode (*snesfunc)(SNES,Vec,Vec);
21: };
23: struct _p_LineSearch {
24: PETSCHEADER(struct _LineSearchOps);
26: SNES snes;
28: void *data;
30: PetscBool setupcalled;
32: Vec vec_sol;
33: Vec vec_sol_new;
34: Vec vec_func;
35: Vec vec_func_new;
36: Vec vec_update;
38: PetscInt nwork;
39: Vec *work;
41: PetscReal lambda;
43: PetscBool norms;
44: PetscReal fnorm;
45: PetscReal ynorm;
46: PetscReal xnorm;
47: PetscBool success;
48: PetscBool keeplambda;
50: PetscReal damping;
51: PetscReal maxstep;
52: PetscReal steptol;
53: PetscInt max_its;
54: PetscReal rtol;
55: PetscReal atol;
56: PetscReal ltol;
57: PetscInt order;
59: PetscReal precheck_picard_angle;
61: void * precheckctx;
62: void * postcheckctx;
64: PetscViewer monitor;
66: };
68: #endif