From: Rene Gassmoeller Date: Wed, 15 Nov 2017 21:10:51 +0000 (-0700) Subject: Fix search for a vertex location X-Git-Tag: v9.0.0-rc1~771^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5472%2Fhead;p=dealii.git Fix search for a vertex location --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 4531701324..72f3f61284 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -1623,7 +1623,10 @@ next_cell: vertex_to_point = p - mesh.get_vertices()[closest_vertex_index]; } - vertex_to_point /= vertex_to_point.norm(); + const double vertex_point_norm = vertex_to_point.norm(); + if (vertex_point_norm > 0) + vertex_to_point /= vertex_point_norm; + const unsigned int n_neighbor_cells = vertex_to_cells[closest_vertex_index].size(); // Create a corresponding map of vectors from vertex to cell center