45 #ifndef ROL_DYNAMICTRACKINGFEMOBJECTIVE_HPP
46 #define ROL_DYNAMICTRACKINGFEMOBJECTIVE_HPP
67 template<
typename Real>
91 virtual Real
value(
const V& uo,
const V& un,
92 const V& z,
const TS& timeStamp )
const override {
94 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
105 res_n->axpy( -1.0, *(
target_->get(k)) );
106 result += w*res_n->dot(*res_n);
110 res_o->axpy( -1, *(
target_->get(k-1) ) );
111 result += w*res_n->dot(*res_o);
112 result += w*res_o->dot(*res_o);
121 const V& z,
const TS& timeStamp )
const override {
122 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
137 const V& z,
const TS& timeStamp )
const override {
138 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
145 const V& z,
const TS& timeStamp )
const override {
146 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
154 const V& z,
const TS& timeStamp )
const override {
155 Real dt = timeStamp.
t.at(1)-timeStamp.
t.at(0);
156 if( timeStamp.
k>0 ) {
165 const V& z,
const TS& timeStamp )
const override {
170 const V& z,
const TS& timeStamp )
const override {
175 const V& z,
const TS& timeStamp )
const override {
180 const V& z,
const TS& timeStamp )
const override {
182 hv.
scale(0.5*(timeStamp.
t.at(1)-timeStamp.
t.at(0)));
186 const V& z,
const TS& timeStamp )
const override {
191 const V& z,
const TS& timeStamp )
const override {
196 const V& z,
const TS& timeStamp )
const override {
201 const V& z,
const TS& timeStamp )
const override {
209 template<
typename Real>
210 inline Ptr<DynamicObjective<Real>>
212 Ptr<DynamicObjective<Real>> obj = makePtr<DynamicTrackingFEMObjective<Real>>(target,alpha);
218 #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_