]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ensure to look at square of tolerances 14126/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 11 Jul 2022 11:35:14 +0000 (13:35 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 11 Jul 2022 11:35:14 +0000 (13:35 +0200)
source/fe/mapping_cartesian.cc

index 1620af218e764134620ecfa4586770d2f8d9af73..b08f0d73a29d9b1b81e0812567fb3a3463dd986a 100644 (file)
@@ -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 =

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.