Date: 2022-03-31T04:49:00+00:00

Actual source code: almm.h

      1: #if !defined(TAOALMM_H)
      2: #define TAOALMM_H
      3: #include <petsc/private/taoimpl.h>

      5: typedef struct {
      6:   Tao            subsolver, parent;                     /* subsolver for aug-lag subproblem */
      7:   PetscErrorCode (*sub_obj)(Tao);                       /* subsolver objective function */
      8:   TaoALMMType    type;                                  /* subsolver objective type */

     10:   IS             *Pis, *Yis;                            /* index sets to separate primal and dual vector spaces */
     11:   VecScatter     *Pscatter, *Yscatter;                  /* scatter objects to write into combined vector spaces */

     13:   Mat            Ae, Ai;                                /* aliased constraint Jacobians (do not destroy!) */
     14:   Vec            Px, LgradX, Ce, Ci, G;                 /* aliased vectors (do not destroy!) */
     15:   Vec            Ps, LgradS, Yi, Ye;                    /* sub-vectors for primal variables */
     16:   Vec            *Parr, P, PL, PU, *Yarr, Y, C;         /* arrays and vectors for combined vector spaces */
     17:   Vec            Xwork, Cework, Ciwork, Cizero;         /* work vectors */

     19:   PetscReal      Lval, fval, gnorm, cnorm, cenorm, cinorm, cnorm_old;   /* scalar variables */
     20:   PetscReal      mu0, mu, mu_fac, mu_pow_good, mu_pow_bad;              /* penalty parameters */
     21:   PetscReal      ytol0, ytol, gtol0, gtol;                              /* convergence parameters */
     22:   PetscReal      mu_max, ye_min, yi_min, ye_max, yi_max;                /* parameter safeguards */

     24:   PetscBool      info;
     25: } TAO_ALMM;

     27: PETSC_INTERN PetscErrorCode TaoALMMGetType_Private(Tao,TaoALMMType*);
     28: PETSC_INTERN PetscErrorCode TaoALMMSetType_Private(Tao,TaoALMMType);
     29: PETSC_INTERN PetscErrorCode TaoALMMGetSubsolver_Private(Tao,Tao*);
     30: PETSC_INTERN PetscErrorCode TaoALMMSetSubsolver_Private(Tao,Tao);
     31: PETSC_INTERN PetscErrorCode TaoALMMGetMultipliers_Private(Tao,Vec*);
     32: PETSC_INTERN PetscErrorCode TaoALMMSetMultipliers_Private(Tao,Vec);
     33: PETSC_INTERN PetscErrorCode TaoALMMGetPrimalIS_Private(Tao,IS*,IS*);
     34: PETSC_INTERN PetscErrorCode TaoALMMGetDualIS_Private(Tao,IS*,IS*);
     35: PETSC_INTERN PetscErrorCode TaoALMMSubsolverObjective_Private(Tao,Vec,PetscReal*,void*);
     36: PETSC_INTERN PetscErrorCode TaoALMMSubsolverObjectiveAndGradient_Private(Tao,Vec,PetscReal*,Vec,void*);

     38: #endif