18 using namespace common;
19 using namespace math::Consts;
31 m_bounding_min.resize(min.size());
32 m_bounding_max.resize(max.size());
41 m_bounding_min.resize(min.size());
42 m_bounding_max.resize(max.size());
51 define(other.
min(),other.
max());
58 m_bounding_min.resize(min.size());
59 m_bounding_max.resize(max.size());
68 m_bounding_min.resize(min.size());
69 m_bounding_max.resize(max.size());
80 m_bounding_min.resize(point.size()); m_bounding_min.setConstant(
real_max());
81 m_bounding_max.resize(point.size()); m_bounding_max.setConstant(
real_min());
84 for (
Uint d=0; d<dim(); ++d)
86 m_bounding_min[d] =
std::min(m_bounding_min[d], point[d]);
87 m_bounding_max[d] =
std::max(m_bounding_max[d], point[d]);
96 if (PE::Comm::instance().is_active())
99 std::vector<Real> bounding_min(dim());
100 std::vector<Real> bounding_max(dim());
103 PE::Comm::instance().all_reduce(
PE::min(),bounding_min,bounding_min);
104 PE::Comm::instance().all_reduce(
PE::max(),bounding_max,bounding_max);
117 for (
Uint d=0; d<coordinate.size(); ++d)
119 inside = inside && (coordinate[d]>=m_bounding_min[d] && coordinate[d]<=m_bounding_max[d]);
const RealVector & min() const
minimum coordinates, defining one corner of the bounding box
void extend(const RealVector &point)
Extend BoundingBox, given a point.
void copy(const std::vector< Real > &vector, RealMatrix &realmatrix)
Copy std::vector to dynamic RealMatrix types.
const RealVector & max() const
maximum coordinates, defining one corner of the bounding box
void make_global()
Expand bounding box to encompass all processors.
Real max(const Real a, const Real b)
Maximum between two scalars.
Real min(const Real a, const Real b)
Minimum between two scalars.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
Top-level namespace for coolfluid.
Real real_max()
Returns the maximum number representable with the chosen precision.
void define(const BoundingBox &other)
Define bounding box with other bounding box.
Real real_min()
Definition of the minimum number representable with the chosen precision.
unsigned int Uint
typedef for unsigned int
Bounding box defined by minimum and maximum coordinates.
bool contains(const RealVector &coordinate) const
Check if coordinate falls inside the bounding box.