]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change TensorProductPolynomialsConst to derive from ScalarPolynomialsBase
authorgrahambenharper <grahambenharper@gmail.com>
Mon, 16 Sep 2019 23:07:02 +0000 (17:07 -0600)
committergrahambenharper <grahambenharper@gmail.com>
Tue, 17 Sep 2019 00:34:51 +0000 (18:34 -0600)
include/deal.II/base/tensor_product_polynomials_bubbles.h
include/deal.II/base/tensor_product_polynomials_const.h
source/base/tensor_product_polynomials_const.cc

index 876a926ed178462126ce04fd027c653598dd91f9..d44cc2d7f2dcee16a2adf5cf644277d6871bc7b6 100644 (file)
@@ -178,7 +178,8 @@ public:
   n() const;
 
   /**
-   * Return the name of the space, which is <tt>TensorProductPolynomialsBubbles</tt>.
+   * Return the name of the space, which is
+   * <tt>TensorProductPolynomialsBubbles</tt>.
    */
   std::string
   name() const override;
index 0f8cb93d0c302c8447e88e5b8e4779715e8c8930..57d2e62aa09e19623f0bf7916a8712899c9a46b7 100644 (file)
@@ -45,7 +45,7 @@ DEAL_II_NAMESPACE_OPEN
  * @author Timo Heister, 2012
  */
 template <int dim>
-class TensorProductPolynomialsConst
+class TensorProductPolynomialsConst : public ScalarPolynomialsBase<dim>
 {
 public:
   /**
@@ -178,6 +178,19 @@ public:
   unsigned int
   n() const;
 
+  /**
+   * Return the name of the space, which is
+   * <tt>TensorProductPolynomialsConst</tt>.
+   */
+  std::string
+  name() const override;
+
+  /**
+   * @copydoc ScalarPolynomialsBase<dim>::clone()
+   */
+  virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
+  clone() const override;
+
 private:
   /**
    * The TensorProductPolynomials object
@@ -206,7 +219,8 @@ template <int dim>
 template <class Pol>
 inline TensorProductPolynomialsConst<dim>::TensorProductPolynomialsConst(
   const std::vector<Pol> &pols)
-  : tensor_polys(pols)
+  : ScalarPolynomialsBase<dim>(1, Utilities::fixed_power<dim>(pols.size()) + 1)
+  , tensor_polys(pols)
   , index_map(tensor_polys.n() + 1)
   , index_map_inverse(tensor_polys.n() + 1)
 {}
index c9b988073d4b74ff5fb6ce768afb886de57b8ad8..80efe0e01380853259c4fe271f963a493718cba0 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <deal.II/base/exceptions.h>
+#include <deal.II/base/std_cxx14/memory.h>
 #include <deal.II/base/tensor_product_polynomials_const.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -197,6 +198,15 @@ TensorProductPolynomialsConst<dim>::evaluate(
 }
 
 
+
+template <int dim>
+std::unique_ptr<ScalarPolynomialsBase<dim>>
+TensorProductPolynomialsConst<dim>::clone() const
+{
+  return std_cxx14::make_unique<TensorProductPolynomialsConst<dim>>(*this);
+}
+
+
 /* ------------------- explicit instantiations -------------- */
 template class TensorProductPolynomialsConst<1>;
 template class TensorProductPolynomialsConst<2>;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.