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
15
37namespace ROL {
38
39template<typename Real>
41private:
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
55public:
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;
80 const Vector<Real> &z, Real &tol) override;
82 const Vector<Real> &z, Real &tol) override;
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
97public:
98 void setParameter(const std::vector<Real> &param) override;
99
100private:
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
Defines a composite equality constraint operator interface for simulation-based optimization.
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 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 solve(Vector< Real > &c, Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Given , solve for .
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,...
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 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 .
void applyAdjointSens(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &Sz, const Vector< Real > &z, Real &tol)
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 solveConRed(Vector< Real > &Sz, const Vector< Real > &z, Real &tol)
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...
ROL::Ptr< VectorController< Real > > stateStore_
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,...
void value(Vector< Real > &c, const Vector< Real > &u, const Vector< Real > &z, Real &tol) override
Evaluate the constraint operator at .
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 applySens(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &Sz, const Vector< Real > &z, Real &tol)
const ROL::Ptr< Constraint_SimOpt< Real > > conVal_
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 setParameter(const std::vector< Real > &param) override
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 i...
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 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 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 .
const ROL::Ptr< Constraint_SimOpt< Real > > conRed_
Defines the constraint operator interface for simulation-based optimization.
Defines the linear algebra or vector space interface.