Proto
|
An interval in DIM dimensional space. More...
#include <Proto_Box.H>
Public Member Functions | |
Constructors | |
Box () | |
Default Constructor. More... | |
Point | boundary (const Side::LoHiSide a_side) const |
Box | faceBox (int a_idir, const Side::LoHiSide a_side) const |
Box (const Point &a_low, const Point &a_high) | |
2 Point Constructor More... | |
Box (const int *a_lo, const int *a_hi) | |
Primitive Constructor. More... | |
void | define (const int *a_lo, const int *a_hi) |
Define. More... | |
Box (const Point &a_pt) | |
1 Point (Origin) Constructor More... | |
Box (const Box &a_box) | |
Copy Constructor. | |
Accessors And Queries | |
Point | low () const |
Access Low Corner. More... | |
Point | high () const |
Access High Corner. More... | |
CUDA_DECORATION std::size_t | size (unsigned char a_dim) const |
Edge Size. More... | |
CUDA_DECORATION std::size_t | size () const |
Volumetric Size. More... | |
CUDA_DECORATION bool | contains (const Point &a_pt) const |
Contains Point Query. More... | |
CUDA_DECORATION bool | contains (const Box &a_rhs) const |
Contains Box Query. More... | |
bool | onBoundary (const Point &a_p) const |
Point on Boundry Query. More... | |
CUDA_DECORATION bool | empty () const |
Empty Query. More... | |
CUDA_DECORATION unsigned int | index (const Point &a_pt) const |
Point to Linear Index. More... | |
CUDA_DECORATION Point | operator[] (unsigned int a_index) const |
Access Point by Index. More... | |
CUDA_DECORATION Point | operator() (unsigned int a_idx, unsigned int a_idy, unsigned a_idz) const |
Operators | |
Box | operator & (const Box &a_rightBox) const |
Intersection Operator. More... | |
void | operator &= (const Box &a_rhs) |
In Place Intersection. More... | |
Box | operator & (const Point &a_pt) const |
Add Point Operator. More... | |
void | operator &= (const Point &a_pt) |
In Place Add Point Operator. More... | |
bool | operator== (const Box &a_rhsBox) const |
Equality Operator. More... | |
bool | operator!= (const Box &a_rhsBox) const |
Inequality Operator. | |
bool | operator< (const Box &a_rhsBox) const |
< Operator. Based on same operator for Point applied to low corner. Used in Copier. | |
Point | operator% (const Point &a_pt) const |
Modulus Operator. More... | |
Point | mod (const Point &a_pt) const |
Modulus Function. More... | |
Transformations | |
Box | shift (int a_direction, int a_offset) const |
Shift Transformation. More... | |
Box | shift (const Point &a_pt) const |
Point Shift Transformation. More... | |
Box | grow (int a_numpoints) const |
Isotropic Grow Operation. More... | |
Box | grow (const Point &a_pt) const |
Anisotropic Grow Operation. More... | |
Box | grow (int a_dir, int a_offset) const |
Anisotropic Grow (Int Version) More... | |
Box | extrude (const Point &a_dir, int a_dist=1) const |
Extrude. More... | |
Box | extrude (int a_dir, int a_dist=1, bool a_upper=true) const |
Extrude (Int Version) More... | |
Box | growHi (int idir, int igrow) const |
Grow High Side. More... | |
Box | growLo (int idir, int igrow) const |
Grow Low Side. More... | |
Box | coarsen (unsigned int a_ratio) const |
Isotropic Coarsen Operation. More... | |
Box | coarsen (const Point &a_pt) const |
Anisotropic Coarsen Operation. More... | |
bool | coarsenable (const int &a_ratio) const |
(Isotropic) Coarsenable Query More... | |
bool | coarsenable (const Point &a_ratio) const |
(Anisotropic) Coarsenable Query More... | |
Box | taperCoarsen (const Point &a_ref) const |
Tapered Coarsen. More... | |
Box | refine (const Point &a_pt) const |
Anisotropic Refine Operation. More... | |
Box | refine (unsigned int a_ratio) const |
Isotropic Refine Operation. More... | |
Box | edge (const Point &a_dir, int a_dist=1) const |
Edge. More... | |
Box | flatten (const int a_dir, bool a_upper=false) const |
Flatten. More... | |
Box | adjacent (const Point &a_dir, int a_dist=-1) const |
Adjacent Cells. More... | |
Box | adjCellLo (int a_idir, int a_length) const |
Lower Adjacent Cells. More... | |
Box | adjCellHi (int a_idir, int a_length) const |
Upper Adjacent Cells. More... | |
Box | adjCellSide (int a_idir, int a_length, Side::LoHiSide a_sd) const |
Utility | |
BoxIterator | begin () const |
Iterator Begin. More... | |
BoxIterator | end () const |
Iterator End. More... | |
BoxIterator | rbegin () const |
Iterator Reverse Begin. More... | |
BoxIterator | rend () const |
Iterator Reverse End. More... | |
void | print () const |
Print. More... | |
Static Functions | |
static Box | Cube (int a_size) |
static Box | Kernel (int a_radius) |
Kernel Function. More... | |
An interval in DIM dimensional space.
A Box is a region in specified by two corner Point objects, high
and low
INCLUSIVELY.
Equivalently, a Box is a collection of linear intervals in .
Boxes are written using the notation [low, high]
.
|
inline |
Default Constructor.
Builds the empty Box [(-1,-1,...,-1), (0,0,...,0)]
|
inline |
Primitive Constructor.
Used for building a Box on platforms where plain-old-data is more convenient
a_lo | C-Array representing this.low() |
a_hi | C-Array representing this.high() |
|
inline |
Adjacent Cells.
Returns a box adjacent to *this in a given direction with a thickness a_dist in the normal direction. If there are multiple non-zero entries in a_dir, a_dist will be applied to the thickness in all of those directions
a_dir | "Normal" direction of the desired adjacent cell |
a_dist | "thickness" of the desired adjacent cell |
Examples:
|
inline |
Upper Adjacent Cells.
Alias for adjacent(Point::Basis(a_idir), +1)
|
inline |
Lower Adjacent Cells.
Alias for adjacent(Point::Basis(a_idir), -1)
|
inline |
Iterator Begin.
See documentation for Proto::BoxIterator for a basic usage example.
|
inline |
Isotropic Coarsen Operation.
Returns a new Box coarsened by a factor of a_numpoints
. Fails if user tries to coarsen using a non-positive ratio. If the limits of *this
are not multiples of the coarsening ratio (e.g. if this-> coarsenable() != true
) the resulting Box is not guaranteed to be a subset of *this
. In this situation, use Box::taperCoarsen
a_ratio | Coarsening ratio |
Example:
Anisotropic Coarsen Operation.
Returns a new Box coarsened in each direction according to a_pt
. Fails if user tries to coarsen using a non-positive ratio. (*this).coarsen(a_pt).refine(a_pt) will always contain *this.
a_pt | Coarsening ratios |
Example:
|
inline |
(Isotropic) Coarsenable Query
Returns true if *this will coarsen normally by a given ratio.
a_ratio | Coarsening ratio |
|
inline |
(Anisotropic) Coarsenable Query
Returns true if *this will coarsen normally by a given ratio.
a_ratio | Coarsening ratio |
|
inline |
Contains Point Query.
Checks if a_pt is inside of *this. Note that this->low()
and this->high()
are both considered inside *this
Example:
|
inline |
Contains Box Query.
Check if Box a_rhs is a subset of *this. Returns true even if a_rhs is not a proper subset. Equivalent to this->contains(a_rhs.low()) && this->contains(a_rhs.high()
Example:
|
inlinestatic |
Cube Function Creates the Box [Point::Zeros(), Point::Ones()*(a_size-1)]
, a cube in of side length a_size
a_size | side length |
|
inline |
Define.
Weak construct this Box if necessary
a_lo | C-Array representing this.low() |
a_hi | C-Array representing this.high() |
Edge.
Returns the subset on the boundary of *this in a given direction with specified thickness. Very handy for adjacency and boundary based computations. The returned Box
is always a subset of *this
a_dir | Direction of desired edge with respect to the cell center of *this |
a_dist | Thickness of the output |
Examples:
|
inline |
Empty Query.
Check if *this contains no Points
|
inline |
Iterator End.
See documentation for Proto::BoxIterator for a basic usage example.
Extrude.
AKA single sided grow. Returns a new Box with the a_dir
direction extruded a distance a_dist </code). By default, the extrusion is upwards. If
a_upper
is false, extrudes downwards.
a_dir | Axis to extrude along |
a_dist | (Optional) Distance to extrude (default: 1) |
Example:
|
inline |
Extrude (Int Version)
AKA single sided grow. Returns a new Box with the a_dir
direction extruded a distance a_dist </code). By default, the extrusion is upwards. If
a_upper
is false, extrudes downwards.
a_dir | Axis to extrude along |
a_dist | (Optional) Distance to extrude (default: 1) |
a_upper | (Optional) Extrude upwards? (default: true) |
Example:
|
inline |
Flatten.
Returns a copy of *this with dimension a_dir flattened to a thickness of 1. Useful for creating Boxes of dimensionality less than DIM (e.g. a plane in 3D)
a_dir | Direction to flatten |
a_upper | Flatten upwards? Example: |
|
inline |
Isotropic Grow Operation.
Returns a new Box which is larger in every direction by a_numpoints units. If a_numpoints is negative, the box will shrink.
a_numpoints | number of points to grow by in each direction |
Example:
|
inline |
Anisotropic Grow (Int Version)
Returns grow(Point::Basis(dir, offset)) Useful in places where plain-old-data inputs are preferable. To grow a grow a box only upwards / downwards, see Box::extrude
.
a_dir | A direction in [0,DIM) |
a_offset | Distance to grow |
|
inline |
Grow High Side.
Alias for Box::extrude(idir, igrow, true)
.
|
inline |
Grow Low Side.
Alias for Box::extrude(idir, igrow, false)
.
|
inline |
|
inline |
Point to Linear Index.
Returns a linear index in [0,this->size())
associated with a_pt
. Fails by assertion if a_pt
is not inside *this
. Indices start at this->low()
which has an index of 0. Indices increase fastest in dimension 0 and slowest in dimension DIM-1
. this->high()
has an index of this->size()-1
a_pt | a Point inside *this |
|
inlinestatic |
Kernel Function.
Creates a Box of size 2*a_radius + 1
on all sides with (0,...,0) at the center. Useful for iterating through boundary cells.
a_radius | the number of "rings" of cells around the center cell. |
Example:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Print.
Prints *this using the format [low, high]
|
inline |
Iterator Reverse Begin.
See documentation for Proto::BoxIterator for a basic usage example.
|
inline |
Isotropic Refine Operation.
Returns a new Box refined in all directions by a_numpoints.
a_ratio | Refinement ratio |
Example:
|
inline |
Iterator Reverse End.
See documentation for Proto::BoxIterator for a basic usage example.
|
inline |
|
inline |
Edge Size.
Returns the "edge length" of this Box on a given axis
/param a_dim direction axis in [0,DIM)
Example:
|
inline |
Tapered Coarsen.
This function is identical to Box::coarsen when Box::coarsenable() is true. For non-coarsenable Boxes, the new Box's limits are rounded such that the result Is always a subset of *this. Specifically, the lower limits are always rounded UP.
a_ref | Coarsening ratio |