From 5a8b7b671f88b40ce45ef565f540b41cf8e57735 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 11 Jul 2022 13:35:14 +0200 Subject: [PATCH] Ensure to look at square of tolerances --- source/fe/mapping_cartesian.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 1620af218e..b08f0d73a2 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -55,8 +55,11 @@ is_cartesian(const CellType &cell) if (!cell->reference_cell().is_hyper_cube()) return false; - const double abs_tol = 1e-15; - const double rel_tol = 1e-14; + // The tolerances here are somewhat larger than the square of the machine + // epsilon, because we are going to compare the square of distances (to + // avoid computing square roots). + const double abs_tol = 1e-30; + const double rel_tol = 1e-28; const auto bounding_box = cell->bounding_box(); const auto & bounding_vertices = bounding_box.get_boundary_points(); const auto bb_diagonal_length_squared = -- 2.39.5