DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | 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, const std::vector< std::int32_t > &entity_indices, double padding=0)
 Constructor. More...
 
 BoundingBoxTree (const mesh::Mesh &mesh, int tdim, double padding=0)
 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...
 
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 might have a collision with. 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...
 
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 contain the actual entity index, not a reference to the index of the entity_indices list. 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::BoundingBoxTree ( const mesh::Mesh mesh,
int  tdim,
const std::vector< std::int32_t > &  entity_indices,
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]entity_indicesList 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::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::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,

◆ compute_global_tree()

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

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

◆ 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

◆ remap_entity_indices()

void BoundingBoxTree::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 contain the actual entity index, not a reference to the index of the entity_indices list.

Parameters
[in]entity_indicesThe list of entities (local to process) used to build the bounding box tree. They should be in the same order as the input to the bounding box tree constructor.

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