// @HEADER // ***************************************************************************** // Rapid Optimization Library (ROL) Package // // Copyright 2014 NTESS and the ROL contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER /*! \file qoi.hpp \brief Provides the interface for local (cell-based) quantities of interest. */ #ifndef ROL_PDEOPT_QOI_HPP #define ROL_PDEOPT_QOI_HPP #include "pde.hpp" template class QoI { public: virtual ~QoI() {} virtual Real value(ROL::Ptr > & val, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) = 0; virtual void gradient_1(ROL::Ptr > & grad, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> gradient_1 not implemented."); } virtual void gradient_2(ROL::Ptr > & grad, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> gradient_2 not implemented."); } virtual std::vector gradient_3(std::vector > > & grad, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> gradient_3 not implemented."); } virtual void HessVec_11(ROL::Ptr > & hess, const ROL::Ptr > & v_coeff, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_11 not implemented."); } virtual void HessVec_12(ROL::Ptr > & hess, const ROL::Ptr > & v_coeff, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_12 not implemented."); } virtual void HessVec_13(ROL::Ptr > & hess, const ROL::Ptr > & v_param, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_13 not implemented."); } virtual void HessVec_21(ROL::Ptr > & hess, const ROL::Ptr > & v_coeff, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_21 not implemented."); } virtual void HessVec_22(ROL::Ptr > & hess, const ROL::Ptr > & v_coeff, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_22 not implemented."); } virtual void HessVec_23(ROL::Ptr > & hess, const ROL::Ptr > & v_param, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_23 not implemented."); } virtual std::vector HessVec_31(std::vector > > & hess, const ROL::Ptr > & v_coeff, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_31 not implemented."); } virtual std::vector HessVec_32(std::vector > > & hess, const ROL::Ptr > & v_coeff, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_32 not implemented."); } virtual std::vector HessVec_33(std::vector > > & hess, const ROL::Ptr > & v_param, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> HessVec_33 not implemented."); } virtual void Hessian_11(ROL::Ptr > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_11 not implemented."); } virtual void Hessian_12(ROL::Ptr > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_12 not implemented."); } virtual void Hessian_13(std::vector > > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_13 not implemented."); } virtual void Hessian_21(ROL::Ptr > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_21 not implemented."); } virtual void Hessian_22(ROL::Ptr > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_22 not implemented."); } virtual void Hessian_23(std::vector > > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_23 not implemented."); } virtual void Hessian_31(std::vector > > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_31 not implemented."); } virtual void Hessian_32(std::vector > > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_32 not implemented."); } virtual void Hessian_33(std::vector > & hess, const ROL::Ptr > & u_coeff, const ROL::Ptr > & z_coeff = ROL::nullPtr, const ROL::Ptr > & z_param = ROL::nullPtr) { throw Exception::NotImplemented(">>> Hessian_33 not implemented."); } private: std::vector param_; protected: std::vector getParameter(void) const { return param_; } public: void setParameter(const std::vector ¶m) { param_.assign(param.begin(),param.end()); } }; // QOI #endif