From: grahambenharper Date: Mon, 16 Sep 2019 23:07:02 +0000 (-0600) Subject: Change TensorProductPolynomialsConst to derive from ScalarPolynomialsBase X-Git-Tag: v9.2.0-rc1~1099^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6aeb311e5e36686539d2d6ccce4288a9c1b6930;p=dealii.git Change TensorProductPolynomialsConst to derive from ScalarPolynomialsBase --- diff --git a/include/deal.II/base/tensor_product_polynomials_bubbles.h b/include/deal.II/base/tensor_product_polynomials_bubbles.h index 876a926ed1..d44cc2d7f2 100644 --- a/include/deal.II/base/tensor_product_polynomials_bubbles.h +++ b/include/deal.II/base/tensor_product_polynomials_bubbles.h @@ -178,7 +178,8 @@ public: n() const; /** - * Return the name of the space, which is TensorProductPolynomialsBubbles. + * Return the name of the space, which is + * TensorProductPolynomialsBubbles. */ std::string name() const override; diff --git a/include/deal.II/base/tensor_product_polynomials_const.h b/include/deal.II/base/tensor_product_polynomials_const.h index 0f8cb93d0c..57d2e62aa0 100644 --- a/include/deal.II/base/tensor_product_polynomials_const.h +++ b/include/deal.II/base/tensor_product_polynomials_const.h @@ -45,7 +45,7 @@ DEAL_II_NAMESPACE_OPEN * @author Timo Heister, 2012 */ template -class TensorProductPolynomialsConst +class TensorProductPolynomialsConst : public ScalarPolynomialsBase { public: /** @@ -178,6 +178,19 @@ public: unsigned int n() const; + /** + * Return the name of the space, which is + * TensorProductPolynomialsConst. + */ + std::string + name() const override; + + /** + * @copydoc ScalarPolynomialsBase::clone() + */ + virtual std::unique_ptr> + clone() const override; + private: /** * The TensorProductPolynomials object @@ -206,7 +219,8 @@ template template inline TensorProductPolynomialsConst::TensorProductPolynomialsConst( const std::vector &pols) - : tensor_polys(pols) + : ScalarPolynomialsBase(1, Utilities::fixed_power(pols.size()) + 1) + , tensor_polys(pols) , index_map(tensor_polys.n() + 1) , index_map_inverse(tensor_polys.n() + 1) {} diff --git a/source/base/tensor_product_polynomials_const.cc b/source/base/tensor_product_polynomials_const.cc index c9b988073d..80efe0e013 100644 --- a/source/base/tensor_product_polynomials_const.cc +++ b/source/base/tensor_product_polynomials_const.cc @@ -15,6 +15,7 @@ #include +#include #include DEAL_II_NAMESPACE_OPEN @@ -197,6 +198,15 @@ TensorProductPolynomialsConst::evaluate( } + +template +std::unique_ptr> +TensorProductPolynomialsConst::clone() const +{ + return std_cxx14::make_unique>(*this); +} + + /* ------------------- explicit instantiations -------------- */ template class TensorProductPolynomialsConst<1>; template class TensorProductPolynomialsConst<2>;