From a5d01559bdaab1d8a47fa379f513fd29ab0db174 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 28 Aug 2016 14:38:55 -0400 Subject: [PATCH] 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). --- source/grid/manifold_lib.cc | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- 2.39.5