ROL
ROL_Reduced_Constraint_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_REDUCED_CONSTRAINT_SIMOPT_H
11#define ROL_REDUCED_CONSTRAINT_SIMOPT_H
12
15#include "ROL_BatchManager.hpp"
16
17namespace ROL {
18
19template <class Real>
21private:
22 const ROL::Ptr<Constraint_SimOpt<Real>> conVal_, conRed_;
23 const ROL::Ptr<VectorController<Real>> stateStore_, adjointStore_;
24
25 // Primal vectors
26 const ROL::Ptr<Vector<Real>> state_, adjoint_, residual_;
27 const ROL::Ptr<Vector<Real>> state_sens_, adjoint_sens_;
28
29 // Dual vectors
30 const ROL::Ptr<Vector<Real>> dualstate_, dualstate1_, dualadjoint_;
31 const ROL::Ptr<Vector<Real>> dualcontrol_, dualresidual_;
32
33 const bool storage_;
34 const bool useFDhessVec_;
35
38
44
45 void solve_state_equation(const Vector<Real> &z, Real &tol);
46
51 void solve_adjoint_equation(const Vector<Real> &w, const Vector<Real> &z, Real &tol);
52
57 void solve_state_sensitivity(const Vector<Real> &v, const Vector<Real> &z, Real &tol);
58
66 void solve_adjoint_sensitivity(const Vector<Real> &w, const Vector<Real> &v, const Vector<Real> &z, Real &tol);
67
68public:
82 const ROL::Ptr<Constraint_SimOpt<Real>> &conVal,
83 const ROL::Ptr<Constraint_SimOpt<Real>> &conRed,
84 const ROL::Ptr<VectorController<Real>> &stateStore,
85 const ROL::Ptr<Vector<Real>> &state,
86 const ROL::Ptr<Vector<Real>> &control,
87 const ROL::Ptr<Vector<Real>> &adjoint,
88 const ROL::Ptr<Vector<Real>> &residual,
89 bool storage = true,
90 bool useFDhessVec = false);
91
109 const ROL::Ptr<Constraint_SimOpt<Real>> &conVal,
110 const ROL::Ptr<Constraint_SimOpt<Real>> &conRed,
111 const ROL::Ptr<VectorController<Real>> &stateStore,
112 const ROL::Ptr<Vector<Real>> &state,
113 const ROL::Ptr<Vector<Real>> &control,
114 const ROL::Ptr<Vector<Real>> &adjoint,
115 const ROL::Ptr<Vector<Real>> &residual,
116 const ROL::Ptr<Vector<Real>> &dualstate,
117 const ROL::Ptr<Vector<Real>> &dualcontrol,
118 const ROL::Ptr<Vector<Real>> &dualadjoint,
119 const ROL::Ptr<Vector<Real>> &dualresidual,
120 bool storage = true,
121 bool useFDhessVec = false);
122
123 void summarize(std::ostream &stream, const Ptr<BatchManager<Real>> &bman = nullPtr) const;
124
125 void reset();
126
129 void update( const Vector<Real> &z, bool flag = true, int iter = -1 );
130 void update( const Vector<Real> &z, UpdateType type, int iter = -1 );
131
136 void value( Vector<Real> &c, const Vector<Real> &z, Real &tol );
137
143 void applyJacobian( Vector<Real> &jv, const Vector<Real> &v,
144 const Vector<Real> &z, Real &tol );
145
147 const Vector<Real> &z, Real &tol );
148
152 void applyAdjointHessian( Vector<Real> &ahwv, const Vector<Real> &w,
153 const Vector<Real> &v, const Vector<Real> &z,
154 Real &tol );
155
156// For parametrized (stochastic) objective functions and constraints
157public:
158 void setParameter(const std::vector<Real> &param) {
160 conVal_->setParameter(param);
161 conRed_->setParameter(param);
162 }
163}; // class Reduced_Constraint_SimOpt
164
165} // namespace ROL
166
168
169#endif
Defines the constraint operator interface for simulation-based optimization.
Defines the general constraint operator interface.
virtual void setParameter(const std::vector< Real > &param)
const ROL::Ptr< Vector< Real > > dualresidual_
const ROL::Ptr< Vector< Real > > dualstate_
void solve_adjoint_sensitivity(const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Given , the adjoint variable , and a direction , solve the adjoint sensitvity equation for .
void setParameter(const std::vector< Real > &param)
void solve_state_sensitivity(const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Given which solves the state equation and a direction , solve the state senstivity equation for .
void solve_state_equation(const Vector< Real > &z, Real &tol)
const ROL::Ptr< Vector< Real > > state_sens_
void value(Vector< Real > &c, const Vector< Real > &z, Real &tol)
Given , evaluate the equality constraint where solves .
const ROL::Ptr< Vector< Real > > dualadjoint_
const ROL::Ptr< Vector< Real > > dualcontrol_
const ROL::Ptr< Vector< Real > > residual_
void summarize(std::ostream &stream, const Ptr< BatchManager< Real > > &bman=nullPtr) const
const ROL::Ptr< VectorController< Real > > stateStore_
void applyAdjointHessian(Vector< Real > &ahwv, const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Given , evaluate the Hessian of the objective function in the direction .
void update(const Vector< Real > &z, bool flag=true, int iter=-1)
Update the SimOpt objective function and equality constraint.
const ROL::Ptr< Vector< Real > > adjoint_
const ROL::Ptr< Vector< Real > > dualstate1_
const ROL::Ptr< Vector< Real > > state_
const ROL::Ptr< Constraint_SimOpt< Real > > conRed_
const ROL::Ptr< VectorController< Real > > adjointStore_
void applyAdjointJacobian(Vector< Real > &ajw, const Vector< Real > &w, const Vector< Real > &z, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
const ROL::Ptr< Vector< Real > > adjoint_sens_
const ROL::Ptr< Constraint_SimOpt< Real > > conVal_
void solve_adjoint_equation(const Vector< Real > &w, const Vector< Real > &z, Real &tol)
Given which solves the state equation, solve the adjoint equation for .
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &z, Real &tol)
Given , apply the Jacobian to a vector where solves .
Defines the linear algebra or vector space interface.