 Reference documentation for deal.II version Git 26c8cac9c6 2020-01-27 13:06:59 +0100
BoundingBox< spacedim, Number > Class Template Reference

#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)

## Detailed Description

### template<int spacedim, typename Number = double> class BoundingBox< spacedim, Number >

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:

• 1 d: a segment (represented by its vertices in the proper order)
• 2 d: a rectangle (represented by the vertices V at bottom left, top right)
.--------V
| |
V--------.
• 3 d: a cuboid (in which case the two vertices V follow the convention and are not owned by the same face)
.------V
/ /|
.------. |
| | /
| |/
V------.
Notice that the sides are always parallel to the respective axis.

Definition at line 97 of file bounding_box.h.

## ◆ BoundingBox() [1/3]

template<int spacedim, typename Number = double>
 BoundingBox< spacedim, Number >::BoundingBox ( )
default

Standard constructor. Creates an object that corresponds to an empty box, i.e. a degenerate box with both points being the origin.

## ◆ BoundingBox() [2/3]

template<int spacedim, typename Number = double>
 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() [3/3]

template<int spacedim, typename Number = double>
template<class Container >
 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.

## ◆ get_boundary_points() [1/2]

template<int spacedim, typename Number >
 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.

## ◆ get_boundary_points() [2/2]

template<int spacedim, typename Number >
 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.

## ◆ get_neighbor_type()

template<int spacedim, typename Number >
 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.

## ◆ merge_with()

template<int spacedim, typename Number >
 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.

## ◆ point_inside()

template<int spacedim, typename Number >
 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.

## ◆ extend()

template<int spacedim, typename Number = double>
 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.

## ◆ volume()

template<int spacedim, typename Number >
 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.

## ◆ serialize()

template<int spacedim, typename Number = double>
template<class Archive >
 void BoundingBox< spacedim, Number >::serialize ( Archive & ar, const unsigned int version )

Boost serialization function

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