Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/d1/ddc/classdolfinx_1_1geometry_1_1BoundingBoxTree.html
DOLFINx  0.5.1
DOLFINx C++ interface
Public Member Functions | List of all members
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, const std::span< const std::int32_t > &entities, double padding=0)
 Constructor. More...
 
 BoundingBoxTree (const mesh::Mesh &mesh, int tdim, double padding=0)
 Constructor. More...
 
 BoundingBoxTree (std::vector< std::pair< std::array< double, 3 >, std::int32_t >> points)
 Constructor. More...
 
 BoundingBoxTree (BoundingBoxTree &&tree)=default
 Move constructor.
 
 BoundingBoxTree (const BoundingBoxTree &tree)=delete
 Copy constructor.
 
BoundingBoxTreeoperator= (BoundingBoxTree &&other)=default
 Move assignment.
 
BoundingBoxTreeoperator= (const BoundingBoxTree &other)=default
 Copy assignment.
 
 ~BoundingBoxTree ()=default
 Destructor.
 
std::array< std::array< double, 3 >, 2 > get_bbox (std::size_t node) const
 Return bounding box coordinates for a given node in the tree. More...
 
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 might have a collision with. More...
 
std::int32_t 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 (std::size_t node) const
 Get bounding box child nodes. More...
 

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/3]

BoundingBoxTree ( const mesh::Mesh mesh,
int  tdim,
const std::span< const std::int32_t > &  entities,
double  padding = 0 
)

Constructor.

Parameters
[in]meshThe mesh for building the bounding box tree
[in]tdimThe topological dimension of the mesh entities to build the bounding box tree for
[in]entitiesList of entity indices (local to process) to compute the bounding box for (may be empty, if none).
[in]paddingA float perscribing how much the bounding box of each entity should be padded

◆ BoundingBoxTree() [2/3]

BoundingBoxTree ( const mesh::Mesh mesh,
int  tdim,
double  padding = 0 
)

Constructor.

Parameters
[in]meshThe mesh for building the bounding box tree
[in]tdimThe topological dimension of the mesh entities to build the bounding box tree for
[in]paddingA float perscribing how much the bounding box of each entity should be padded

◆ BoundingBoxTree() [3/3]

BoundingBoxTree ( std::vector< std::pair< std::array< double, 3 >, std::int32_t >>  points)

Constructor.

Parameters
[in]pointsCloud of points, with associated point identifier index, to build the bounding box tree around

Member Function Documentation

◆ bbox()

std::array<int, 2> bbox ( std::size_t  node) const
inline

Get bounding box child nodes.

Parameters
[in]nodeThe bounding box node index
Returns
The indices of the two child nodes. If node is a leaf nodes, then the values in the returned array are equal and correspond to the index of the entity that the leaf node bounds, e.g. the index of the cell that it bounds.

◆ create_global_tree()

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 might have a collision with.

Parameters
[in]commMPI Communicator for collective communication
Returns
BoundingBoxTree where each node represents a process

◆ get_bbox()

std::array< std::array< double, 3 >, 2 > get_bbox ( std::size_t  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 [0] is the lower corner and [1] is the upper corner

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