]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed bug in HyperBall and HalfHyperBall
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Jan 2014 14:56:35 +0000 (14:56 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Jan 2014 14:56:35 +0000 (14:56 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32157 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/tria_boundary_lib.cc

index cb32b6fe15569d8569998aa2bf14ebfbf427a5e5..61bd284c536831eb7968ce847d8908c5bf80b6f1 100644 (file)
@@ -564,7 +564,8 @@ HyperBallBoundary<dim,spacedim>::get_new_point(const std::vector<Point<spacedim>
                                               const std::vector<double> &weights) const
 {
   Point<spacedim> middle = FlatManifold<spacedim>::get_new_point(surrounding_points, weights);
-
+  middle -= center;
+  
   double r=0;
   if (compute_radius_automatically)
     {
@@ -873,23 +874,16 @@ HalfHyperBallBoundary<dim>::get_new_point(const std::vector<Point<dim> > &surrou
   // check whether every point is at distance R
   bool all_at_distance_R = true;
   for(unsigned int i=0; i<surrounding_points.size(); ++i)
-    if( (surrounding_points[i].distance(this->center)-this->radius) >1e-5)
+    if( (surrounding_points[i].distance(this->center)-this->radius) >1e-5*this->radius)
       {
        all_at_distance_R = false;
        break;
       }
   
-  const Point<dim> object_center = FlatManifold<dim>::get_new_point(surrounding_points, weights);
-  if (std::abs(object_center(0)-this->center(0)) < 1e-5  && !all_at_distance_R)
-    return object_center;
+  if (all_at_distance_R == true)
+    return HyperBallBoundary<dim>::get_new_point (surrounding_points,weights);
   else
-    if(all_at_distance_R)
-      return HyperBallBoundary<dim>::get_new_point (surrounding_points,weights);
-    else
-      {
-       Assert(false, ExcInternalError());
-       return Point<dim>();
-      }
+    return FlatManifold<dim>::get_new_point(surrounding_points, weights);
 }
 
 

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.