1661095bbSAlp Dener #if !defined(TAOALMM_H) 2661095bbSAlp Dener #define TAOALMM_H 3661095bbSAlp Dener #include <petsc/private/taoimpl.h> 4661095bbSAlp Dener 5661095bbSAlp Dener typedef struct { 6661095bbSAlp Dener Tao subsolver, parent; /* subsolver for aug-lag subproblem */ 7661095bbSAlp Dener PetscErrorCode (*sub_obj)(Tao); /* subsolver objective function */ 8661095bbSAlp Dener TaoALMMType type; /* subsolver objective type */ 9661095bbSAlp Dener 10661095bbSAlp Dener IS *Pis, *Yis; /* index sets to separate primal and dual vector spaces */ 11661095bbSAlp Dener VecScatter *Pscatter, *Yscatter; /* scatter objects to write into combined vector spaces */ 12661095bbSAlp Dener 13661095bbSAlp Dener Mat Ae, Ai; /* aliased constraint Jacobians (do not destroy!) */ 14661095bbSAlp Dener Vec Px, LgradX, Ce, Ci, G; /* aliased vectors (do not destroy!) */ 15661095bbSAlp Dener Vec Ps, LgradS, Yi, Ye; /* sub-vectors for primal variables */ 16661095bbSAlp Dener Vec *Parr, P, PL, PU, *Yarr, Y, C; /* arrays and vectors for combined vector spaces */ 17661095bbSAlp Dener Vec Xwork, Cework, Ciwork, Cizero; /* work vectors */ 18661095bbSAlp Dener 19661095bbSAlp Dener PetscReal Lval, fval, gnorm, cnorm, cenorm, cinorm, cnorm_old; /* scalar variables */ 20661095bbSAlp Dener PetscReal mu0, mu, mu_fac, mu_pow_good, mu_pow_bad; /* penalty parameters */ 21661095bbSAlp Dener PetscReal ytol0, ytol, gtol0, gtol; /* convergence parameters */ 22661095bbSAlp Dener PetscReal mu_max, ye_min, yi_min, ye_max, yi_max; /* parameter safeguards */ 23661095bbSAlp Dener 24661095bbSAlp Dener PetscBool info; 25661095bbSAlp Dener } TAO_ALMM; 26661095bbSAlp Dener 27661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetType_Private(Tao,TaoALMMType*); 28661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSetType_Private(Tao,TaoALMMType); 29661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetSubsolver_Private(Tao,Tao*); 30661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSetSubsolver_Private(Tao,Tao); 31661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetMultipliers_Private(Tao,Vec*); 32661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSetMultipliers_Private(Tao,Vec); 33661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetPrimalIS_Private(Tao,IS*,IS*); 34661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMGetDualIS_Private(Tao,IS*,IS*); 35*7721a36fSStefano Zampini PETSC_INTERN PetscErrorCode TaoALMMSubsolverObjective_Private(Tao,Vec,PetscReal*,void*); 36661095bbSAlp Dener PETSC_INTERN PetscErrorCode TaoALMMSubsolverObjectiveAndGradient_Private(Tao,Vec,PetscReal*,Vec,void*); 37661095bbSAlp Dener 38661095bbSAlp Dener #endif 39