From: Doug Shi-Dong Date: Thu, 26 Sep 2019 04:31:07 +0000 (-0400) Subject: Fix Manifold get_new_point() X-Git-Tag: v9.2.0-rc1~1018^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97ee612693818558e9ba8a56f5442ebd3e97b2e9;p=dealii.git Fix Manifold get_new_point() The weights can be negative, we simply want to avoid dividing by 0. --- diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 3f4a1217ce..5072c095af 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -95,7 +95,7 @@ Manifold::get_new_point( for (unsigned int i = 1; i < n_points; ++i) { double weight = 0.0; - if ((weights[permutation[i]] + w) < tol) + if (std::abs(weights[permutation[i]] + w) < tol) weight = 0.0; else weight = w / (weights[permutation[i]] + w);