From c879af78431728c88b5225411c8705ffd80b1cf6 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 13 Apr 2012 07:51:20 +0000 Subject: [PATCH] Throw an exception if someone initializes an FEValues object with a quadrature formula that has no quadrature points. This can happen, more by accident, if one uses fe.unit_support_points as quadrature points and happens to try to do that with a non-interpolating element such as FE_DGP. If one later accesses fe_values.shape_value(i,q) for q=0...dofs_per_cell the resulting error message is completely unintelligible (it complains about an out-of-bounds access to some strange table). Better catch these sorts of cases up front. git-svn-id: https://svn.dealii.org/trunk@25408 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/fe/fe_values.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deal.II/source/fe/fe_values.cc b/deal.II/source/fe/fe_values.cc index 0dafb49d89..a839d72159 100644 --- a/deal.II/source/fe/fe_values.cc +++ b/deal.II/source/fe/fe_values.cc @@ -1790,6 +1790,10 @@ FEValuesBase::FEValuesBase (const unsigned int n_q_points, fe_data(0, typeid(*this).name()), fe_values_views_cache (*this) { + Assert (n_q_points > 0, + ExcMessage ("There is nothing useful you can do with an FEValues " + "object when using a quadrature formula with zero " + "quadrature points!")); this->update_flags = flags; } -- 2.39.5