]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test grid/closest_point: guard against roundoff error 16812/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 29 Mar 2024 00:15:40 +0000 (19:15 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 29 Mar 2024 00:15:40 +0000 (19:15 -0500)
tests/grid/closest_point.cc

index 9ab7ad648a90c8204613bae313097486ee020a8b..0413c08509391d18f5fd53d157a56b8abe503eea 100644 (file)
@@ -24,7 +24,8 @@ test(const ReferenceCell &reference_cell,
   for (const unsigned int vertex_no : reference_cell.vertex_indices())
     AssertThrow(distance_square <=
                   p.distance_square(
-                    reference_cell.template vertex<dim>(vertex_no)),
+                    reference_cell.template vertex<dim>(vertex_no)) *
+                    (1. + 2. * std::numeric_limits<double>::epsilon()),
                 ExcInternalError());
 
   // Also generate a lot of points in the unit cell - we should be closer than

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.