41 std::span<const std::int32_t> entities,
double padding = 0);
54 std::vector<std::pair<std::array<double, 3>, std::int32_t>> points);
76 std::array<double, 6>
get_bbox(std::size_t node)
const
78 std::array<double, 6> x;
79 std::copy_n(_bbox_coordinates.data() + 6 * node, 6, x.begin());
97 std::string
str()
const;
106 std::array<std::int32_t, 2>
bbox(std::size_t node)
const
108 assert(2 * node + 1 < _bboxes.size());
109 return {_bboxes[2 * node], _bboxes[2 * node + 1]};
115 std::vector<double>&& bbox_coords);
121 void tree_print(std::stringstream& s, std::int32_t i)
const;
124 std::vector<std::int32_t> _bboxes;
127 std::vector<double> _bbox_coordinates;
Axis-Aligned bounding box binary tree. It is used to find entities in a collection (often a mesh::Mes...
Definition: BoundingBoxTree.h:29
BoundingBoxTree & operator=(const BoundingBoxTree &other)=default
Copy assignment.
std::array< double, 6 > get_bbox(std::size_t node) const
Return bounding box coordinates for a given node in the tree,.
Definition: BoundingBoxTree.h:76
BoundingBoxTree & operator=(BoundingBoxTree &&other)=default
Move assignment.
BoundingBoxTree create_global_tree(MPI_Comm comm) const
Compute a global bounding tree (collective on comm) This can be used to find which process a point mi...
Definition: BoundingBoxTree.cpp:273
int tdim() const
Topological dimension of leaf entities.
Definition: BoundingBoxTree.cpp:314
BoundingBoxTree(BoundingBoxTree &&tree)=default
Move constructor.
std::int32_t num_bboxes() const
Return number of bounding boxes.
Definition: BoundingBoxTree.cpp:305
std::array< std::int32_t, 2 > bbox(std::size_t node) const
Get bounding box child nodes.
Definition: BoundingBoxTree.h:106
BoundingBoxTree(const BoundingBoxTree &tree)=delete
Copy constructor.
~BoundingBoxTree()=default
Destructor.
std::string str() const
Print out for debugging.
Definition: BoundingBoxTree.cpp:307
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:34
Geometry data structures and algorithms.
Definition: BoundingBoxTree.h:24
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:31