]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use relative error rather than absolute error for checking for an internal error.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Jul 2001 09:38:49 +0000 (09:38 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 18 Jul 2001 09:38:49 +0000 (09:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@4845 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria_boundary_lib.cc

index cadbfc8baddc9ba8e5e7cbc1a5b234f6cf929d87..5431ac6058c4aa27cf1289901915331abf093752 100644 (file)
@@ -133,7 +133,7 @@ HyperBallBoundary<dim>::get_intermediate_points_between_points (
                   v1=p1-center;
   const double length=std::sqrt((v1-v0).square());
   
-  double eps=1e-14;
+  double eps=1e-12;
   double r=0;
   if (compute_radius_automatically)
     {
@@ -143,8 +143,10 @@ HyperBallBoundary<dim>::get_intermediate_points_between_points (
   else
     r=radius;
 
-  Assert(std::fabs(v0.square()-r*r)<eps, ExcInternalError());
-  Assert(std::fabs(v1.square()-r*r)<eps, ExcInternalError());
+  
+  const double r2=r*r;
+  Assert(std::fabs(v0.square()-r2)<eps*r2, ExcInternalError());
+  Assert(std::fabs(v1.square()-r2)<eps*r2, ExcInternalError());
   
   const double alpha=std::acos((v0*v1)/std::sqrt(v0.square()*v1.square()));
   const double d_alpha=alpha/(n+1);

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.