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 ) {
154 const V& z,
const TS& timeStamp )
const override {
159 const V& z,
const TS& timeStamp )
const override {
164 const V& z,
const TS& timeStamp )
const override {
169 const V& z,
const TS& timeStamp )
const override {
170 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
176 const V& z,
const TS& timeStamp )
const override {
181 const V& z,
const TS& timeStamp )
const override {
186 const V& z,
const TS& timeStamp )
const override {
191 const V& z,
const TS& timeStamp )
const override {
192 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
200 template<
typename Real>
201 inline Ptr<DynamicObjective<Real>>
203 Ptr<DynamicObjective<Real>> obj = makePtr<DynamicTrackingObjective<Real>>(target,alpha);
209 #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 hessVec_z_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 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 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 .
Ptr< DynamicObjective< Real > > make_DynamicTrackingObjective(const Ptr< PartitionedVector< Real >> &target, Real alpha=0.0)
virtual void hessVec_z_z(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
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_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 hessVec_z_un(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void set(const Vector &x)
Set where .
Defines the time-local contribution to a quadratic tracking objective.
virtual void hessVec_un_z(V &hv, const V &v, 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 override