13#ifndef dealii_base_bounding_box_h
14#define dealii_base_bounding_box_h
23#include <Kokkos_Macros.hpp>
139template <
int spacedim,
typename Number =
double>
186 template <
class Container>
220 const double tolerance = std::numeric_limits<Number>::epsilon())
const;
228 const double tolerance = std::numeric_limits<Number>::epsilon())
const;
247 const double tolerance = std::numeric_limits<Number>::epsilon())
const;
319 bounds(
const unsigned int direction)
const;
326 vertex(
const unsigned int index)
const;
333 child(
const unsigned int index)
const;
375 const unsigned int direction)
const;
390 template <
class Archive>
403template <
typename Number>
420 template <
class Container>
430template <
int dim,
typename Number =
double>
472 const int coordinate_in_dim)
476 return (locked_coordinate + coordinate_in_dim + 1) % (dim + 1);
486template <
int spacedim,
typename Number>
494template <
int spacedim,
typename Number>
500 for (
unsigned int i = 0; i < spacedim; ++i)
501 Assert(boundary_points.first[i] <= boundary_points.second[i],
502 ExcMessage(
"Bounding Box can't be created: the points' "
503 "order should be bottom left, top right!"));
505 this->boundary_points = boundary_points;
510template <
int spacedim,
typename Number>
511template <
class Container>
516 if (points.size() > 0)
518 auto &
min = boundary_points.first;
519 auto &
max = boundary_points.second;
520 for (
unsigned int d = 0;
d < spacedim; ++
d)
522 min[
d] = std::numeric_limits<Number>::infinity();
523 max[
d] = -std::numeric_limits<Number>::infinity();
527 for (unsigned
int d = 0;
d < spacedim; ++
d)
537template <
int spacedim,
typename Number>
541 return this->boundary_points;
546template <
int spacedim,
typename Number>
550 return this->boundary_points;
555template <
int spacedim,
typename Number>
565template <
int spacedim,
typename Number>
575template <
int spacedim,
typename Number>
579 for (
unsigned int d = 0;
d < spacedim; ++
d)
581 boundary_points.first[
d] -= amount;
582 boundary_points.second[
d] += amount;
583 Assert(boundary_points.first[d] <= boundary_points.second[d],
584 ExcMessage(
"Bounding Box can't be shrunk this much: the points' "
585 "order should remain bottom left, top right."));
591template <
int spacedim,
typename Number>
604template <
int spacedim,
typename Number>
607 const Number relative_amount)
const
612 for (
unsigned int d = 0;
d < spacedim; ++
d)
615 bb.boundary_points.second[
d] += relative_amount * side_length(d);
616 Assert(bb.boundary_points.first[d] <= bb.boundary_points.second[d],
617 ExcMessage(
"Bounding Box can't be shrunk this much: the points' "
618 "order should remain bottom left, top right."));
626template <
int spacedim,
typename Number>
627template <
class Archive>
634 ar &boundary_points.first;
635 ar &boundary_points.second;
640template <
typename Number>
648template <
typename Number>
657template <
typename Number>
658template <
class Container>
* * for(const auto &cell :triangulation.active_cell_iterators())
BoundingBox< dim, Number > create_unit_bounding_box()
BoundingBox(const std::pair< Point< 0, Number >, Point< 0, Number > > &)
BoundingBox(const Container &)
int coordinate_to_one_dim_higher(const int locked_coordinate, const int coordinate_in_dim)
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > boundary_points
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
BoundingBox(const std::pair< Point< spacedim, Number >, Point< spacedim, Number > > &boundary_points)
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
bool operator==(const BoundingBox< spacedim, Number > &box) const
void serialize(Archive &ar, const unsigned int version)
void merge_with(const BoundingBox< spacedim, Number > &other_bbox)
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & get_boundary_points()
bool point_inside(const Point< spacedim, Number > &p, const double tolerance=std::numeric_limits< Number >::epsilon()) const
void extend(const Number amount)
BoundingBox< spacedim, Number > create_extended_relative(const Number relative_amount) const
BoundingBox(const Container &points)
Point< spacedim, Number > real_to_unit(const Point< spacedim, Number > &point) const
const std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & get_boundary_points() const
static constexpr unsigned int dimension
Number side_length(const unsigned int direction) const
BoundingBox< spacedim, Number > child(const unsigned int index) const
bool operator!=(const BoundingBox< spacedim, Number > &box) const
BoundingBox< spacedim, Number > & operator=(const BoundingBox< spacedim, Number > &t)=default
NeighborType get_neighbor_type(const BoundingBox< spacedim, Number > &other_bbox, const double tolerance=std::numeric_limits< Number >::epsilon()) const
BoundingBox< spacedim, Number > create_extended(const Number amount) const
Point< spacedim, Number > vertex(const unsigned int index) const
BoundingBox(const Point< spacedim, Number > &point)
BoundingBox< spacedim - 1, Number > cross_section(const unsigned int direction) const
BoundingBox(const BoundingBox< spacedim, Number > &box)=default
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 Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)