xref: /petsc/src/snes/impls/ntrdc/ntrdcimpl.h (revision 41ba4c6c04ec6b90096e1e0d2d3de306864f2fe5)
1*41ba4c6cSHeeho Park 
2*41ba4c6cSHeeho Park /*
3*41ba4c6cSHeeho Park    Context for a Newton trust region method for solving a system
4*41ba4c6cSHeeho Park    of nonlinear equations
5*41ba4c6cSHeeho Park  */
6*41ba4c6cSHeeho Park 
7*41ba4c6cSHeeho Park #if !defined(__SNES_TR_H)
8*41ba4c6cSHeeho Park #define __SNES_TR_H
9*41ba4c6cSHeeho Park #include <petsc/private/snesimpl.h>
10*41ba4c6cSHeeho Park 
11*41ba4c6cSHeeho Park typedef struct {
12*41ba4c6cSHeeho Park   /* ---- Parameters used by the trust region method  ---- */
13*41ba4c6cSHeeho Park   PetscReal      mu;             /* used to compute trust region parameter */
14*41ba4c6cSHeeho Park   PetscReal      eta;            /* used to compute trust region parameter */
15*41ba4c6cSHeeho Park   PetscReal      delta;          /* trust region parameter */
16*41ba4c6cSHeeho Park   PetscReal      delta0;         /* used to initialize trust region parameter */
17*41ba4c6cSHeeho Park   PetscReal      delta1;         /* used to compute trust region parameter */
18*41ba4c6cSHeeho Park   PetscReal      delta2;         /* used to compute trust region parameter */
19*41ba4c6cSHeeho Park   PetscReal      delta3;         /* used to compute trust region parameter */
20*41ba4c6cSHeeho Park 
21*41ba4c6cSHeeho Park   PetscReal      eta1;           /* Heeho's new TR-dogleg */
22*41ba4c6cSHeeho Park   PetscReal      eta2;           /* Heeho's new TR-dogleg */
23*41ba4c6cSHeeho Park   PetscReal      eta3;           /* Heeho's new TR-dogleg */
24*41ba4c6cSHeeho Park   PetscReal      t1;             /* Heeho's new TR-dogleg */
25*41ba4c6cSHeeho Park   PetscReal      t2;             /* Heeho's new TR-dogleg */
26*41ba4c6cSHeeho Park   PetscReal      deltaM;         /* Heeho's new TR-dogleg */
27*41ba4c6cSHeeho Park   /* currently using fixed array for the block size because of memory leak */
28*41ba4c6cSHeeho Park   /* PetscReal      *inorms;         Heeho's new TR-dogleg, stores largest inf norm */
29*41ba4c6cSHeeho Park   /* PetscInt       bs;              Heeho's new TR-dogleg, solution vector block size */
30*41ba4c6cSHeeho Park 
31*41ba4c6cSHeeho Park   PetscReal      sigma;          /* used to detemine termination */
32*41ba4c6cSHeeho Park   PetscBool      itflag;         /* flag for convergence testing */
33*41ba4c6cSHeeho Park   PetscBool      use_cauchy;     /* flag to use/not use Cauchy step and direction (S&D) */
34*41ba4c6cSHeeho Park   PetscBool      auto_scale_multiphase; /* flag to use/not use autoscaling for Cauchy S&D for multiphase*/
35*41ba4c6cSHeeho Park   PetscReal      auto_scale_max; /* max cap value for auto-scaling muste be > 1 */
36*41ba4c6cSHeeho Park   PetscBool      rho_satisfied;  /* flag for whether inner iteration satisfied rho */
37*41ba4c6cSHeeho Park   PetscReal      rnorm0,ttol;    /* used for KSP convergence test */
38*41ba4c6cSHeeho Park   PetscErrorCode (*precheck)(SNES,Vec,Vec,PetscBool*,void*);
39*41ba4c6cSHeeho Park   void           *precheckctx;
40*41ba4c6cSHeeho Park   PetscErrorCode (*postcheck)(SNES,Vec,Vec,Vec,PetscBool*,PetscBool*,void*);
41*41ba4c6cSHeeho Park   void           *postcheckctx;
42*41ba4c6cSHeeho Park } SNES_NEWTONTRDC;
43*41ba4c6cSHeeho Park 
44*41ba4c6cSHeeho Park #endif
45