]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Define Quadrature<0>::SubQuadrature as Quadrature<0> 13600/head
authorSimon Sticko <simon@sticko.se>
Thu, 7 Apr 2022 07:11:58 +0000 (09:11 +0200)
committerSimon Sticko <simon@sticko.se>
Thu, 7 Apr 2022 08:28:11 +0000 (10:28 +0200)
Before this, the SubQuadrature of Quadrature<0> was defined as
Quadrature<-1>. This can lead to problems with some compilers because
Quadrature<-1> should never be instantiated. Avoid this by redefining
SubQuadrature of Quadrature<0>.

include/deal.II/base/quadrature.h

index 475229341dcfb7db3b822b57f4e88b8d32089562..effb96ad2fd71ed70f3c198cfaae38ca2c0b9161 100644 (file)
@@ -88,9 +88,10 @@ class Quadrature : public Subscriptor
 public:
   /**
    * Define an alias for a quadrature that acts on an object of one dimension
-   * less. For cells, this would then be a face quadrature.
+   * less. For cells, this would then be a face quadrature. A sub quadrature of
+   * a 0-dimensional quadrature is defined as still being 0-dimensional.
    */
-  using SubQuadrature = Quadrature<dim - 1>;
+  using SubQuadrature = Quadrature<dim == 0 ? 0 : dim - 1>;
 
   /**
    * Constructor.
@@ -483,7 +484,8 @@ Quadrature<dim>::serialize(Archive &ar, const unsigned int)
 template <>
 Quadrature<0>::Quadrature(const unsigned int);
 template <>
-Quadrature<0>::Quadrature(const Quadrature<-1> &, const Quadrature<1> &);
+Quadrature<0>::Quadrature(const Quadrature<0>::SubQuadrature &,
+                          const Quadrature<1> &);
 template <>
 Quadrature<0>::Quadrature(const Quadrature<1> &);
 template <>

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.