From: David Wells Date: Sun, 28 Aug 2016 18:38:55 +0000 (-0400) Subject: Fix get_intermediate_point in 1D. X-Git-Tag: v8.5.0-rc1~726^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5d01559bdaab1d8a47fa379f513fd29ab0db174;p=dealii.git Fix get_intermediate_point in 1D. Since geometrical entities with spacedim == 1 are line segments, we should just do a linear combination to find the intermediate point (there is no need for angle calculations). --- diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 69ace8735f..0b0fd94ae0 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -185,6 +185,11 @@ get_intermediate_point (const Point &p1, else if (w > 1.0 - tol) return p2; + // If the points are one dimensional then there is no need for anything but + // a linear combination. + if (spacedim == 1) + return Point(w*p2 + (1-w)*p1); + const Tensor<1,spacedim> v1 = p1 - center; const Tensor<1,spacedim> v2 = p2 - center; const double r1 = v1.norm();