From: hartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Wed, 18 Jul 2001 09:38:49 +0000 (+0000)
Subject: Use relative error rather than absolute error for checking for an internal error.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a812c9aad5c5707eaa6157a0327690782451c1e;p=dealii-svn.git

Use relative error rather than absolute error for checking for an internal error.


git-svn-id: https://svn.dealii.org/trunk@4845 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/deal.II/source/grid/tria_boundary_lib.cc
index cadbfc8bad..5431ac6058 100644
--- a/deal.II/deal.II/source/grid/tria_boundary_lib.cc
+++ b/deal.II/deal.II/source/grid/tria_boundary_lib.cc
@@ -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);