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)
{
// 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);
}