11 #ifndef ROL_DYNAMICTRACKINGFEMOBJECTIVE_HPP
12 #define ROL_DYNAMICTRACKINGFEMOBJECTIVE_HPP
33 template<
typename Real>
57 virtual Real
value(
const V& uo,
const V& un,
58 const V& z,
const TS& timeStamp )
const override {
60 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
71 res_n->axpy( -1.0, *(
target_->get(k)) );
72 result += w*res_n->dot(*res_n);
76 res_o->axpy( -1, *(
target_->get(k-1) ) );
77 result += w*res_n->dot(*res_o);
78 result += w*res_o->dot(*res_o);
87 const V& z,
const TS& timeStamp )
const override {
88 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
103 const V& z,
const TS& timeStamp )
const override {
104 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
111 const V& z,
const TS& timeStamp )
const override {
112 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
120 const V& z,
const TS& timeStamp )
const override {
121 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
122 if( timeStamp.
k>0 ) {
131 const V& z,
const TS& timeStamp )
const override {
136 const V& z,
const TS& timeStamp )
const override {
141 const V& z,
const TS& timeStamp )
const override {
146 const V& z,
const TS& timeStamp )
const override {
148 hv.
scale(0.5*(timeStamp.
t.at(1)-timeStamp.
t.at(0)));
152 const V& z,
const TS& timeStamp )
const override {
157 const V& z,
const TS& timeStamp )
const override {
162 const V& z,
const TS& timeStamp )
const override {
167 const V& z,
const TS& timeStamp )
const override {
175 template<
typename Real>
176 inline Ptr<DynamicObjective<Real>>
178 Ptr<DynamicObjective<Real>> obj = makePtr<DynamicTrackingFEMObjective<Real>>(target,alpha);
184 #endif // ROL_DYNAMICTRACKINGFEMOBJECTIVE_HPP
virtual void gradient_z(V &g, 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 axpy(const Real alpha, const Vector &x)
Compute where .
DynamicTrackingFEMObjective(const Ptr< PartitionedVector< Real >> &target, Real alpha=0.0)
Defines the linear algebra of vector space on a generic partitioned vector.
virtual void hessVec_z_z(V &hv, const V &v, 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 override
virtual void gradient_uo(V &g, 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 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.
virtual Real dot(const Vector &x) const =0
Compute where .
virtual void hessVec_un_un(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual void hessVec_un_z(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
Ptr< DynamicObjective< Real > > make_DynamicTrackingFEMObjective(const Ptr< PartitionedVector< Real >> &target, Real alpha=0.0)
virtual Real value(const V &uo, const V &un, const V &z, const TS &timeStamp) const override
typename PartitionedVector< Real >::size_type size_type
std::vector< PV >::size_type size_type
VectorWorkspace< Real > workspace_
virtual void set(const Vector &x)
Set where .
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 hessVec_uo_un(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 gradient_un(V &g, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
virtual ~DynamicTrackingFEMObjective()
Defines the time-local contribution to a quadratic tracking objective.
virtual void hessVec_un_uo(V &hv, const V &v, const V &uo, const V &un, const V &z, const TS &timeStamp) const override
Ptr< PartitionedVector< Real > > target_