Reference documentation for deal.II version 9.1.1
|
#include <deal.II/base/bounding_box.h>
Public Member Functions | |
BoundingBox ()=default | |
BoundingBox (const std::pair< Point< spacedim, Number >, Point< spacedim, Number >> &boundary_points) | |
template<class Container > | |
BoundingBox (const Container &points) | |
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & | get_boundary_points () |
const std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & | get_boundary_points () const |
NeighborType | get_neighbor_type (const BoundingBox< spacedim, Number > &other_bbox) const |
void | merge_with (const BoundingBox< spacedim, Number > &other_bbox) |
bool | point_inside (const Point< spacedim, Number > &p) const |
void | extend (const Number &amount) |
double | volume () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
A class that represents a bounding box in a space with arbitrary dimension spacedim
.
Objects of this class are used to represent bounding boxes. They are, among other uses, useful in parallel distributed meshes to give a general description of the owners of each portion of the mesh.
Bounding boxes are represented by two vertices (bottom left and top right). Geometrically, a bounding box is:
Definition at line 97 of file bounding_box.h.
|
default |
Standard constructor. Creates an object that corresponds to an empty box, i.e. a degenerate box with both points being the origin.
BoundingBox< spacedim, Number >::BoundingBox | ( | const std::pair< Point< spacedim, Number >, Point< spacedim, Number >> & | boundary_points | ) |
Standard constructor for non-empty boxes: it uses a pair of points which describe the box: one for the bottom and one for the top corner.
BoundingBox< spacedim, Number >::BoundingBox | ( | const Container & | points | ) |
Construct the bounding box that encloses all the points in the given container.
The constructor supports any Container that provides begin() and end() iterators to Point<spacedim, Number> elements.
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & BoundingBox< spacedim, Number >::get_boundary_points | ( | ) |
Return a reference to the boundary_points
Definition at line 149 of file bounding_box.cc.
const std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & BoundingBox< spacedim, Number >::get_boundary_points | ( | ) | const |
Return a const reference to the boundary_points
Definition at line 158 of file bounding_box.cc.
NeighborType BoundingBox< spacedim, Number >::get_neighbor_type | ( | const BoundingBox< spacedim, Number > & | other_bbox | ) | const |
Check if the current object and other_bbox
are neighbors, i.e. if the boxes have dimension spacedim, check if their intersection is non empty.
Return an enumerator of type NeighborType.
Definition at line 58 of file bounding_box.cc.
void BoundingBox< spacedim, Number >::merge_with | ( | const BoundingBox< spacedim, Number > & | other_bbox | ) |
Enlarge the current object so that it contains other_bbox
. If the current object already contains other_bbox
then it is not changed by this function.
Definition at line 42 of file bounding_box.cc.
bool BoundingBox< spacedim, Number >::point_inside | ( | const Point< spacedim, Number > & | p | ) | const |
Return true if the point is inside the Bounding Box, false otherwise.
Definition at line 21 of file bounding_box.cc.
void BoundingBox< spacedim, Number >::extend | ( | const Number & | amount | ) |
Increase (or decrease) the size of the bounding box by the given amount. After calling this method, the lower left corner of the bounding box will have each coordinate decreased by amount
, and the upper right corner of the bounding box will have each coordinate increased by amount
.
If you call this method with a negative number, and one of the axes of the original bounding box is smaller than amount/2, the method will trigger an assertion.
double BoundingBox< spacedim, Number >::volume | ( | ) | const |
Compute the volume (i.e. the dim-dimensional measure) of the BoundingBox.
Definition at line 167 of file bounding_box.cc.
void BoundingBox< spacedim, Number >::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Boost serialization function