From: Simon Sticko Date: Fri, 28 May 2021 16:00:42 +0000 (+0200) Subject: A better assert in FE_Q_Base::get_subface_interpolation_matrix X-Git-Tag: v9.4.0-rc1~1301^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12360%2Fhead;p=dealii.git A better assert in FE_Q_Base::get_subface_interpolation_matrix The previous assert checked that the element derived from FE_Q_Base or FE_SimplexPoly. This isn't right for FE_Bernstein, which derives from FE_Q_Base, but doesn't have support points. Instead of throwing ExcInterpolationNotImplemented, using FE_Bernstein resulted in an exception which was hard to understand. Change the assert so that it checks if the incoming element has support points on the face and has the right number of components. --- diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index aed1067735..10ceee4f0a 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -632,10 +632,10 @@ FE_Q_Base::get_subface_interpolation_matrix( ExcDimensionMismatch(interpolation_matrix.m(), source_fe.n_dofs_per_face(face_no))); - // see if source is a Q or P element - if ((dynamic_cast *>(&source_fe) != nullptr) || - (dynamic_cast *>(&source_fe) != - nullptr)) + Assert(source_fe.n_components() == this->n_components(), + ExcDimensionMismatch(source_fe.n_components(), this->n_components())); + + if (source_fe.has_face_support_points(face_no)) { // have this test in here since a table of size 2x0 reports its size as // 0x0