From: Wolfgang Bangerth Date: Mon, 13 May 2024 21:38:02 +0000 (-0600) Subject: Remove Quadrature(unsigned int) from the public interface. X-Git-Tag: v9.6.0-rc1~220^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eb6140d3a60d1b93dd6c62e11c174a992155ad7;p=dealii.git Remove Quadrature(unsigned int) from the public interface. --- diff --git a/include/deal.II/base/quadrature.h b/include/deal.II/base/quadrature.h index d71f739850..c680be4c5f 100644 --- a/include/deal.II/base/quadrature.h +++ b/include/deal.II/base/quadrature.h @@ -130,14 +130,9 @@ public: using SubQuadrature = Quadrature; /** - * Constructor. - * - * This constructor is marked as explicit to avoid involuntary accidents - * like in hp::QCollection@ q_collection(3) where - * hp::QCollection@ q_collection(QGauss@(3)) was - * meant. + * Default constructor. */ - explicit Quadrature(const unsigned int n_quadrature_points = 0); + Quadrature(); /** * Build this quadrature formula as the tensor product of a formula in a @@ -336,6 +331,21 @@ public: get_tensor_basis() const; protected: + /** + * Constructor. + * + * This constructor is marked as explicit to avoid involuntary accidents + * like in hp::QCollection@ q_collection(3) where + * hp::QCollection@ q_collection(QGauss@(3)) was + * meant. Nonetheless, it is easy to accidentally write + * @code + * Quadrature quadrature(3); + * @endcode + * where QGauss was meant. As a consequence, this constructor is `protected` + * and so only available to derived classes initializing their base class. + */ + explicit Quadrature(const unsigned int n_quadrature_points); + /** * List of quadrature points. To be filled by the constructors of derived * classes. diff --git a/source/base/quadrature.cc b/source/base/quadrature.cc index 0aade1577d..d39f88611e 100644 --- a/source/base/quadrature.cc +++ b/source/base/quadrature.cc @@ -27,6 +27,11 @@ DEAL_II_NAMESPACE_OPEN #ifndef DOXYGEN +template <> +Quadrature<0>::Quadrature() + : is_tensor_product_flag(false) +{} + template <> Quadrature<0>::Quadrature(const unsigned int n_q) : quadrature_points(n_q) @@ -37,6 +42,13 @@ Quadrature<0>::Quadrature(const unsigned int n_q) +template +Quadrature::Quadrature() + : is_tensor_product_flag(dim == 1) +{} + + + template Quadrature::Quadrature(const unsigned int n_q) : quadrature_points(n_q, Point())