24template <
int spacedim,
typename Number>
27 const double tolerance)
const
29 for (
unsigned int i = 0; i < spacedim; ++i)
35 this->boundary_points.first[i] - tolerance * side_length(i)) ||
36 (p[i] > this->boundary_points.second[i] + tolerance * side_length(i)))
44template <
int spacedim,
typename Number>
49 for (
unsigned int i = 0; i < spacedim; ++i)
51 this->boundary_points.first[i] =
52 std::min(this->boundary_points.first[i],
54 this->boundary_points.second[i] =
55 std::max(this->boundary_points.second[i],
60template <
int spacedim,
typename Number>
64 const double tolerance)
const
66 for (
unsigned int i = 0; i < spacedim; ++i)
70 this->boundary_points.first[i] - tolerance * side_length(i)) ||
72 this->boundary_points.second[i] + tolerance * side_length(i)))
78template <
int spacedim,
typename Number>
82 const double tolerance)
const
95 const std::array<Point<spacedim, Number>, 2>
bbox1 = {
96 {this->get_boundary_points().first,
97 this->get_boundary_points().second}};
98 const std::array<Point<spacedim, Number>, 2>
bbox2 = {
106 for (
unsigned int d = 0; d < spacedim; ++d)
114 for (
unsigned int d = 0; d < spacedim; ++d)
127 for (
unsigned int d = 0; d < spacedim; ++d)
146 if ((this->point_inside(
bbox2[0]) && this->point_inside(
bbox2[1])) ||
158template <
int spacedim,
typename Number>
163 for (
unsigned int i = 0; i < spacedim; ++i)
164 vol *= (this->boundary_points.second[i] -
this->boundary_points.first[i]);
170template <
int spacedim,
typename Number>
176 return boundary_points.first[direction];
181template <
int spacedim,
typename Number>
187 return boundary_points.second[direction];
192template <
int spacedim,
typename Number>
197 for (
unsigned int i = 0; i < spacedim; ++i)
198 point[i] = .5 * (boundary_points.first[i] + boundary_points.second[i]);
205template <
int spacedim,
typename Number>
220template <
int spacedim,
typename Number>
226 return boundary_points.second[direction] - boundary_points.first[direction];
231template <
int spacedim,
typename Number>
241 for (
unsigned int i = 0; i < spacedim; ++i)
242 point[i] = boundary_points.first[i] + side_length(i) * unit_cell_vertex[i];
249template <
int spacedim,
typename Number>
268 for (
unsigned int i = 0; i < spacedim; ++i)
285template <
int spacedim,
typename Number>
291 std::pair<
Point<spacedim - 1, Number>,
Point<spacedim - 1, Number>>
293 for (
unsigned int d = 0; d < spacedim - 1; ++d)
296 internal::coordinate_to_one_dim_higher<spacedim - 1>(direction, d);
310template <
int spacedim,
typename Number>
316 const auto diag = boundary_points.second - boundary_points.first;
317 unit -= boundary_points.first;
318 for (
unsigned int d = 0; d < spacedim; ++d)
325template <
int spacedim,
typename Number>
330 auto real = boundary_points.first;
331 const auto diag = boundary_points.second - boundary_points.first;
332 for (
unsigned int d = 0; d < spacedim; ++d)
339template <
int spacedim,
typename Number>
343 const unsigned int direction)
const
345 const Number
p1 = lower_bound(direction);
346 const Number
p2 = upper_bound(direction);
348 if (point[direction] >
p2)
349 return point[direction] -
p2;
350 else if (point[direction] <
p1)
351 return p1 - point[direction];
353 return -
std::min(point[direction] -
p1,
p2 - point[direction]);
358template <
int spacedim,
typename Number>
365 for (
unsigned int d = 0; d < spacedim; ++d)
366 distances[d] = signed_distance(point, d);
387 [](
const auto &a,
const auto &b) {
388 return a + (b > 0 ? b * b : 0.0);
394template <
int dim,
typename Number>
399 for (
unsigned int i = 0; i < dim; ++i)
407#include "bounding_box.inst"
BoundingBox< dim, Number > create_unit_bounding_box()
BoundingBox< 1, Number > bounds(const unsigned int direction) const
bool has_overlap_with(const BoundingBox< spacedim, Number > &other_bbox, const double tolerance=std::numeric_limits< Number >::epsilon()) const
Point< spacedim, Number > center() const
Number lower_bound(const unsigned int direction) const
Number signed_distance(const Point< spacedim, Number > &point, const unsigned int direction) const
void merge_with(const BoundingBox< spacedim, Number > &other_bbox)
bool point_inside(const Point< spacedim, Number > &p, const double tolerance=std::numeric_limits< Number >::epsilon()) const
Point< spacedim, Number > real_to_unit(const Point< spacedim, Number > &point) const
Number side_length(const unsigned int direction) const
BoundingBox< spacedim, Number > child(const unsigned int index) const
NeighborType get_neighbor_type(const BoundingBox< spacedim, Number > &other_bbox, const double tolerance=std::numeric_limits< Number >::epsilon()) const
Point< spacedim, Number > vertex(const unsigned int index) const
BoundingBox< spacedim - 1, Number > cross_section(const unsigned int direction) const
Number upper_bound(const unsigned int direction) const
Point< spacedim, Number > unit_to_real(const Point< spacedim, Number > &point) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertIndexRange(index, range)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
static Point< dim > unit_cell_vertex(const unsigned int vertex)