ROL
ROL_CompositeConstraint_SimOpt.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_COMPOSITECONSTRAINT_SIMOPT_H
11 #define ROL_COMPOSITECONSTRAINT_SIMOPT_H
12 
14 #include "ROL_VectorController.hpp"
15 
37 namespace ROL {
38 
39 template<typename Real>
41 private:
42  // Constraints
43  const ROL::Ptr<Constraint_SimOpt<Real>> conVal_, conRed_;
44  // Additional vector storage for solve
45  ROL::Ptr<Vector<Real>> Sz_, primRed_, dualRed_, primZ_, dualZ_, dualZ1_, primU_;
46  // State storage through VectorController interface
47  ROL::Ptr<VectorController<Real>> stateStore_;
48  // Update information
52  // Boolean variables
54 
55 public:
57  const ROL::Ptr<Constraint_SimOpt<Real>> &conRed,
58  const Vector<Real> &cVal,
59  const Vector<Real> &cRed,
60  const Vector<Real> &u,
61  const Vector<Real> &Sz,
62  const Vector<Real> &z,
63  bool storage = true,
64  bool isConRedParametrized = false);
65 
66  void update(const Vector<Real> &u, const Vector<Real> &z, bool flag = true, int iter = -1) override;
67  void update_1(const Vector<Real> &u, bool flag = true, int iter = -1) override;
68  void update_2(const Vector<Real> &z, bool flag = true, int iter = -1) override;
69  void update(const Vector<Real> &u, const Vector<Real> &z, UpdateType type, int iter = -1) override;
70  void update_1(const Vector<Real> &u, UpdateType type, int iter = -1) override;
71  void update_2(const Vector<Real> &z, UpdateType type, int iter = -1) override;
72  void solve_update(const Vector<Real> &u, const Vector<Real> &z, UpdateType type, int iter = -1) override;
73  void value(Vector<Real> &c, const Vector<Real> &u, const Vector<Real> &z, Real &tol) override;
74  void solve(Vector<Real> &c, Vector<Real> &u, const Vector<Real> &z, Real &tol) override;
75  void applyJacobian_1(Vector<Real> &jv, const Vector<Real> &v, const Vector<Real> &u,
76  const Vector<Real> &z, Real &tol) override;
77  void applyJacobian_2(Vector<Real> &jv, const Vector<Real> &v, const Vector<Real> &u,
78  const Vector<Real> &z, Real &tol) override;
79  void applyInverseJacobian_1(Vector<Real> &ijv, const Vector<Real> &v, const Vector<Real> &u,
80  const Vector<Real> &z, Real &tol) override;
81  void applyAdjointJacobian_1(Vector<Real> &ajv, const Vector<Real> &v, const Vector<Real> &u,
82  const Vector<Real> &z, Real &tol) override;
83  void applyAdjointJacobian_2(Vector<Real> &ajv, const Vector<Real> &v, const Vector<Real> &u,
84  const Vector<Real> &z, Real &tol) override;
86  const Vector<Real> &z, Real &tol) override;
87  void applyAdjointHessian_11(Vector<Real> &ahwv, const Vector<Real> &w, const Vector<Real> &v,
88  const Vector<Real> &u, const Vector<Real> &z, Real &tol) override;
89  void applyAdjointHessian_12(Vector<Real> &ahwv, const Vector<Real> &w, const Vector<Real> &v,
90  const Vector<Real> &u, const Vector<Real> &z, Real &tol) override;
91  void applyAdjointHessian_21(Vector<Real> &ahwv, const Vector<Real> &w, const Vector<Real> &v,
92  const Vector<Real> &u, const Vector<Real> &z, Real &tol) override;
93  void applyAdjointHessian_22(Vector<Real> &ahwv, const Vector<Real> &w, const Vector<Real> &v,
94  const Vector<Real> &u, const Vector<Real> &z, Real &tol) override;
95 
96 // Definitions for parametrized (stochastic) equality constraints
97 public:
98  void setParameter(const std::vector<Real> &param) override;
99 
100 private:
101  void solveConRed(Vector<Real> &Sz, const Vector<Real> &z, Real &tol);
102  void applySens(Vector<Real> &jv, const Vector<Real> &v, const Vector<Real> &Sz, const Vector<Real> &z, Real &tol);
103  void applyAdjointSens(Vector<Real> &ajv, const Vector<Real> &v, const Vector<Real> &Sz, const Vector<Real> &z, Real &tol);
104 }; // class CompositeConstraint_SimOpt
105 
106 } // namespace ROL
107 
109 
110 #endif
void applyAdjointHessian_21(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the simulation-space derivative of the adjoint of the constraint optimization-space Jacobian at...
void solve_update(const Vector< Real > &u, const Vector< Real > &z, UpdateType type, int iter=-1) override
Update SimOpt constraint during solve (disconnected from optimization updates).
void applyAdjointJacobian_2(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the adjoint of the partial constraint Jacobian at , , to vector . This is the primary interface...
void solveConRed(Vector< Real > &Sz, const Vector< Real > &z, Real &tol)
void update_2(const Vector< Real > &z, bool flag=true, int iter=-1) override
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.
void value(Vector< Real > &c, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Evaluate the constraint operator at .
CompositeConstraint_SimOpt(const ROL::Ptr< Constraint_SimOpt< Real >> &conVal, const ROL::Ptr< Constraint_SimOpt< Real >> &conRed, const Vector< Real > &cVal, const Vector< Real > &cRed, const Vector< Real > &u, const Vector< Real > &Sz, const Vector< Real > &z, bool storage=true, bool isConRedParametrized=false)
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void applyAdjointHessian_12(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the optimization-space derivative of the adjoint of the constraint simulation-space Jacobian at...
void applyInverseAdjointJacobian_1(Vector< Real > &ijv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the inverse of the adjoint of the partial constraint Jacobian at , , to the vector ...
void setParameter(const std::vector< Real > &param) override
void applyInverseJacobian_1(Vector< Real > &ijv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the inverse 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) override
Apply the adjoint of the partial constraint Jacobian at , , to the vector . This is the primary inter...
void applyAdjointHessian_22(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the optimization-space derivative of the adjoint of the constraint optimization-space Jacobian ...
void applyAdjointSens(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &Sz, const Vector< Real > &z, Real &tol)
void applyAdjointHessian_11(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the simulation-space derivative of the adjoint of the constraint simulation-space Jacobian at ...
void applyJacobian_2(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the partial constraint Jacobian at , , to the vector .
Defines a composite equality constraint operator interface for simulation-based optimization.
void applySens(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &Sz, const Vector< Real > &z, Real &tol)
const ROL::Ptr< Constraint_SimOpt< Real > > conRed_
void solve(Vector< Real > &c, Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Given , solve for .
void update_1(const Vector< Real > &u, bool flag=true, int iter=-1) override
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.
Defines the constraint operator interface for simulation-based optimization.
void applyJacobian_1(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Apply the partial constraint Jacobian at , , to the vector .
void update(const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1) override
Update constraint functions. x is the optimization variable, flag = true if optimization variable is ...
ROL::Ptr< VectorController< Real > > stateStore_
const ROL::Ptr< Constraint_SimOpt< Real > > conVal_