Loading...
Searching...
No Matches
dolfin::BoundingBoxTree2D Class Reference

Specialization of bounding box implementation to 2D. More...

`#include <BoundingBoxTree2D.h>`

Inheritance diagram for dolfin::BoundingBoxTree2D:
[legend]
Collaboration diagram for dolfin::BoundingBoxTree2D:
[legend]

## Classes

struct | less_x
struct | less_y

## Protected Member Functions

std::size_t | gdim () const
| Return geometric dimension.
const double * | get_bbox_coordinates (unsigned int node) const
| Return bounding box coordinates for node.
bool | point_in_bbox (const double *x, unsigned int node) const
| Check whether point (x) is in bounding box (node).
bool | bbox_in_bbox (const double *a, unsigned int node) const
| Check whether bounding box (a) collides with bounding box (node).
double | compute_squared_distance_bbox (const double *x, unsigned int node) const
| Compute squared distance between point and bounding box.
double | compute_squared_distance_point (const double *x, unsigned int node) const
| Compute squared distance between point and point.
void | compute_bbox_of_bboxes (double *bbox, std::size_t &axis, const std::vector< double > &leaf_bboxes, const std::vector< unsigned int >::iterator &begin, const std::vector< unsigned int >::iterator &end)
| Compute bounding box of bounding boxes.
void | compute_bbox_of_points (double *bbox, std::size_t &axis, const std::vector< Point > &points, const std::vector< unsigned int >::iterator &begin, const std::vector< unsigned int >::iterator &end)
| Compute bounding box of points.
void | sort_bboxes (std::size_t axis, const std::vector< double > &leaf_bboxes, const std::vector< unsigned int >::iterator &begin, const std::vector< unsigned int >::iterator &middle, const std::vector< unsigned int >::iterator &end)
| Sort leaf bounding boxes along given axis.
Protected Member Functions inherited from dolfin::GenericBoundingBoxTree
void | clear ()
| Clear existing data if any.
unsigned int | _build (const std::vector< double > &leaf_bboxes, const std::vector< unsigned int >::iterator &begin, const std::vector< unsigned int >::iterator &end, std::size_t gdim)
| Build bounding box tree for entities (recursive).
unsigned int | _build (const std::vector< Point > &points, const std::vector< unsigned int >::iterator &begin, const std::vector< unsigned int >::iterator &end, std::size_t gdim)
| Build bounding box tree for points (recursive).
void | build_point_search_tree (const Mesh &mesh) const
| Compute point search tree if not already done.
void | compute_bbox_of_entity (double *b, const MeshEntity &entity, std::size_t gdim) const
| Compute bounding box of mesh entity.
void | sort_points (std::size_t axis, const std::vector< Point > &points, const std::vector< unsigned int >::iterator &begin, const std::vector< unsigned int >::iterator &middle, const std::vector< unsigned int >::iterator &end)
| Sort points along given axis.
unsigned int | add_bbox (const BBox &bbox, const double *b, std::size_t gdim)
| Add bounding box and coordinates.
const BBox & | get_bbox (unsigned int node) const
| Return bounding box for given node.
unsigned int | num_bboxes () const
| Return number of bounding boxes.
unsigned int | add_point (const BBox &bbox, const Point &point, std::size_t gdim)
| Add bounding box and point coordinates.
bool | is_leaf (const BBox &bbox, unsigned int node) const
| Check whether bounding box is a leaf node.
void | tree_print (std::stringstream &s, unsigned int i)
| Print out recursively, for debugging.

## Additional Inherited Members

Public Member Functions inherited from dolfin::GenericBoundingBoxTree
| GenericBoundingBoxTree ()
| Constructor.
virtual | ~GenericBoundingBoxTree ()
| Destructor.
void | build (const Mesh &mesh, std::size_t tdim)
| Build bounding box tree for mesh entities of given dimension.
void | build (const std::vector< Point > &points)
| Build bounding box tree for point cloud.
std::vector< unsigned int > | compute_collisions (const Point &point) const
| Compute all collisions between bounding boxes and Point.
std::pair< std::vector< unsigned int >, std::vector< unsigned int > > | compute_collisions (const GenericBoundingBoxTree &tree) const
| Compute all collisions between bounding boxes and BoundingBoxTree.
std::vector< unsigned int > | compute_entity_collisions (const Point &point, const Mesh &mesh) const
| Compute all collisions between entities and Point.
std::vector< unsigned int > | compute_process_collisions (const Point &point) const
| Compute all collisions between processes and Point.
std::pair< std::vector< unsigned int >, std::vector< unsigned int > > | compute_entity_collisions (const GenericBoundingBoxTree &tree, const Mesh &mesh_A, const Mesh &mesh_B) const
| Compute all collisions between entities and BoundingBoxTree.
unsigned int | compute_first_collision (const Point &point) const
| Compute first collision between bounding boxes and Point.
unsigned int | compute_first_entity_collision (const Point &point, const Mesh &mesh) const
| Compute first collision between entities and Point.
std::pair< unsigned int, double > | compute_closest_entity (const Point &point, const Mesh &mesh) const
| Compute closest entity and distance to Point.
std::pair< unsigned int, double > | compute_closest_point (const Point &point) const
| Compute closest point and distance to Point.
std::string | str (bool verbose=false)
| Print out for debugging.
Static Public Member Functions inherited from dolfin::GenericBoundingBoxTree
static std::shared_ptr< GenericBoundingBoxTree > | create (unsigned int dim)
| Factory function returning (empty) tree of appropriate dimension.
Static Protected Member Functions inherited from dolfin::GenericBoundingBoxTree
static void | _compute_collisions (const GenericBoundingBoxTree &tree, const Point &point, unsigned int node, std::vector< unsigned int > &entities, const Mesh *mesh)
static void | _compute_collisions (const GenericBoundingBoxTree &A, const GenericBoundingBoxTree &B, unsigned int node_A, unsigned int node_B, std::vector< unsigned int > &entities_A, std::vector< unsigned int > &entities_B, const Mesh *mesh_A, const Mesh *mesh_B)
static unsigned int | _compute_first_collision (const GenericBoundingBoxTree &tree, const Point &point, unsigned int node)
static unsigned int | _compute_first_entity_collision (const GenericBoundingBoxTree &tree, const Point &point, unsigned int node, const Mesh &mesh)
static void | _compute_closest_entity (const GenericBoundingBoxTree &tree, const Point &point, unsigned int node, const Mesh &mesh, unsigned int &closest_entity, double &R2)
static void | _compute_closest_point (const GenericBoundingBoxTree &tree, const Point &point, unsigned int node, unsigned int &closest_point, double &R2)
Protected Attributes inherited from dolfin::GenericBoundingBoxTree
std::size_t | _tdim
| Topological dimension of leaf entities.
std::vector< BBox > | _bboxes
| List of bounding boxes (parent-child-entity relations).
std::vector< double > | _bbox_coordinates
| List of bounding box coordinates.
std::shared_ptr< GenericBoundingBoxTree > | _point_search_tree
| Point search tree used to accelerate distance queries.
std::shared_ptr< GenericBoundingBoxTree > | _global_tree
| Global tree for mesh ownership of each process (same on all processes).

## Detailed Description

Specialization of bounding box implementation to 2D.

## Member Function Documentation

## bbox_in_bbox()

bool dolfin::BoundingBoxTree2D::bbox_in_bbox | ( | const double * | a,
|  | unsigned int | node ) const

inline protected virtual

Check whether bounding box (a) collides with bounding box (node).

Implements dolfin::GenericBoundingBoxTree.

## compute_bbox_of_bboxes()

void dolfin::BoundingBoxTree2D::compute_bbox_of_bboxes | ( | double * | bbox,
|  | std::size_t & | axis,
|  | const std::vector< double > & | leaf_bboxes,
|  | const std::vector< unsigned int >::iterator & | begin,
|  | const std::vector< unsigned int >::iterator & | end )

inline protected virtual

Compute bounding box of bounding boxes.

Compute min and max over remaining boxes

Implements dolfin::GenericBoundingBoxTree.

## compute_bbox_of_points()

void dolfin::BoundingBoxTree2D::compute_bbox_of_points | ( | double * | bbox,
|  | std::size_t & | axis,
|  | const std::vector< Point > & | points,
|  | const std::vector< unsigned int >::iterator & | begin,
|  | const std::vector< unsigned int >::iterator & | end )

inline protected virtual

Compute bounding box of points.

Implements dolfin::GenericBoundingBoxTree.

## compute_squared_distance_bbox()

double dolfin::BoundingBoxTree2D::compute_squared_distance_bbox | ( | const double * | x,
|  | unsigned int | node ) const

inline protected virtual

Compute squared distance between point and bounding box.

Implements dolfin::GenericBoundingBoxTree.

## compute_squared_distance_point()

double dolfin::BoundingBoxTree2D::compute_squared_distance_point | ( | const double * | x,
|  | unsigned int | node ) const

inline protected virtual

Compute squared distance between point and point.

Implements dolfin::GenericBoundingBoxTree.

## gdim()

std::size_t dolfin::BoundingBoxTree2D::gdim | ( |  | ) | const

inline protected virtual

Return geometric dimension.

Implements dolfin::GenericBoundingBoxTree.

## get_bbox_coordinates()

const double * dolfin::BoundingBoxTree2D::get_bbox_coordinates | ( | unsigned int | node | ) | const

inline protected virtual

Return bounding box coordinates for node.

Implements dolfin::GenericBoundingBoxTree.

## point_in_bbox()

bool dolfin::BoundingBoxTree2D::point_in_bbox | ( | const double * | x,
|  | unsigned int | node ) const

inline protected virtual

Check whether point (x) is in bounding box (node).

Implements dolfin::GenericBoundingBoxTree.

## sort_bboxes()

void dolfin::BoundingBoxTree2D::sort_bboxes | ( | std::size_t | axis,
|  | const std::vector< double > & | leaf_bboxes,
|  | const std::vector< unsigned int >::iterator & | begin,
|  | const std::vector< unsigned int >::iterator & | middle,
|  | const std::vector< unsigned int >::iterator & | end )

inline protected virtual

Sort leaf bounding boxes along given axis.

Implements dolfin::GenericBoundingBoxTree.

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

- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/geometry/BoundingBoxTree2D.h