11 #ifndef ROL_DYNAMICTRACKINGOBJECTIVE_HPP
12 #define ROL_DYNAMICTRACKINGOBJECTIVE_HPP
33 template<
typename Real>
57 virtual Real
value(
const V& uo,
const V& un,
58 const V& z,
const TS& timeStamp )
const override {
59 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
66 udiff->axpy(-1.0, *utarg);
68 Real result = 0.5*dt*( 0.5*udiff->dot(*udiff) +
alpha_*z.
dot(z) );
73 udiff->axpy(-1.0,*utarg);
74 result += 0.25*dt*(udiff->dot(*udiff));
82 const V& z,
const TS& timeStamp )
const override {
83 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
93 const V& z,
const TS& timeStamp )
const override {
94 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
101 const V& z,
const TS& timeStamp )
const override {
102 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
110 const V& z,
const TS& timeStamp )
const override {
111 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
112 if( timeStamp.
k>0 ) {
120 const V& z,
const TS& timeStamp )
const override {
125 const V& z,
const TS& timeStamp )
const override {
130 const V& z,
const TS& timeStamp )
const override {
135 const V& z,
const TS& timeStamp )
const override {
136 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
142 const V& z,
const TS& timeStamp )
const override {
147 const V& z,
const TS& timeStamp )
const override {
152 const V& z,
const TS& timeStamp )
const override {
157 const V& z,
const TS& timeStamp )
const override {
158 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
166 template<
typename Real>
167 inline Ptr<DynamicObjective<Real>>
169 Ptr<DynamicObjective<Real>> obj = makePtr<DynamicTrackingObjective<Real>>(target,alpha);
175 #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