From 3c2f681d329710178222702cb89cd2057762abc8 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Tue, 31 Oct 2017 11:41:13 -0600 Subject: [PATCH] Fix spherical manifold at origin --- source/grid/manifold_lib.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.39.5