45 #ifndef ROL_DYNAMICTRACKINGOBJECTIVE_HPP
46 #define ROL_DYNAMICTRACKINGOBJECTIVE_HPP
67 template<
typename Real>
91 virtual Real
value(
const V& uo,
const V& un,
92 const V& z,
const TS& timeStamp )
const override {
93 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
100 udiff->axpy(-1.0, *utarg);
102 Real result = 0.5*dt*( 0.5*udiff->dot(*udiff) +
alpha_*z.
dot(z) );
107 udiff->axpy(-1.0,*utarg);
108 result += 0.25*dt*(udiff->dot(*udiff));
116 const V& z,
const TS& timeStamp )
const override {
117 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
118 if( timeStamp.
k>0 ) {
127 const V& z,
const TS& timeStamp )
const override {
128 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
135 const V& z,
const TS& timeStamp )
const override {
136 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
144 const V& z,
const TS& timeStamp )
const override {
145 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
146 if( timeStamp.
k>0 ) {
155 const V& z,
const TS& timeStamp )
const override {
160 const V& z,
const TS& timeStamp )
const override {
165 const V& z,
const TS& timeStamp )
const override {
170 const V& z,
const TS& timeStamp )
const {
172 hv.
scale(0.5*(timeStamp.
t.at(1)-timeStamp.
t.at(0)));
176 const V& z,
const TS& timeStamp )
const {
181 const V& z,
const TS& timeStamp )
const {
186 const V& z,
const TS& timeStamp )
const {
191 const V& z,
const TS& timeStamp )
const {
201 #endif // ROL_DYNAMICTRACKINGOBJECTIVE_HPP
virtual void hessVec_un_uo(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void scale(const Real alpha)=0
Compute where .
virtual void gradient_uo(V &g, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void hessVec_z_uo(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const
virtual void hessVec_un_z(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const
virtual void hessVec_z_z(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Defines the linear algebra of vector space on a generic partitioned vector.
virtual void hessVec_uo_z(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void gradient_z(V &g, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void hessVec_z_un(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const
Contains local time step information.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Defines the time-dependent objective function interface for simulation-based optimization. Computes time-local contributions of value, gradient, Hessian-vector product etc to a larger composite objective defined over the simulation time. In contrast to other objective classes Objective_TimeSimOpt has a default implementation of value which returns zero, as time-dependent simulation based optimization problems may have an objective value which depends only on the final state of the system.
DynamicTrackingObjective(const Ptr< PartitionedVector< Real >> &target, Real alpha=0.0)
virtual Real dot(const Vector &x) const =0
Compute where .
typename PartitionedVector< Real >::size_type size_type
virtual void gradient_un(V &g, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual Real value(const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void hessVec_un_un(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const
virtual void hessVec_uo_uo(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void hessVec_uo_un(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
Ptr< PartitionedVector< Real > > target_
VectorWorkspace< Real > workspace_
virtual ~DynamicTrackingObjective()
std::vector< PV >::size_type size_type
virtual void set(const Vector &x)
Set where .
Defines the time-local contribution to a quadratic tracking objective.