]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove Quadrature(unsigned int) from the public interface.
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 13 May 2024 21:38:02 +0000 (15:38 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 23 May 2024 16:38:48 +0000 (10:38 -0600)
include/deal.II/base/quadrature.h
source/base/quadrature.cc

index d71f739850ff12ea61cff9903524131994fb832d..c680be4c5ff5d4e4fb72da35dd6e48a1d3b728d4 100644 (file)
@@ -130,14 +130,9 @@ public:
   using SubQuadrature = Quadrature<dim == 0 ? 0 : dim - 1>;
 
   /**
-   * Constructor.
-   *
-   * This constructor is marked as explicit to avoid involuntary accidents
-   * like in <code>hp::QCollection@<dim@> q_collection(3)</code> where
-   * <code>hp::QCollection@<dim@> q_collection(QGauss@<dim@>(3))</code> 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 <code>hp::QCollection@<dim@> q_collection(3)</code> where
+   * <code>hp::QCollection@<dim@> q_collection(QGauss@<dim@>(3))</code> was
+   * meant. Nonetheless, it is easy to accidentally write
+   * @code
+   *   Quadrature<dim> 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.
index 0aade1577def7eb9caa5f91c1f4bb5f1ca430d17..d39f88611e7a3804b8694cc15659d98dda6d40c3 100644 (file)
@@ -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 <int dim>
+Quadrature<dim>::Quadrature()
+  : is_tensor_product_flag(dim == 1)
+{}
+
+
+
 template <int dim>
 Quadrature<dim>::Quadrature(const unsigned int n_q)
   : quadrature_points(n_q, Point<dim>())

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.