]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix problem with constant polynomials
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 29 Jul 2011 22:45:15 +0000 (22:45 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 29 Jul 2011 22:45:15 +0000 (22:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@23983 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/integrators/laplace.h

index c994df38b315406126b878c5676fff555e6b67c4..27e247f3a84eb5500e6a08a325cd1e03a50c486d 100644 (file)
@@ -321,8 +321,11 @@ namespace LocalIntegrators
     {
       const unsigned int normal1 = GeometryInfo<dim>::unit_normal_direction[dinfo1.face_number];
       const unsigned int normal2 = GeometryInfo<dim>::unit_normal_direction[dinfo2.face_number];
-      double penalty1 = deg1 * (deg1+1) / dinfo1.cell->extent_in_direction(normal1);
-      double penalty2 = deg2 * (deg2+1) / dinfo2.cell->extent_in_direction(normal2);
+      const unsigned int deg1sq = (deg1 == 0) ? 1 : deg1 * (deg1+1);
+      const unsigned int deg2sq = (deg2 == 0) ? 1 : deg2 * (deg2+1);
+      
+      double penalty1 = deg1sq / dinfo1.cell->extent_in_direction(normal1);
+      double penalty2 = deg2sq / dinfo2.cell->extent_in_direction(normal2);
       if (dinfo1.cell->has_children() ^ dinfo2.cell->has_children())
        {
          Assert (dinfo1.face == dinfo2.face, ExcInternalError());

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.