From: Daniel Arndt Date: Thu, 21 May 2020 16:26:11 +0000 (-0400) Subject: Introduce get_poly_space() X-Git-Tag: v9.3.0-rc1~1594^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a339afcd30fee438c175aa4f2a3b9d28a1a445b7;p=dealii.git Introduce get_poly_space() --- diff --git a/include/deal.II/fe/fe_poly.h b/include/deal.II/fe/fe_poly.h index cfa174d72d..e928e7b89e 100644 --- a/include/deal.II/fe/fe_poly.h +++ b/include/deal.II/fe/fe_poly.h @@ -99,6 +99,12 @@ public: virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override; + /** + * Return the underlying polynomial space. + */ + const ScalarPolynomialsBase & + get_poly_space() const; + /** * Return the numbering of the underlying polynomial space compared to * lexicographic ordering of the basis functions. Returns diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index 214358f252..fea8899e25 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -564,6 +564,15 @@ FE_Poly::correct_third_derivatives( +template +inline const ScalarPolynomialsBase & +FE_Poly::get_poly_space() const +{ + return *poly_space; +} + + + template std::vector FE_Poly::get_poly_space_numbering() const diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 5827480fba..792daad6f9 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -556,9 +556,18 @@ MatrixFree::is_supported( // then check of the base element is supported if (dynamic_cast *>(fe_ptr) != nullptr) - return true; - if (dynamic_cast *>(fe_ptr) != nullptr) - return true; + { + const FE_Poly *fe_poly_ptr = + dynamic_cast *>(fe_ptr); + if (dynamic_cast *>( + &fe_poly_ptr->get_poly_space()) != nullptr) + return true; + if (dynamic_cast> *>( + &fe_poly_ptr->get_poly_space()) != nullptr) + return true; + } if (dynamic_cast *>(fe_ptr) != nullptr) return true; if (dynamic_cast *>(fe_ptr) != nullptr) diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index 4749787ebf..d85ad9150d 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -139,19 +139,19 @@ namespace internal const FE_Poly *fe_poly = dynamic_cast *>(fe); - const FE_Poly *fe_poly_piece = - dynamic_cast *>(fe); - const FE_DGP *fe_dgp = dynamic_cast *>(fe); const FE_Q_DG0 *fe_q_dg0 = dynamic_cast *>(fe); element_type = tensor_general; - if (fe_poly != nullptr) + if (fe_poly != nullptr && + (dynamic_cast *>( + &fe_poly->get_poly_space()) != nullptr || + dynamic_cast> *>( + &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);