ROL
ROL::ReducedDynamicObjective< Real > Class Template Reference

Defines the reduced time-dependent objective function interface for simulation-based optimization. More...

#include <ROL_ReducedDynamicObjective.hpp>

+ Inheritance diagram for ROL::ReducedDynamicObjective< Real >:

Public Member Functions

 ReducedDynamicObjective (const Ptr< DynamicObjective< Real > > &obj, const Ptr< DynamicConstraint< Real > > &con, const Ptr< Vector< Real > > &u0, const Ptr< Vector< Real > > &zvec, const Ptr< Vector< Real > > &cvec, const std::vector< TimeStamp< Real > > &timeStamp, ROL::ParameterList &pl, const Ptr< std::ostream > &stream=nullPtr)
 
Ptr< Vector< Real > > makeDynamicVector (const Vector< Real > &x) const
 
void update (const Vector< Real > &x, bool flag=true, int iter=-1)
 
Real value (const Vector< Real > &x, Real &tol)
 
void gradient (Vector< Real > &g, const Vector< Real > &x, Real &tol)
 
void hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 
- Public Member Functions inherited from ROL::ROL::Objective< Real >
virtual ~Objective ()
 
 Objective ()
 
virtual void update (const Vector< Real > &x, UpdateType type, int iter=-1)
 Update objective function.
 
virtual void update (const Vector< Real > &x, bool flag=true, int iter=-1)
 Update objective function.
 
virtual Real value (const Vector< Real > &x, Real &tol)=0
 Compute value.
 
virtual void gradient (Vector< Real > &g, const Vector< Real > &x, Real &tol)
 Compute gradient.
 
virtual Real dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol)
 Compute directional derivative.
 
virtual void hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply Hessian approximation to vector.
 
virtual void invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply inverse Hessian approximation to vector.
 
virtual void precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply preconditioner to vector.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference gradient check.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference gradient check.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference gradient check with specified step sizes.
 
virtual std::vector< std::vector< Real > > checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference gradient check with specified step sizes.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference Hessian-applied-to-vector check.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference Hessian-applied-to-vector check.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference Hessian-applied-to-vector check with specified step sizes.
 
virtual std::vector< std::vector< Real > > checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference Hessian-applied-to-vector check with specified step sizes.
 
virtual std::vector< Real > checkHessSym (const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
 Hessian symmetry check.
 
virtual std::vector< Real > checkHessSym (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
 Hessian symmetry check.
 
virtual void setParameter (const std::vector< Real > &param)
 

Private Types

using size_type = typename std::vector<Real>::size_type
 

Private Member Functions

PartitionedVector< Real > & partition (Vector< Real > &x) const
 
const PartitionedVector< Real > & partition (const Vector< Real > &x) const
 
void throwError (const int err, const std::string &sfunc, const std::string &func, const int line) const
 
Real solveState (const Vector< Real > &x)
 
Real updateSketch (const Vector< Real > &x, const Real tol)
 
void setTerminalCondition (Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void computeAdjointRHS (Vector< Real > &rhs, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void advanceAdjoint (Vector< Real > &l, Vector< Real > &rhs, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void solveAdjoint (const Vector< Real > &x)
 
void updateGradient (Vector< Real > &g, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void advanceStateSens (Vector< Real > &wnew, const Vector< Real > &v, const Vector< Real > &wold, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void setTerminalConditionHess (Vector< Real > &p, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void computeOldStateHessLag (Vector< Real > &Hv, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
 
void computeOldMixedHessLag (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
 
void computeNewStateJacobian (Vector< Real > &Hv, const Vector< Real > &p, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
 
void computeNewStateHessLag (Vector< Real > &Hv, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
 
void computeNewMixedHessLag (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
 
void advanceAdjointSens (Vector< Real > &p, Vector< Real > &rhs, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void computeControlHessLag (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void addMixedHessLag (Vector< Real > &Hv, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 
void addAdjointSens (Vector< Real > &Hv, const Vector< Real > &p, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
 

Private Attributes

const Ptr< DynamicObjective< Real > > obj_
 
const Ptr< DynamicConstraint< Real > > con_
 
const Ptr< Vector< Real > > u0_
 
const std::vector< TimeStamp< Real > > timeStamp_
 
const size_type Nt_
 
const bool useSketch_
 
size_type rankState_
 
Ptr< Sketch< Real > > stateSketch_
 
size_type rankAdjoint_
 
Ptr< Sketch< Real > > adjointSketch_
 
size_type rankStateSens_
 
Ptr< Sketch< Real > > stateSensSketch_
 
const bool useInexact_
 
const size_type updateFactor_
 
const size_type maxRank_
 
const bool syncHessRank_
 
std::vector< Ptr< Vector< Real > > > uhist_
 
std::vector< Ptr< Vector< Real > > > lhist_
 
std::vector< Ptr< Vector< Real > > > whist_
 
std::vector< Ptr< Vector< Real > > > phist_
 
Ptr< Vector< Real > > cprimal_
 
Ptr< Vector< Real > > crhs_
 
Ptr< Vector< Real > > udual_
 
Ptr< Vector< Real > > rhs_
 
Ptr< Vector< Real > > zdual_
 
Real val_
 
bool isValueComputed_
 
bool isStateComputed_
 
bool isAdjointComputed_
 
bool useHessian_
 
bool useSymHess_
 
Ptr< std::ostream > stream_
 
const bool print_
 
const int freq_
 

Additional Inherited Members

- Protected Member Functions inherited from ROL::ROL::Objective< Real >
const std::vector< Real > getParameter (void) const
 

Detailed Description

template<typename Real>
class ROL::ReducedDynamicObjective< Real >

Defines the reduced time-dependent objective function interface for simulation-based optimization.

This objective function implements the implicitly defined objective function given by

\[ F(z) := \sum_{n=1}^{N_t} f_n(u_{n-1}(z),u_n(z),z_n) \]

where \(f_n:\mathcal{U}\times\mathcal{U}\times\mathcal{Z}\to\mathbb{R}\), and \(u_n\in\mathcal{U}\) solves the system of equations

\[ c_n(u_{n-1},u_n,z_n) = 0,\quad n=1,\ldots,N_t \]

with \(u_0\) provided.

Disclaimer: This is currently only set up for single step time integrators and piecewise-constant-in-time controls.

Definition at line 80 of file ROL_ReducedDynamicObjective.hpp.

Member Typedef Documentation

◆ size_type

template<typename Real >
using ROL::ReducedDynamicObjective< Real >::size_type = typename std::vector<Real>::size_type
private

Definition at line 81 of file ROL_ReducedDynamicObjective.hpp.

Constructor & Destructor Documentation

◆ ReducedDynamicObjective()

Member Function Documentation

◆ partition() [1/2]

◆ partition() [2/2]

template<typename Real >
const PartitionedVector< Real > & ROL::ReducedDynamicObjective< Real >::partition ( const Vector< Real > & x) const
inlineprivate

Definition at line 131 of file ROL_ReducedDynamicObjective.hpp.

◆ throwError()

◆ makeDynamicVector()

template<typename Real >
Ptr< Vector< Real > > ROL::ReducedDynamicObjective< Real >::makeDynamicVector ( const Vector< Real > & x) const
inline

◆ update()

◆ value()

◆ gradient()

◆ hessVec()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::hessVec ( Vector< Real > & hv,
const Vector< Real > & v,
const Vector< Real > & x,
Real & tol )
inline

Definition at line 410 of file ROL_ReducedDynamicObjective.hpp.

References ROL::ReducedDynamicObjective< Real >::addAdjointSens(), ROL::ReducedDynamicObjective< Real >::addMixedHessLag(), ROL::ReducedDynamicObjective< Real >::adjointSketch_, ROL::ReducedDynamicObjective< Real >::advanceAdjointSens(), ROL::ReducedDynamicObjective< Real >::advanceStateSens(), ROL::ReducedDynamicObjective< Real >::computeControlHessLag(), ROL::ReducedDynamicObjective< Real >::computeNewMixedHessLag(), ROL::ReducedDynamicObjective< Real >::computeNewStateHessLag(), ROL::ReducedDynamicObjective< Real >::computeNewStateJacobian(), ROL::ReducedDynamicObjective< Real >::computeOldMixedHessLag(), ROL::ReducedDynamicObjective< Real >::computeOldStateHessLag(), ROL::ReducedDynamicObjective< Real >::con_, ROL::PartitionedVector< Real >::get(), ROL::Objective< Real >::hessVec(), ROL::ReducedDynamicObjective< Real >::lhist_, ROL::ReducedDynamicObjective< Real >::Nt_, ROL::ReducedDynamicObjective< Real >::obj_, ROL::ReducedDynamicObjective< Real >::partition(), ROL::ReducedDynamicObjective< Real >::phist_, ROL::ReducedDynamicObjective< Real >::rhs_, ROL::ReducedDynamicObjective< Real >::setTerminalConditionHess(), ROL::ReducedDynamicObjective< Real >::solveAdjoint(), ROL::ReducedDynamicObjective< Real >::solveState(), ROL::ReducedDynamicObjective< Real >::stateSensSketch_, ROL::ReducedDynamicObjective< Real >::stateSketch_, ROL::ReducedDynamicObjective< Real >::throwError(), ROL::ReducedDynamicObjective< Real >::timeStamp_, ROL::ReducedDynamicObjective< Real >::u0_, ROL::ReducedDynamicObjective< Real >::uhist_, ROL::ReducedDynamicObjective< Real >::useHessian_, ROL::ReducedDynamicObjective< Real >::useSketch_, ROL::ReducedDynamicObjective< Real >::useSymHess_, and ROL::ReducedDynamicObjective< Real >::whist_.

◆ solveState()

◆ updateSketch()

◆ setTerminalCondition()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::setTerminalCondition ( Vector< Real > & l,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ computeAdjointRHS()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeAdjointRHS ( Vector< Real > & rhs,
const Vector< Real > & l,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ advanceAdjoint()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::advanceAdjoint ( Vector< Real > & l,
Vector< Real > & rhs,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ solveAdjoint()

◆ updateGradient()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::updateGradient ( Vector< Real > & g,
const Vector< Real > & l,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ advanceStateSens()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::advanceStateSens ( Vector< Real > & wnew,
const Vector< Real > & v,
const Vector< Real > & wold,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ setTerminalConditionHess()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::setTerminalConditionHess ( Vector< Real > & p,
const Vector< Real > & v,
const Vector< Real > & l,
const Vector< Real > & wold,
const Vector< Real > & wnew,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ computeOldStateHessLag()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeOldStateHessLag ( Vector< Real > & Hv,
const Vector< Real > & l,
const Vector< Real > & wold,
const Vector< Real > & wnew,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts,
const bool sumInto = false )
inlineprivate

◆ computeOldMixedHessLag()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeOldMixedHessLag ( Vector< Real > & Hv,
const Vector< Real > & v,
const Vector< Real > & l,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts,
const bool sumInto = false )
inlineprivate

◆ computeNewStateJacobian()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeNewStateJacobian ( Vector< Real > & Hv,
const Vector< Real > & p,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts,
const bool sumInto = false )
inlineprivate

◆ computeNewStateHessLag()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeNewStateHessLag ( Vector< Real > & Hv,
const Vector< Real > & l,
const Vector< Real > & wold,
const Vector< Real > & wnew,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts,
const bool sumInto = false )
inlineprivate

◆ computeNewMixedHessLag()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeNewMixedHessLag ( Vector< Real > & Hv,
const Vector< Real > & v,
const Vector< Real > & l,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts,
const bool sumInto = false )
inlineprivate

◆ advanceAdjointSens()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::advanceAdjointSens ( Vector< Real > & p,
Vector< Real > & rhs,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ computeControlHessLag()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::computeControlHessLag ( Vector< Real > & Hv,
const Vector< Real > & v,
const Vector< Real > & l,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ addMixedHessLag()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::addMixedHessLag ( Vector< Real > & Hv,
const Vector< Real > & l,
const Vector< Real > & wold,
const Vector< Real > & wnew,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

◆ addAdjointSens()

template<typename Real >
void ROL::ReducedDynamicObjective< Real >::addAdjointSens ( Vector< Real > & Hv,
const Vector< Real > & p,
const Vector< Real > & uold,
const Vector< Real > & unew,
const Vector< Real > & z,
const TimeStamp< Real > & ts )
inlineprivate

Member Data Documentation

◆ obj_

◆ con_

◆ u0_

◆ timeStamp_

◆ Nt_

◆ useSketch_

◆ rankState_

◆ stateSketch_

◆ rankAdjoint_

◆ adjointSketch_

◆ rankStateSens_

◆ stateSensSketch_

◆ useInexact_

template<typename Real >
const bool ROL::ReducedDynamicObjective< Real >::useInexact_
private

◆ updateFactor_

template<typename Real >
const size_type ROL::ReducedDynamicObjective< Real >::updateFactor_
private

◆ maxRank_

template<typename Real >
const size_type ROL::ReducedDynamicObjective< Real >::maxRank_
private

◆ syncHessRank_

template<typename Real >
const bool ROL::ReducedDynamicObjective< Real >::syncHessRank_
private

◆ uhist_

◆ lhist_

◆ whist_

template<typename Real >
std::vector<Ptr<Vector<Real> > > ROL::ReducedDynamicObjective< Real >::whist_
private

◆ phist_

template<typename Real >
std::vector<Ptr<Vector<Real> > > ROL::ReducedDynamicObjective< Real >::phist_
private

◆ cprimal_

◆ crhs_

◆ udual_

◆ rhs_

◆ zdual_

◆ val_

template<typename Real >
Real ROL::ReducedDynamicObjective< Real >::val_
private

◆ isValueComputed_

template<typename Real >
bool ROL::ReducedDynamicObjective< Real >::isValueComputed_
private

◆ isStateComputed_

◆ isAdjointComputed_

◆ useHessian_

◆ useSymHess_

template<typename Real >
bool ROL::ReducedDynamicObjective< Real >::useSymHess_
private

◆ stream_

template<typename Real >
Ptr<std::ostream> ROL::ReducedDynamicObjective< Real >::stream_
private

◆ print_

template<typename Real >
const bool ROL::ReducedDynamicObjective< Real >::print_
private

◆ freq_

template<typename Real >
const int ROL::ReducedDynamicObjective< Real >::freq_
private

The documentation for this class was generated from the following file: