From: Rene Gassmoeller Date: Tue, 31 Oct 2017 17:41:13 +0000 (-0600) Subject: Fix spherical manifold at origin X-Git-Tag: v9.0.0-rc1~841^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c2f681d329710178222702cb89cd2057762abc8;p=dealii.git Fix spherical manifold at origin --- diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 74d8a5023d..1fccfef375 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -291,7 +291,12 @@ get_new_point (const ArrayView> &vertices, } // Unit norm direction. - candidate /= candidate.norm(); + const double norm = candidate.norm(); + + if (norm == 0) + return center; + + candidate /= norm; return center+rho*candidate; }