From: David Wells Date: Tue, 15 Mar 2016 20:07:39 +0000 (-0400) Subject: Check the number of nodes in FE_DGQArbitraryNodes. X-Git-Tag: v8.5.0-rc1~1216^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2355%2Fhead;p=dealii.git Check the number of nodes in FE_DGQArbitraryNodes. Currently, one can create an FE_DGQArbitraryNodes instance from a quadrature rule with zero points, which causes segmentation faults (even in debug mode) when one tries to use the element. This assertion verifies that this cannot happen, at least in debug mode. --- diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index 7fac222d66..e8206eefd7 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -200,6 +201,8 @@ FE_DGQ::FE_DGQ (const Quadrature<1> &points) // are the tensor product of the // Lagrange interpolation points in // the constructor. + Assert (points.size() > 0, + (typename FiniteElement::ExcFEHasNoSupportPoints ())); Quadrature support_quadrature(points); this->unit_support_points = support_quadrature.get_points();