From b0e61533907e7bd35125e14cdb123ae4b95e7e08 Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 15 Mar 2016 16:07:39 -0400 Subject: [PATCH] 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. --- source/fe/fe_dgq.cc | 3 +++ 1 file changed, 3 insertions(+) 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(); -- 2.39.5