]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the conversion (tensor product) constructor of Quadrature explicit, to avoid...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 24 Feb 2006 16:41:54 +0000 (16:41 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 24 Feb 2006 16:41:54 +0000 (16:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@12495 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/quadrature.h
deal.II/base/source/quadrature.cc

index ad317fe994bc848142d8fb71871af7a6c2d0b446..513f0840536aaa5e471e63ea2d2ca42f8093f370 100644 (file)
@@ -122,13 +122,26 @@ class Quadrature : public Subscriptor
                                      * one dimension.
                                      *
                                      * Assuming that the points in
-                                     * the on-dimensional rule are in
+                                     * the one-dimensional rule are in
                                      * ascending order, the points of
                                      * the resulting rule are ordered
                                      * lexicographically with
                                      * <i>x</i> running fastest.
+                                     *
+                                     * In order to avoid a conflict
+                                     * with the copy constructor in
+                                     * 1d, we let the argument be a
+                                     * 0d quadrature formula for
+                                     * dim==1, and a 1d quadrature
+                                     * formula for all other space
+                                     * dimensions.
                                      */
-    Quadrature (const Quadrature<1> &);
+    explicit Quadrature (const Quadrature<dim != 1 ? 1 : 0> &quadrature_1d);
+
+                                     /**
+                                      * Copy constructor.
+                                      */
+    Quadrature (const Quadrature<dim> &q);
     
                                     /**
                                      * Construct a quadrature formula
@@ -330,9 +343,14 @@ Quadrature<0>::Quadrature (const Quadrature<-1> &,
                           const Quadrature<1> &);
 template <>
 Quadrature<0>::~Quadrature ();
+
 template <>
 Quadrature<1>::Quadrature (const Quadrature<0> &,
                           const Quadrature<1> &);
+
+template <>
+Quadrature<1>::Quadrature (const Quadrature<0> &);
+
 template <>
 const Point<0> & Quadrature<0>::point (const unsigned int) const;
 template <>
index 63d4e677e705ee2f0cac58bf7757603d0d2d8f33..dbc6011ccb071f5d59296d9c827076a25d190fad 100644 (file)
@@ -155,8 +155,24 @@ Quadrature<dim>::Quadrature (const SubQuadrature &q1,
 
 
 
+template <>
+Quadrature<1>::Quadrature (const Quadrature<0> &)
+               :
+               Subscriptor(),
+               n_quadrature_points (deal_II_numbers::invalid_unsigned_int),
+               quadrature_points (),
+               weights ()
+{
+                                   // this function should never be
+                                   // called -- this should be the
+                                   // copy constructor in 1d...
+  Assert (false, ExcInternalError());
+}
+
+
+
 template <int dim>
-Quadrature<dim>::Quadrature (const Quadrature<1> &q)
+Quadrature<dim>::Quadrature (const Quadrature<dim != 1 ? 1 : 0> &q)
                :
                Subscriptor(),
                n_quadrature_points (dimpow<dim>(q.n_quadrature_points)),
@@ -190,6 +206,17 @@ Quadrature<dim>::Quadrature (const Quadrature<1> &q)
 
 
 
+template <int dim>
+Quadrature<dim>::Quadrature (const Quadrature<dim> &q)
+               :
+               Subscriptor(),
+               n_quadrature_points (q.n_quadrature_points),
+               quadrature_points (q.quadrature_points),
+               weights (q.weights)
+{}
+
+
+
 template <int dim>
 Quadrature<dim>::~Quadrature ()
 {}

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.