]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix Manifold get_new_point()
authorDoug Shi-Dong <doug.shidong@gmail.com>
Thu, 26 Sep 2019 04:31:07 +0000 (00:31 -0400)
committerDoug Shi-Dong <doug.shidong@gmail.com>
Thu, 26 Sep 2019 04:31:07 +0000 (00:31 -0400)
The weights can be negative, we simply want to avoid dividing by 0.

source/grid/manifold.cc

index 3f4a1217ce6f6a1f770eff4531338e3b6cabffe0..5072c095afa02ac7a7694fda5a99acddae285948 100644 (file)
@@ -95,7 +95,7 @@ Manifold<dim, spacedim>::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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.