From 14e19c6202cd88a8ce5a8c27522a4bd42b87fddd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 18 Mar 2015 18:40:07 -0500 Subject: [PATCH] Improve error messages. In this context also note that the documentation was at odds with the actual implementation. --- include/deal.II/base/quadrature_selector.h | 19 +++++++++++-------- source/base/quadrature_selector.cc | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/deal.II/base/quadrature_selector.h b/include/deal.II/base/quadrature_selector.h index 2b7b5fa1c2..40a491609a 100644 --- a/include/deal.II/base/quadrature_selector.h +++ b/include/deal.II/base/quadrature_selector.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2003 - 2014 by the deal.II authors +// Copyright (C) 2003 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -42,8 +42,8 @@ class QuadratureSelector : public Quadrature public: /** * Constructor. Takes the name of the quadrature rule (one of "gauss", - * "milne", "weddle", etc) and, if it iss "gauss", the order of the - * quadrature rule as argument. + * "milne", "weddle", etc) and, if it is "gauss", the number of quadrature + * points in each coordinate direction. */ QuadratureSelector (const std::string &s, const unsigned int order=0); @@ -66,8 +66,11 @@ public: */ DeclException1 (ExcInvalidQGaussOrder, int, - << "You tried to generate QGauss with an invalid order of " - << arg1 << " (must be >= 2)"); + << "You tried to generate a QGauss object with an invalid " + << "number " << arg1 + << " of quadrature points in each coordinate " + << "direction. This number must be greater than or equal " + << "to 1."); /** * Exception */ @@ -75,15 +78,15 @@ public: std::string, unsigned int, << "You tried to generate a " << arg1 - << " object; no order is needed (" << arg2 - << " was given as parameter)"); + << " object; no order is needed for objects of this kind, but " + << arg2 << " was given as argument."); /** * Exception */ DeclException1 (ExcInvalidQuadrature, std::string, << arg1 - << " is not a valid quadrature name for a quadrature rule"); + << " is not a valid name for a quadrature rule."); //@} private: /** diff --git a/source/base/quadrature_selector.cc b/source/base/quadrature_selector.cc index 9006b9d92a..f503556ad4 100644 --- a/source/base/quadrature_selector.cc +++ b/source/base/quadrature_selector.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2003 - 2014 by the deal.II authors +// Copyright (C) 2003 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -27,7 +27,7 @@ create_quadrature (const std::string &s, { if (s == "gauss") { - AssertThrow(order >= 2, ExcInvalidQGaussOrder(order)); + AssertThrow(order >= 1, ExcInvalidQGaussOrder(order)); return QGauss(order); } else -- 2.39.5