]> https://gitweb.dealii.org/ - dealii.git/commitdiff
allow Gauss formulae with zero points
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 17 Oct 2005 05:45:47 +0000 (05:45 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 17 Oct 2005 05:45:47 +0000 (05:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@11606 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/quadrature.cc
deal.II/base/source/quadrature_lib.cc

index 08edb028e13f2cd14c1a23339804d2f9509bdf60..7d194347d8b921f1d25ad591fdda1b757a6b9a3c 100644 (file)
@@ -140,13 +140,16 @@ Quadrature<dim>::Quadrature (const SubQuadrature &q1,
       };
 
 #ifdef DEBUG
-  double sum = 0;
-  for (unsigned int i=0; i<n_quadrature_points; ++i)
-    sum += weights[i];
-                                  // we cant guarantee the sum of weights
-                                  // to be exactly one, but it should be
-                                  // near that. 
-  Assert ((sum>0.999999) && (sum<1.000001), ExcInternalError());
+  if (n_quadrature_points > 0)
+    {
+      double sum = 0;
+      for (unsigned int i=0; i<n_quadrature_points; ++i)
+       sum += weights[i];
+                                      // we cant guarantee the sum of weights
+                                      // to be exactly one, but it should be
+                                      // near that. 
+      Assert ((sum>0.999999) && (sum<1.000001), ExcInternalError());
+    }
 #endif
 }
 
index ab876dbc648427de3b58883ab5bbef10365c7649..2e267d5c7d7bccdef03eb6077efe7b77eb8ac7fb 100644 (file)
@@ -51,6 +51,9 @@ QGauss<1>::QGauss (const unsigned int n)
                 :
                 Quadrature<1> (n)
 {
+  if (n == 0)
+    return;
+  
   const unsigned int m = (n+1)/2;
 
                                    // tolerance for the Newton

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.