From: kanschat Date: Fri, 29 Jul 2011 22:45:15 +0000 (+0000) Subject: Fix problem with constant polynomials X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a63a8f182e9b87b2015d9d2561ce4584e2db922d;p=dealii-svn.git Fix problem with constant polynomials git-svn-id: https://svn.dealii.org/trunk@23983 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/integrators/laplace.h b/deal.II/include/deal.II/integrators/laplace.h index c994df38b3..27e247f3a8 100644 --- a/deal.II/include/deal.II/integrators/laplace.h +++ b/deal.II/include/deal.II/integrators/laplace.h @@ -321,8 +321,11 @@ namespace LocalIntegrators { const unsigned int normal1 = GeometryInfo::unit_normal_direction[dinfo1.face_number]; const unsigned int normal2 = GeometryInfo::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());