criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
criptic::RealBox Class Reference

Class that represents a 3D rectangular prism. More...

#include <RealBox.H>

Public Member Functions

 RealBox (const RealVec &lo_=zeroVec, const RealVec &hi_=zeroVec)
 Construct a RealBox from two vectors.
 
 RealBox (const RealVec *pts, const IdxType npts)
 Construct a RealBox that bounds an array of points.
 
 RealBox (const RealBox &rb1, const RealBox &rb2)
 Construct a RealBox that contains two other RealBox's.
 
bool contains (const RealVec &x) const
 Is a point in the box?
 
std::array< RealVec, 8 > corners () const
 Return all corners of the box.
 
RealVec size () const
 Return size of box.
 
RealBox rotate (const RealTensor2 &rot) const
 Rotate box and return a box containing it.
 
void gaussExtrema (const RealTensor2 &eta, Real &gMin, Real &gMax) const
 Find extrema of a Gaussian function on a box.
 
RealBox operator+ (const RealVec &v) const
 Displace the position of a RealBox by a vector v.
 
RealBox operator- (const RealVec &v) const
 Displace the position of a RealBox by a vector -v.
 

Public Attributes

RealVec lo
 
RealVec hi
 

Detailed Description

Class that represents a 3D rectangular prism.

This class represnts a 3D rectangular prism with edges aligned with the cardinal axes. It provides various geometric operations on such a structure. The RealBox class does not know anything about periodic boundary conditions.

Constructor & Destructor Documentation

◆ RealBox() [1/3]

criptic::RealBox::RealBox ( const RealVec lo_ = zeroVec,
const RealVec hi_ = zeroVec 
)
inline

Construct a RealBox from two vectors.

Parameters
lo_The lower left corner of the box
hi_The upper right corner of the box

◆ RealBox() [2/3]

criptic::RealBox::RealBox ( const RealVec pts,
const IdxType  npts 
)
inline

Construct a RealBox that bounds an array of points.

Parameters
ptsArray of points
nptsNumber of points

◆ RealBox() [3/3]

criptic::RealBox::RealBox ( const RealBox rb1,
const RealBox rb2 
)
inline

Construct a RealBox that contains two other RealBox's.

Parameters
rb1The first RealBox
rb2The second RealBox

Member Function Documentation

◆ contains()

bool criptic::RealBox::contains ( const RealVec x) const
inline

Is a point in the box?

Parameters
xThe point
Returns
True if a point is in the box (including at its boundary)

◆ corners()

std::array< RealVec, 8 > criptic::RealBox::corners ( ) const
inline

Return all corners of the box.

Returns
An array containing the positions of all 8 box corners

◆ gaussExtrema()

void RealBox::gaussExtrema ( const RealTensor2 eta,
Real gMin,
Real gMax 
) const

Find extrema of a Gaussian function on a box.

Parameters
etaTensor in Gaussian kernel
gMinMinimum of Gaussian
gMaxMaximum of Gaussian

The function whose extrema are located is given by exp( -eta_ij x_i x_j / 2). Note that this function is not normalized, so the global maximum, which will be found if x = 0 is in the box, is unity. To normalize properly, divide the values returned by (2 pi)^(3/2) / det(eta)^(1/2).

◆ operator+()

criptic::RealBox::operator+ ( const RealVec v) const
inline

Displace the position of a RealBox by a vector v.

Parameters
vThe vector displacement
Returns
The RealBox with its corners shifted by +v

◆ operator-()

criptic::RealBox::operator- ( const RealVec v) const
inline

Displace the position of a RealBox by a vector -v.

Parameters
vThe vector displacement
Returns
The RealBox with its corners shifted by -v

◆ rotate()

RealBox criptic::RealBox::rotate ( const RealTensor2 rot) const
inline

Rotate box and return a box containing it.

Parameters
rotThe rotation matrix

This routine rotates the RealBox by the specified rotation matrix, and then defines a new RealBox (which is aligned with the new cardinal axes) that contains the rotated structure.

◆ size()

RealVec criptic::RealBox::size ( ) const
inline

Return size of box.

Returns
Size of box

Member Data Documentation

◆ hi

RealVec criptic::RealBox::hi

Coordinates of upper corner of box

◆ lo

RealVec criptic::RealBox::lo

Coordinates of lower corner of box


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