From: Wolfgang Bangerth Date: Thu, 5 Feb 2015 03:41:05 +0000 (-0600) Subject: Fix up places where we use Point for directions when we should be X-Git-Tag: v8.3.0-rc1~494^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27179f7faf86d57a2ddece079d430a00e0bc381f;p=dealii.git Fix up places where we use Point for directions when we should be using Tensor<1,dim>. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index db2e2ec8d4..87a550c93b 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -170,8 +170,8 @@ namespace GridTools std::vector::const_iterator pj = pi+1; for (unsigned int j=i+1; j max_distance_sqr)) - max_distance_sqr = (vertices[i]-vertices[j]).square(); + ((vertices[i]-vertices[j]).norm_square() > max_distance_sqr)) + max_distance_sqr = (vertices[i]-vertices[j]).norm_square(); }; return std::sqrt(max_distance_sqr); @@ -1020,14 +1020,14 @@ namespace GridTools Assert(first != used.end(), ExcInternalError()); unsigned int best_vertex = std::distance(used.begin(), first); - double best_dist = (p - vertices[best_vertex]).square(); + double best_dist = (p - vertices[best_vertex]).norm_square(); // For all remaining vertices, test // whether they are any closer for (unsigned int j = best_vertex+1; j < vertices.size(); j++) if (used[j]) { - double dist = (p - vertices[j]).square(); + double dist = (p - vertices[j]).norm_square(); if (dist < best_dist) { best_vertex = j;