1 2 /* 3 Context for a Newton trust region method for solving a system 4 of nonlinear equations 5 */ 6 7 #ifndef __SNES_TR_H 8 #define __SNES_TR_H 9 #include <petsc/private/snesimpl.h> 10 11 typedef struct { 12 /* ---- Parameters used by the trust region method ---- */ 13 PetscReal mu; /* used to compute trust region parameter */ 14 PetscReal eta; /* used to compute trust region parameter */ 15 PetscReal delta; /* trust region parameter */ 16 PetscReal delta0; /* used to initialize trust region parameter */ 17 PetscReal delta1; /* used to compute trust region parameter */ 18 PetscReal delta2; /* used to compute trust region parameter */ 19 PetscReal delta3; /* used to compute trust region parameter */ 20 PetscReal sigma; /* used to determine termination */ 21 PetscBool itflag; /* flag for convergence testing */ 22 PetscReal rnorm0, ttol; /* used for KSP convergence test */ 23 PetscErrorCode (*precheck)(SNES, Vec, Vec, PetscBool *, void *); 24 void *precheckctx; 25 PetscErrorCode (*postcheck)(SNES, Vec, Vec, Vec, PetscBool *, PetscBool *, void *); 26 void *postcheckctx; 27 } SNES_NEWTONTR; 28 29 #endif 30