44 #ifndef ROL_COMPOSITE_EQUALITY_CONSTRAINT_SIMOPT_H 45 #define ROL_COMPOSITE_EQUALITY_CONSTRAINT_SIMOPT_H 77 const Teuchos::RCP<EqualityConstraint_SimOpt<Real> >
conVal_;
78 const Teuchos::RCP<EqualityConstraint_SimOpt<Real> >
conRed_;
80 Teuchos::RCP<Vector<Real> >
Sz_;
91 conRed_->solve(*primRed_, *Sz_, z, tol);
98 conRed_->applyJacobian_2(*primRed_, v, *Sz_, z, tol);
99 conRed_->applyInverseJacobian_1(jv, *primRed_, *Sz_, z, tol);
100 jv.
scale(static_cast<Real>(-1));
105 conRed_->applyInverseAdjointJacobian_1(*dualRed_, v, *Sz_, z, tol);
106 conRed_->applyAdjointJacobian_2(ajv, *dualRed_, *Sz_, z, tol);
107 ajv.
scale(static_cast<Real>(-1));
117 primRed_ = cRed.
clone();
118 dualRed_ = cRed.
dual().clone();
120 dualZ_ = z.
dual().clone();
121 dualZ1_ = z.
dual().clone();
125 Real ctol = std::sqrt(ROL_EPSILON<Real>());
130 conRed_->update(*Sz_, z, flag, iter);
131 conVal_->update(u, *Sz_, flag, iter);
135 conVal_->update_1(u, flag, iter);
139 conRed_->update_2(z, flag, iter);
144 conVal_->value(c, u, *Sz_, tol);
150 conVal_->applyJacobian_1(jv, v, u, *Sz_, tol);
156 conVal_->applyJacobian_2(jv, *primZ_, u, *Sz_, tol);
162 conVal_->applyInverseJacobian_1(ijv, v, u, *Sz_, tol);
168 conVal_->applyAdjointJacobian_1(ajv, v, u, *Sz_, tol);
174 conVal_->applyAdjointJacobian_2(*dualZ_, v, u, *Sz_, tol);
181 conVal_->applyInverseAdjointJacobian_1(ijv, v, u, *Sz_, tol);
187 conVal_->applyAdjointHessian_11(ahwv, w, v, u, z, tol);
193 conVal_->applyAdjointHessian_12(*dualZ_, w, v, u, *Sz_, tol);
200 conVal_->applyAdjointHessian_21(ahwv, w, *primZ_, u, *Sz_, tol);
208 conVal_->applyAdjointJacobian_2(*dualZ_, w, u, *Sz_, tol);
209 conRed_->applyInverseAdjointJacobian_1(*dualRed_, *dualZ_, *Sz_, z, tol);
210 conRed_->applyAdjointHessian_22(*dualZ_, *dualRed_, v, *Sz_, z, tol);
211 ahwv.
axpy(static_cast<Real>(-1), *dualZ_);
212 conRed_->applyAdjointHessian_12(*dualZ_, *dualRed_, *primZ_, *Sz_, z, tol);
213 ahwv.
axpy(static_cast<Real>(-1), *dualZ_);
215 conRed_->applyAdjointHessian_11(*dualZ1_, *dualRed_, *primZ_, *Sz_, z, tol);
216 conRed_->applyAdjointHessian_21(*dualZ_, *dualRed_, v, *Sz_, z, tol);
217 dualZ1_->plus(*dualZ_);
218 dualZ1_->scale(static_cast<Real>(-1));
220 conVal_->applyAdjointHessian_22(*dualZ_, w, *primZ_, u, *Sz_, tol);
221 dualZ1_->plus(*dualZ_);
231 conVal_->setParameter(param);
232 conRed_->setParameter(param);
void update_2(const Vector< Real > &z, bool flag=true, int iter=-1)
Update constraint functions with respect to Opt variable. x is the optimization variable, flag = true if optimization variable is changed, iter is the outer algorithm iterations count.
virtual void scale(const Real alpha)=0
Compute where .
void applyInverseAdjointJacobian_1(Vector< Real > &ijv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the inverse of the adjoint of the partial constraint Jacobian at , , to the vector ...
void solveConRed(const Vector< Real > &z, Real &tol)
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
void applyAdjointHessian_21(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the simulation-space derivative of the adjoint of the constraint optimization-space Jacobian at...
virtual void setParameter(const std::vector< Real > ¶m)
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
const Teuchos::RCP< EqualityConstraint_SimOpt< Real > > conRed_
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Defines the equality constraint operator interface for simulation-based optimization.
void update_1(const Vector< Real > &u, bool flag=true, int iter=-1)
Update constraint functions with respect to Sim variable. x is the optimization variable, flag = true if optimization variable is changed, iter is the outer algorithm iterations count.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Teuchos::RCP< Vector< Real > > primZ_
void applySens(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &z, Real &tol)
void applyAdjointHessian_12(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the optimization-space derivative of the adjoint of the constraint simulation-space Jacobian at...
void update(const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1)
Update constraint functions. x is the optimization variable, flag = true if optimization variable is ...
void applyAdjointHessian_11(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the simulation-space derivative of the adjoint of the constraint simulation-space Jacobian at ...
CompositeEqualityConstraint_SimOpt(const Teuchos::RCP< EqualityConstraint_SimOpt< Real > > &conVal, const Teuchos::RCP< EqualityConstraint_SimOpt< Real > > &conRed, const Vector< Real > &cVal, const Vector< Real > &cRed, const Vector< Real > &u, const Vector< Real > &Sz, const Vector< Real > &z)
Teuchos::RCP< Vector< Real > > primRed_
void applyAdjointSens(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Teuchos::RCP< Vector< Real > > dualZ_
void applyAdjointJacobian_2(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Jacobian at , , to vector . This is the primary interface...
void applyAdjointHessian_22(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the optimization-space derivative of the adjoint of the constraint optimization-space Jacobian ...
void setParameter(const std::vector< Real > ¶m)
Teuchos::RCP< Vector< Real > > dualZ1_
const Teuchos::RCP< EqualityConstraint_SimOpt< Real > > conVal_
Teuchos::RCP< Vector< Real > > dualRed_
void applyJacobian_1(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the partial constraint Jacobian at , , to the vector .
void applyAdjointJacobian_1(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Jacobian at , , to the vector . This is the primary inter...
void applyInverseJacobian_1(Vector< Real > &ijv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the inverse partial constraint Jacobian at , , to the vector .
void applyJacobian_2(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply the partial constraint Jacobian at , , to the vector .
Teuchos::RCP< Vector< Real > > Sz_
void value(Vector< Real > &c, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Evaluate the constraint operator at .
Defines a composite equality constraint operator interface for simulation-based optimization.