19 #ifndef PISM_IPFUNCTIONAL_H
20 #define PISM_IPFUNCTIONAL_H
22 #include "pism/util/fem/FEM.hh"
40 template<
class IMVecType>
55 virtual void valueAt(IMVecType &x,
double *OUTPUT) = 0;
68 virtual void gradientAt(IMVecType &x, IMVecType &gradient) = 0;
93 template<
class IMVecType>
100 virtual void dot(IMVecType &a, IMVecType &b,
double *OUTPUT) = 0;
Manages iterating over element indices.
Q1 element with sides parallel to X and Y axes.
virtual void valueAt(IMVecType &x, double *OUTPUT)=0
Computes the value of the functional at the vector x.
IPFunctional(std::shared_ptr< const Grid > grid)
IPFunctional(IPFunctional const &)
IPFunctional & operator=(IPFunctional const &)
fem::Q1Element2 m_element
virtual void gradientAt(IMVecType &x, IMVecType &gradient)=0
Computes the gradient of the functional at the vector x.
fem::ElementIterator m_element_index
std::shared_ptr< const Grid > m_grid
Abstract base class for functions from ice model vectors to .
virtual void dot(IMVecType &a, IMVecType &b, double *OUTPUT)=0
Computes the inner product .
virtual void interior_product(IMVecType &x, IMVecType &y)
Computes the interior product of a vector with the IPInnerProductFunctional's underlying bilinear for...
IPInnerProductFunctional(std::shared_ptr< const Grid > grid)
Abstract base class for IPFunctionals arising from an inner product.
void gradientFD(IPFunctional< array::Scalar > &f, array::Scalar &x, array::Scalar &gradient)
Computes finite difference approximations of a IPFunctional<array::Scalar> gradient.