]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check the number of nodes in FE_DGQArbitraryNodes. 2355/head
authorDavid Wells <wellsd2@rpi.edu>
Tue, 15 Mar 2016 20:07:39 +0000 (16:07 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Tue, 15 Mar 2016 20:20:39 +0000 (16:20 -0400)
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

index 7fac222d666dd25798e3c1e50ca8cd09c588960d..e8206eefd77bdfa7966428532dc0c6485e885e7f 100644 (file)
@@ -17,6 +17,7 @@
 #include <deal.II/base/quadrature.h>
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/template_constraints.h>
+#include <deal.II/fe/fe.h>
 #include <deal.II/fe/fe_dgq.h>
 #include <deal.II/fe/fe_tools.h>
 
@@ -200,6 +201,8 @@ FE_DGQ<dim, spacedim>::FE_DGQ (const Quadrature<1> &points)
   // are the tensor product of the
   // Lagrange interpolation points in
   // the constructor.
+  Assert (points.size() > 0,
+          (typename FiniteElement<dim, spacedim>::ExcFEHasNoSupportPoints ()));
   Quadrature<dim> support_quadrature(points);
   this->unit_support_points = support_quadrature.get_points();
 

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.