From: Doug Shi-Dong Date: Thu, 26 Sep 2019 05:47:41 +0000 (-0400) Subject: Fix get_new_point optimization. X-Git-Tag: v9.2.0-rc1~1018^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cca533afcff88a8d286f9ac601272ec4f4eab5a2;p=dealii.git Fix get_new_point optimization. A performance-if ignores next point when current point weight = 0. However, since the current point weight is 0, we should be replacing the current point with the next point, not skipping the next point. --- diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 5072c095af..155d34e7f8 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -101,9 +101,15 @@ Manifold::get_new_point( weight = w / (weights[permutation[i]] + w); if (std::abs(weight) > 1e-14) - p = get_intermediate_point(p, - surrounding_points[permutation[i]], - 1.0 - weight); + { + p = get_intermediate_point(p, + surrounding_points[permutation[i]], + 1.0 - weight); + } + else + { + p = surrounding_points[permutation[i]]; + } w += weights[permutation[i]]; }