From: Peter Munch Date: Sat, 24 Sep 2022 09:08:39 +0000 (+0200) Subject: Use FloatingPointComparator in TriangulationDescription X-Git-Tag: v9.5.0-rc1~927^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd3203aa6b22c595f830700ba66d11d93b02d5bf;p=dealii.git Use FloatingPointComparator in TriangulationDescription --- diff --git a/source/grid/tria_description.cc b/source/grid/tria_description.cc index 4de96bb503..ed35ad410d 100644 --- a/source/grid/tria_description.cc +++ b/source/grid/tria_description.cc @@ -13,6 +13,7 @@ // // --------------------------------------------------------------------- +#include #include #include #include @@ -153,20 +154,12 @@ namespace TriangulationDescription if (vertices_have_unique_ids == false) // need to compare points { - // comparator of points - const auto comp = [](const auto &a, const auto &b) { - const double tolerance = 1e-10; - - for (unsigned int i = 0; i < spacedim; ++i) - if (std::abs(a[i] - b[i]) > tolerance) - return a[i] < b[i]; - - return false; - }; - // map point to local vertex index - std::map, unsigned int, decltype(comp)> - map_point_to_local_vertex_index(comp); + std::map, + unsigned int, + FloatingPointComparator> + map_point_to_local_vertex_index( + FloatingPointComparator(1e-10)); // ... initialize map with existing points for (unsigned int i = 0; i < this->coarse_cell_vertices.size();