Actual source code: petsc-linesearchimpl.h

petsc-3.4.5 2014-06-29
  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: };

 22: struct _p_LineSearch {
 23:   PETSCHEADER(struct _LineSearchOps);

 25:   SNES                snes;     /* temporary -- so we can pull out the function evaluation */

 27:   void                *data;

 29:   PetscBool           setupcalled;

 31:   Vec                 vec_sol;
 32:   Vec                 vec_sol_new;
 33:   Vec                 vec_func;
 34:   Vec                 vec_func_new;
 35:   Vec                 vec_update;

 37:   PetscInt            nwork;
 38:   Vec                 *work;

 40:   PetscReal           lambda;

 42:   PetscBool           norms;
 43:   PetscReal           fnorm;
 44:   PetscReal           ynorm;
 45:   PetscReal           xnorm;
 46:   PetscBool           success;
 47:   PetscBool           keeplambda;

 49:   PetscReal           damping;
 50:   PetscReal           maxstep;
 51:   PetscReal           steptol;
 52:   PetscInt            max_its;
 53:   PetscReal           rtol;
 54:   PetscReal           atol;
 55:   PetscReal           ltol;
 56:   PetscInt            order;

 58:   PetscReal           precheck_picard_angle;

 60:   void *              precheckctx;
 61:   void *              postcheckctx;

 63:   PetscViewer         monitor;

 65: };

 67: #endif