Actual source code: trimpl.h
1: /*
2: Context for a Newton trust region method for solving a system
3: of nonlinear equations
4: */
6: #ifndef __SNES_TR_H
8: #include <petsc/private/snesimpl.h>
10: typedef struct {
11: PetscReal delta; /* trust region parameter */
12: PetscReal delta0; /* initial radius for trust region */
13: PetscReal deltaM; /* maximum radius for trust region */
14: PetscReal kmdc; /* sufficient decrease parameter */
16: /*
17: Given rho = (fk - fkp1) / (m(0) - m(pk))
19: The radius is modified as:
20: rho < eta2 -> delta *= t1
21: rho > eta3 -> delta *= t2
22: delta = min(delta,deltaM)
24: The step is accepted if rho > eta1
25: */
26: PetscReal eta1;
27: PetscReal eta2;
28: PetscReal eta3;
29: PetscReal t1;
30: PetscReal t2;
32: SNESNewtonTRFallbackType fallback; /* enum to distinguish fallback in case Newton step is outside of the trust region */
34: PetscErrorCode (*precheck)(SNES, Vec, Vec, PetscBool *, void *);
35: void *precheckctx;
36: PetscErrorCode (*postcheck)(SNES, Vec, Vec, Vec, PetscBool *, PetscBool *, void *);
37: void *postcheckctx;
38: } SNES_NEWTONTR;
40: #endif