xref: /petsc/src/tao/constrained/impls/almm/almm.h (revision 661095bbfddda9a1493a32ea0d2305a96eb189ff)
1*661095bbSAlp Dener #if !defined(TAOALMM_H)
2*661095bbSAlp Dener #define TAOALMM_H
3*661095bbSAlp Dener #include <petsc/private/taoimpl.h>
4*661095bbSAlp Dener 
5*661095bbSAlp Dener typedef struct {
6*661095bbSAlp Dener   Tao              subsolver, parent;                     /* subsolver for aug-lag subproblem */
7*661095bbSAlp Dener   PetscErrorCode   (*sub_obj)(Tao);                       /* subsolver objective function */
8*661095bbSAlp Dener   TaoALMMType      type;                                  /* subsolver objective type */
9*661095bbSAlp Dener 
10*661095bbSAlp Dener   IS               *Pis, *Yis;                            /* index sets to separate primal and dual vector spaces */
11*661095bbSAlp Dener   VecScatter       *Pscatter, *Yscatter;                  /* scatter objects to write into combined vector spaces */
12*661095bbSAlp Dener 
13*661095bbSAlp Dener   Mat              Ae, Ai;                                /* aliased constraint Jacobians (do not destroy!) */
14*661095bbSAlp Dener   Vec              Px, LgradX, Ce, Ci, G;                 /* aliased vectors (do not destroy!) */
15*661095bbSAlp Dener   Vec              Ps, LgradS, Yi, Ye;                    /* sub-vectors for primal variables */
16*661095bbSAlp Dener   Vec              *Parr, P, PL, PU, *Yarr, Y, C;         /* arrays and vectors for combined vector spaces */
17*661095bbSAlp Dener   Vec              Xwork, Cework, Ciwork, Cizero;         /* work vectors */
18*661095bbSAlp Dener 
19*661095bbSAlp Dener   PetscReal        Lval, fval, gnorm, cnorm, cenorm, cinorm, cnorm_old;   /* scalar variables */
20*661095bbSAlp Dener   PetscReal        mu0, mu, mu_fac, mu_pow_good, mu_pow_bad;              /* penalty parameters */
21*661095bbSAlp Dener   PetscReal        ytol0, ytol, gtol0, gtol;                              /* convergence parameters */
22*661095bbSAlp Dener   PetscReal        mu_max, ye_min, yi_min, ye_max, yi_max;                /* parameter safeguards */
23*661095bbSAlp Dener 
24*661095bbSAlp Dener   PetscBool        info;
25*661095bbSAlp Dener } TAO_ALMM;
26*661095bbSAlp Dener 
27*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetType_Private(Tao, TaoALMMType*);
28*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSetType_Private(Tao, TaoALMMType);
29*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetSubsolver_Private(Tao, Tao*);
30*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSetSubsolver_Private(Tao, Tao);
31*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetMultipliers_Private(Tao, Vec*);
32*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSetMultipliers_Private(Tao, Vec);
33*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetPrimalIS_Private(Tao, IS*, IS*);
34*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetDualIS_Private(Tao, IS*, IS*);
35*661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSubsolverObjectiveAndGradient_Private(Tao, Vec, PetscReal*, Vec, void*);
36*661095bbSAlp Dener 
37*661095bbSAlp Dener #endif
38