[P]arallel [Hi]gh-order [Li]brary for [P]DEs
Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
|
Creates a constraint from an objective function and a offset value. More...
#include <constraintfromobjective_simopt.hpp>
Public Member Functions | |
ConstraintFromObjective_SimOpt (const ROL::Ptr< ROL::Objective_SimOpt< Real > > &obj, const Real offset=0) | |
Constructor. | |
const ROL::Ptr< ROL::Objective_SimOpt< Real > > | getObjective (void) const |
Get underlying objective function. | |
void | setParameter (const std::vector< Real > ¶m) override |
Set parameter on constraint. | |
void | update (const V &des_var_sim, const V &des_var_ctl, bool flag=true, int iter=-1) override |
Update constraint (underlying objective)'s design varibles. | |
void | value (V &c, const V &des_var_sim, const V &des_var_ctl, Real &tol) override |
Returns the constraint value equal to the objective value minus the offset. | |
void | applyJacobian_1 (V &jacobian_vector, const V &v, const V &des_var_sim, const V &des_var_ctl, Real &tol) override |
Returns dIdX1.dot(v) where v has the size of X1. | |
void | applyJacobian_2 (V &jacobian_vector, const V &v, const V &des_var_sim, const V &des_var_ctl, Real &tol) override |
Returns dIdX2.dot(v) where v has the size of X2. | |
void | applyAdjointJacobian_1 (V &ajv, const V &v, const V &des_var_sim, const V &des_var_ctl, Real &tol) override |
Returns v*dIdX1 where v should be a scalar. | |
void | applyAdjointJacobian_2 (V &ajv, const V &v, const V &des_var_sim, const V &des_var_ctl, Real &tol) override |
Returns v*dIdX2 where v should be a scalar. | |
void | applyAdjointHessian_11 (ROL::Vector< double > &output_vector, const ROL::Vector< double > &dual, const ROL::Vector< double > &input_vector, const ROL::Vector< double > &des_var_sim, const ROL::Vector< double > &des_var_ctl, double &tol) |
Returns dual*dIdX1dX1*input_vector where dual should be a scalar, and input_vector has size X1. | |
void | applyAdjointHessian_12 (ROL::Vector< double > &output_vector, const ROL::Vector< double > &dual, const ROL::Vector< double > &input_vector, const ROL::Vector< double > &des_var_sim, const ROL::Vector< double > &des_var_ctl, double &tol) |
Returns dual*dIdX2dX1*input_vector where dual should be a scalar, and input_vector has size X1. | |
void | applyAdjointHessian_21 (ROL::Vector< double > &output_vector, const ROL::Vector< double > &dual, const ROL::Vector< double > &input_vector, const ROL::Vector< double > &des_var_sim, const ROL::Vector< double > &des_var_ctl, double &tol) |
Returns dual*dIdX1dX2*input_vector where dual should be a scalar, and input_vector has size X2. | |
void | applyAdjointHessian_22 (ROL::Vector< double > &output_vector, const ROL::Vector< double > &dual, const ROL::Vector< double > &input_vector, const ROL::Vector< double > &des_var_sim, const ROL::Vector< double > &des_var_ctl, double &tol) |
Returns dual*dIdX2dX2*input_vector where dual should be a scalar, and input_vector has size X2. | |
Private Types | |
using | V = ROL::Vector< Real > |
Shorthand for ROL::Vector. | |
Private Member Functions | |
Real | getValue (const V &x) |
Get a vector's entry value, where the vector is a SingletonVector. | |
void | setValue (V &x, Real val) |
Set a value on the vector, where the vector is a SingletonVector. | |
Private Attributes | |
const ROL::Ptr< ROL::Objective_SimOpt< Real > > | obj_ |
Underlying objective function. | |
ROL::Ptr< V > | dualVector_1_ |
Vector of size n_sim to store dIdX1. | |
ROL::Ptr< V > | dualVector_2_ |
Vector of size n_ctl to store dIdX2. | |
const Real | offset_ |
Offset value defining the constraint on the objective function. | |
bool | isDual1Initialized_ |
Check whether dualVector_1_ has been initialized. | |
bool | isDual2Initialized_ |
Check whether dualVector_2_ has been initialized. | |
Creates a constraint from an objective function and a offset value.
Same as ROL::ConstraintFromObjective except we do it for the SimOpt version. This will be especially useful for example when we have a target lift constraint such as CL - 0.375 = 0.
Note that Constraints usually provide a vector of constraints with multiple entries and that we rarely need to access 1 specific entry value. However, in the case of an objective, it only contains a single value, hence the use of the SingletonVector. (Weird naming since it has nothing to do with the typical "Singleton" design pattern).
Definition at line 20 of file constraintfromobjective_simopt.hpp.