Loading...
Searching...
No Matches
BoundingBoxTree< T > Class Template Reference

`#include <BoundingBoxTree.h>`

## Public Member Functions

| BoundingBoxTree (const mesh::Mesh< T > &mesh, int tdim, double padding, std::optional< std::span< const std::int32_t > > entities=std::nullopt)
| BoundingBoxTree (std::vector< std::pair< std::array< T, 3 >, std::int32_t > > points)
| BoundingBoxTree (BoundingBoxTree &&tree)=default
| Move constructor.
| BoundingBoxTree (const BoundingBoxTree &tree)=delete
| Copy constructor.
BoundingBoxTree & | operator= (BoundingBoxTree &&other)=default
| Move assignment.
BoundingBoxTree & | operator= (const BoundingBoxTree &other)=default
| Copy assignment.
| ~BoundingBoxTree ()=default
| Destructor.
std::array< T, 6 > | get_bbox (std::size_t node) const
| Return bounding box coordinates for a given node in the tree,.
BoundingBoxTree | create_global_tree (MPI_Comm comm) const
std::int32_t | num_bboxes () const
| Return number of bounding boxes.
std::span< const T > | bbox_coordinates () const
| Access coordinates of lower and upper corners of bounding boxes (const version).
std::span< T > | bbox_coordinates ()
| Access coordinates of lower and upper corners of bounding boxes (non-const version).
int | tdim () const
| Topological dimension of leaf entities.
std::string | str () const
| Print out for debugging.
std::array< std::int32_t, 2 > | bbox (std::size_t node) const

## Detailed Description

template<std::floating_point T>
class dolfinx::geometry::BoundingBoxTree< T >

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]

template<std::floating_point T>

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

inline

Constructor

Parameters

  [in] | mesh | Mesh for building the bounding box tree.
  [in] | tdim | Topological dimension of the mesh entities to build the bounding box tree for.
  [in] | padding | Value to pad (extend) the the bounding box of each entity by.
  [in] | entities | List of entity indices (local to process) to compute the bounding box for. If std::nullopt, the bounding box tree is computed for all local entities (including ghosts) of the given tdim.

## BoundingBoxTree() [2/2]

template<std::floating_point T>

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

inline

Constructor

Parameters

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

## Member Function Documentation

## bbox()

template<std::floating_point T>

std::array< std::int32_t, 2 > bbox | ( | std::size_t | node | ) | const

inline

Get bounding box child nodes.

Parameters

  [in] | node | The 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.

## bbox_coordinates() [1/2]

template<std::floating_point T>

std::span< T > bbox_coordinates | ( |  | ) |

inline

Access coordinates of lower and upper corners of bounding boxes (non-const version).

Returns
  The flattened row-major coordinate vector, where the shape is (2*num_bboxes, 3).

## bbox_coordinates() [2/2]

template<std::floating_point T>

std::span< const T > bbox_coordinates | ( |  | ) | const

inline

Access coordinates of lower and upper corners of bounding boxes (const version).

Returns
  The flattened row-major coordinate vector, where the shape is (2*num_bboxes, 3).

## create_global_tree()

template<std::floating_point T>

BoundingBoxTree create_global_tree | ( | MPI_Comm | comm | ) | const

inline

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] | comm | MPI Communicator for collective communication

Returns
  BoundingBoxTree where each node represents a process

## get_bbox()

template<std::floating_point T>

std::array< T, 6 > get_bbox | ( | std::size_t | node | ) | const

inline

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

Parameters

  [in] | node | The bounding box node index.

Returns
  Bounding box coordinates (lower_corner, upper_corner). Shape is (2, 3), row-major storage.

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

- /build/fenics-dolfinx-Vk5o25/fenics-dolfinx-0.10.0.post5/cpp/dolfinx/geometry/BoundingBoxTree.h