From: Martin Kronbichler Date: Mon, 11 Jul 2022 11:35:14 +0000 (+0200) Subject: Ensure to look at square of tolerances X-Git-Tag: v9.5.0-rc1~1088^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a8b7b671f88b40ce45ef565f540b41cf8e57735;p=dealii.git Ensure to look at square of tolerances --- 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 =