1 #ifndef OMEGA_H_BBOX_HPP
2 #define OMEGA_H_BBOX_HPP
4 #include <Omega_h_affine.hpp>
5 #include <Omega_h_vector.hpp>
11 #ifdef OMEGA_H_USE_KOKKOS
15 OMEGA_H_INLINE BBox() {}
16 OMEGA_H_INLINE BBox(Vector<dim> x) : min(x), max(x) {}
17 OMEGA_H_INLINE BBox(Vector<dim> min_, Vector<dim> max_)
18 : min(min_), max(max_) {}
22 OMEGA_H_INLINE
void operator=(BBox<dim>
const& rhs) {
26 OMEGA_H_INLINE BBox(BBox<dim>
const& rhs) : min(rhs.min), max(rhs.max) {}
35 inline BBox() =
default;
38 : min(min_), max(max_) {}
41 inline BBox& operator=(
BBox const&) =
default;
42 inline BBox& operator=(
BBox&&) =
default;
50 for (Int i = 0; i < dim; ++i) {
51 c.min[i] = min2(a.min[i], b.min[i]);
52 c.max[i] = max2(a.max[i], b.max[i]);
58 OMEGA_H_INLINE
bool are_close(BBox<dim> a, BBox<dim> b) {
59 return are_close(a.min, b.min) && are_close(a.max, b.max);
63 OMEGA_H_INLINE BBox<dim> make_equilateral(BBox<dim> bbox) {
64 auto maxl = reduce(bbox.max - bbox.min, maximum<Real>());
65 for (Int i = 0; i < dim; ++i) bbox.max[i] = bbox.min[i] + maxl;
70 OMEGA_H_INLINE Affine<dim> get_affine_from_bbox_into_unit(BBox<dim> bbox) {
72 for (Int i = 0; i < dim; ++i) s[i] = 1.0 / (bbox.max[i] - bbox.min[i]);
75 a.t = -(a.r * bbox.min);
80 BBox<dim> find_bounding_box(Reals coords);
83 BBox<dim> get_bounding_box(Mesh* mesh);
85 extern template BBox<1> find_bounding_box<1>(Reals coords);
86 extern template BBox<2> find_bounding_box<2>(Reals coords);
87 extern template BBox<3> find_bounding_box<3>(Reals coords);
89 extern template BBox<1> get_bounding_box<1>(Mesh* mesh);
90 extern template BBox<2> get_bounding_box<2>(Mesh* mesh);
91 extern template BBox<3> get_bounding_box<3>(Mesh* mesh);
Definition: Omega_h_few.hpp:61
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_bbox.hpp:32