]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make a couple of tolerances relative to the size of the object. 913/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 7 May 2015 16:47:54 +0000 (11:47 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 7 May 2015 16:47:54 +0000 (11:47 -0500)
source/grid/grid_generator.cc

index 2c16bbd2dc68190187d489301ae75bfce7bdebb5..fa7fe4c3ce92ffafba1fdc7e747ad27924512466 100644 (file)
@@ -2056,7 +2056,7 @@ namespace GridGenerator
               continue;
 
             // If x is zero, then this is part of the plane
-            if (cell->face(i)->center()(0) < p(0)+1.e-5)
+            if (cell->face(i)->center()(0) < p(0)+1.e-5 * radius)
               cell->face(i)->set_boundary_id(1);
           }
         ++cell;
@@ -3112,7 +3112,7 @@ namespace GridGenerator
                   = cell->face(i);
 
                 const Point<3> face_center (face->center());
-                if (std::abs(face_center(0)-center(0)) > 1.e-6)
+                if (std::abs(face_center(0)-center(0)) > 1.e-6 * face_center.norm())
                   {
                     if (std::abs((face_center-center).norm()-inner_radius) <
                         std::abs((face_center-center).norm()-outer_radius))

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.