From: Rene Gassmoeller Date: Sun, 8 Nov 2015 06:06:47 +0000 (-0600) Subject: Fix MappingQ1 X-Git-Tag: v8.4.0-rc2~241^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1846%2Fhead;p=dealii.git Fix MappingQ1 --- diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index 9f5eec7b3d..4696483c38 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -106,8 +106,10 @@ namespace internal eta1 = -c/b; eta2 = -c/b; } - // special case #2: if c is very small: - else if (std::abs(c/b) < 1e-12) + // special case #2: if c is very small or the square root of the + // discriminant is nearly b. + else if (std::abs(c) < 1e-12*std::abs(b) + || std::abs(std::sqrt(discriminant) - b) <= 1e-14*std::abs(b)) { eta1 = (-b - std::sqrt(discriminant)) / (2*a); eta2 = (-b + std::sqrt(discriminant)) / (2*a);