* Return true if the point is inside the Bounding Box, false otherwise.
*/
bool
- point_inside(const Point<spacedim, Number> &p) const;
+ point_inside(
+ const Point<spacedim, Number> &p,
+ const double tolerance = std::numeric_limits<Number>::epsilon()) const;
/**
* Increase (or decrease) the size of the bounding box by the given amount.
template <int spacedim, typename Number>
bool
-BoundingBox<spacedim, Number>::point_inside(
- const Point<spacedim, Number> &p) const
+BoundingBox<spacedim, Number>::point_inside(const Point<spacedim, Number> &p,
+ const double tolerance) const
{
for (unsigned int i = 0; i < spacedim; ++i)
{
// Bottom left-top right convention: the point is outside if it's smaller
// than the first or bigger than the second boundary point The bounding
// box is defined as a closed set
- if (std::numeric_limits<Number>::epsilon() *
- (std::abs(this->boundary_points.first[i] + p[i])) <
+ if (tolerance * std::abs(this->boundary_points.first[i] + p[i]) <
this->boundary_points.first[i] - p[i] ||
- std::numeric_limits<Number>::epsilon() *
- (std::abs(this->boundary_points.second[i] + p[i])) <
+ tolerance * std::abs(this->boundary_points.second[i] + p[i]) <
p[i] - this->boundary_points.second[i])
return false;
}