From: heltai Date: Fri, 3 Jan 2014 14:56:35 +0000 (+0000) Subject: Fixed bug in HyperBall and HalfHyperBall X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60dfb5050d9bfbfd09e9cfc79daae5a78e445fbc;p=dealii-svn.git Fixed bug in HyperBall and HalfHyperBall git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32157 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/source/grid/tria_boundary_lib.cc index cb32b6fe15..61bd284c53 100644 --- a/deal.II/source/grid/tria_boundary_lib.cc +++ b/deal.II/source/grid/tria_boundary_lib.cc @@ -564,7 +564,8 @@ HyperBallBoundary::get_new_point(const std::vector const std::vector &weights) const { Point middle = FlatManifold::get_new_point(surrounding_points, weights); - + middle -= center; + double r=0; if (compute_radius_automatically) { @@ -873,23 +874,16 @@ HalfHyperBallBoundary::get_new_point(const std::vector > &surrou // check whether every point is at distance R bool all_at_distance_R = true; for(unsigned int i=0; icenter)-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 object_center = FlatManifold::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::get_new_point (surrounding_points,weights); else - if(all_at_distance_R) - return HyperBallBoundary::get_new_point (surrounding_points,weights); - else - { - Assert(false, ExcInternalError()); - return Point(); - } + return FlatManifold::get_new_point(surrounding_points, weights); }