]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce get_poly_space()
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 21 May 2020 16:26:11 +0000 (12:26 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 21 May 2020 16:27:59 +0000 (12:27 -0400)
include/deal.II/fe/fe_poly.h
include/deal.II/fe/fe_poly.templates.h
include/deal.II/matrix_free/matrix_free.templates.h
include/deal.II/matrix_free/shape_info.templates.h

index cfa174d72db61762f7e6adddefc97a4da2f475c5..e928e7b89edcb80403804252653f550d3d3872f8 100644 (file)
@@ -99,6 +99,12 @@ public:
   virtual UpdateFlags
   requires_update_flags(const UpdateFlags update_flags) const override;
 
+  /**
+   * Return the underlying polynomial space.
+   */
+  const ScalarPolynomialsBase<dim> &
+  get_poly_space() const;
+
   /**
    * Return the numbering of the underlying polynomial space compared to
    * lexicographic ordering of the basis functions. Returns
index 214358f252aa2dadea41cd323bfb6260797fa40e..fea8899e25af36a1a2814e1e6e37b2baaff64bde 100644 (file)
@@ -564,6 +564,15 @@ FE_Poly<dim, spacedim>::correct_third_derivatives(
 
 
 
+template <int dim, int spacedim>
+inline const ScalarPolynomialsBase<dim> &
+FE_Poly<dim, spacedim>::get_poly_space() const
+{
+  return *poly_space;
+}
+
+
+
 template <int dim, int spacedim>
 std::vector<unsigned int>
 FE_Poly<dim, spacedim>::get_poly_space_numbering() const
index 5827480fbae4a92a97117eeb70982dc385753b6d..792daad6f971a98d3500b1dd132a129852dc3ee9 100644 (file)
@@ -556,9 +556,18 @@ MatrixFree<dim, Number, VectorizedArrayType>::is_supported(
 
   // then check of the base element is supported
   if (dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr) != nullptr)
-    return true;
-  if (dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr) != nullptr)
-    return true;
+    {
+      const FE_Poly<dim, spacedim> *fe_poly_ptr =
+        dynamic_cast<const FE_Poly<dim, spacedim> *>(fe_ptr);
+      if (dynamic_cast<const TensorProductPolynomials<dim> *>(
+            &fe_poly_ptr->get_poly_space()) != nullptr)
+        return true;
+      if (dynamic_cast<const TensorProductPolynomials<
+            dim,
+            Polynomials::PiecewisePolynomial<double>> *>(
+            &fe_poly_ptr->get_poly_space()) != nullptr)
+        return true;
+    }
   if (dynamic_cast<const FE_DGP<dim, spacedim> *>(fe_ptr) != nullptr)
     return true;
   if (dynamic_cast<const FE_Q_DG0<dim, spacedim> *>(fe_ptr) != nullptr)
index 4749787ebf1db73d70603af524b42935eb0373df..d85ad9150decb463fe95a7be7f861637b5f070e5 100644 (file)
@@ -139,19 +139,19 @@ namespace internal
         const FE_Poly<dim, dim> *fe_poly =
           dynamic_cast<const FE_Poly<dim, dim> *>(fe);
 
-        const FE_Poly<dim, dim> *fe_poly_piece =
-          dynamic_cast<const FE_Poly<dim, dim> *>(fe);
-
         const FE_DGP<dim> *fe_dgp = dynamic_cast<const FE_DGP<dim> *>(fe);
 
         const FE_Q_DG0<dim> *fe_q_dg0 = dynamic_cast<const FE_Q_DG0<dim> *>(fe);
 
         element_type = tensor_general;
-        if (fe_poly != nullptr)
+        if (fe_poly != nullptr &&
+            (dynamic_cast<const TensorProductPolynomials<dim> *>(
+               &fe_poly->get_poly_space()) != nullptr ||
+             dynamic_cast<const TensorProductPolynomials<
+                 dim,
+                 Polynomials::PiecewisePolynomial<double>> *>(
+               &fe_poly->get_poly_space()) != nullptr))
           scalar_lexicographic = fe_poly->get_poly_space_numbering_inverse();
-        else if (fe_poly_piece != nullptr)
-          scalar_lexicographic =
-            fe_poly_piece->get_poly_space_numbering_inverse();
         else if (fe_dgp != nullptr)
           {
             scalar_lexicographic.resize(fe_dgp->dofs_per_cell);

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.