DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | Public Attributes | List of all members
dolfinx::geometry::BoundingBoxTree Class Reference

Axis-Aligned bounding box binary tree. It is used to find entities in a collection (often a mesh::Mesh). More...

#include <BoundingBoxTree.h>

Public Member Functions

 BoundingBoxTree (const mesh::Mesh &mesh, int tdim)
 Constructor. More...
 
 BoundingBoxTree (const std::vector< Eigen::Vector3d > &points)
 Constructor. More...
 
 BoundingBoxTree (BoundingBoxTree &&tree)=default
 Move constructor.
 
 BoundingBoxTree (const BoundingBoxTree &tree)=delete
 Copy constructor.
 
BoundingBoxTreeoperator= (BoundingBoxTree &&other)=default
 Move assignment.
 
 ~BoundingBoxTree ()=default
 Destructor.
 
Eigen::Array< double, 2, 3, Eigen::RowMajor > get_bbox (int node) const
 Return bounding box coordinates for a given node in the tree. More...
 
int num_bboxes () const
 Return number of bounding boxes.
 
int tdim () const
 Topological dimension of leaf entities.
 
std::string str () const
 Print out for debugging.
 
std::array< int, 2 > bbox (int node) const
 Get bounding box child nodes. More...
 

Public Attributes

std::unique_ptr< BoundingBoxTreeglobal_tree
 Global tree for mesh ownership of each process (same on all processes)
 

Detailed Description

Axis-Aligned bounding box binary tree. It is used to find entities in a collection (often a mesh::Mesh).

Constructor & Destructor Documentation

◆ BoundingBoxTree() [1/2]

BoundingBoxTree::BoundingBoxTree ( const mesh::Mesh mesh,
int  tdim 
)

Constructor.

Parameters
[in]meshThe mesh for building the bounding box tree
[in]tdimThe topological dimension of the mesh entities to by the bounding box tree for

◆ BoundingBoxTree() [2/2]

BoundingBoxTree::BoundingBoxTree ( const std::vector< Eigen::Vector3d > &  points)

Constructor.

Parameters
[in]pointsCloud of points to build the bounding box tree around

Member Function Documentation

◆ bbox()

std::array<int, 2> dolfinx::geometry::BoundingBoxTree::bbox ( int  node) const
inline

Get bounding box child nodes.

Parameters
[in]nodeThe bounding box node index
Returns
The indices of the two child nodes. For leaf nodes, index 0 is equal to the node index and index 1 is equal to the index of the entity that the leaf box bounds, e.g. the index of the cell that it bounds,

◆ get_bbox()

Eigen::Array< double, 2, 3, Eigen::RowMajor > BoundingBoxTree::get_bbox ( int  node) const

Return bounding box coordinates for a given node in the tree.

Parameters
[in]nodeThe bounding box node index
Returns
The bounding box where row(0) is the lower corner and row(1) is the upper corner

The documentation for this class was generated from the following files: