11 #include <dolfinx/common/MPI.h>
43 const std::vector<std::int32_t>& entity_indices,
75 Eigen::Array<double, 2, 3, Eigen::RowMajor>
get_bbox(
int node)
const;
91 std::string
str()
const;
99 std::array<int, 2>
bbox(
int node)
const
101 assert(node < (
int)_bboxes.rows());
102 return {_bboxes(node, 0), _bboxes(node, 1)};
116 const Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& bboxes,
117 const Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>&
124 void tree_print(std::stringstream& s,
int i)
const;
127 Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor> _bboxes;
130 Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor> _bbox_coordinates;
Axis-Aligned bounding box binary tree. It is used to find entities in a collection (often a mesh::Mes...
Definition: BoundingBoxTree.h:31
std::string str() const
Print out for debugging.
Definition: BoundingBoxTree.cpp:385
BoundingBoxTree(const mesh::Mesh &mesh, int tdim, const std::vector< std::int32_t > &entity_indices, double padding=0)
Constructor.
Definition: BoundingBoxTree.cpp:289
~BoundingBoxTree()=default
Destructor.
BoundingBoxTree(const BoundingBoxTree &tree)=delete
Copy constructor.
int num_bboxes() const
Return number of bounding boxes.
Definition: BoundingBoxTree.cpp:383
void remap_entity_indices(const std::vector< std::int32_t > &entity_indices)
Remap entity indices for bounding box trees that does not span a whole mesh. Each leaf node should co...
Definition: BoundingBoxTree.cpp:274
int tdim() const
Topological dimension of leaf entities.
Definition: BoundingBoxTree.cpp:392
BoundingBoxTree(BoundingBoxTree &&tree)=default
Move constructor.
BoundingBoxTree compute_global_tree(const 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:331
Eigen::Array< double, 2, 3, Eigen::RowMajor > get_bbox(int node) const
Return bounding box coordinates for a given node in the tree.
Definition: BoundingBoxTree.cpp:422
std::array< int, 2 > bbox(int node) const
Get bounding box child nodes.
Definition: BoundingBoxTree.h:99
BoundingBoxTree & operator=(BoundingBoxTree &&other)=default
Move assignment.
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:57