|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
A class that describes the geometry of a calculation. More...
#include <Geometry.H>
Public Types | |
| enum | bcType { openBC = 0 , absorbingBC , reflectingBC , periodicBC } |
| An enum describing boundary condition types. More... | |
Public Member Functions | |
| Geometry (const ParmParser &pp) | |
| Constructor. | |
| const RealBox & | xBox () const |
| Return the domain bounding box. | |
| const RealVec & | xLo () const |
| Return low boundary of computational domain. | |
| const RealVec & | xHi () const |
| Return high boundary of computational domain. | |
| const RealVec & | xSize () const |
| Return size of computational domain. | |
| const Vec3< bcType > & | bLo () const |
| Return low boundary conditions of computational domain. | |
| const Vec3< bcType > & | bHi () const |
| Return high boundary conditions of computational domain. | |
| const BoolVec & | isPeriodic () const |
| Return periodicity of problem domain. | |
| bool | isAnyPeriodic () const |
| Return whether the domain is periodic in any dimension. | |
| bool | isAnyOpen () const |
| Return whether the domain is open in any direction. | |
| void | applyBC (RealVec &x) const |
| Apply boundary conditions to a packet. | |
| Real | periodicLoop (const Real x, const int i, const bool recenter=false) const |
| Loop the input coordinate over periodic boundaries. | |
| RealVec | periodicLoop (const RealVec &x, const bool recenter=false) const |
| Loop the input position over periodic boundaries. | |
| std::vector< RealBox > | periodicLoopBox (const RealBox &b, const bool recenter=false) const |
| Loop the input box over periodic boundaries. | |
| bool | contains (const RealVec &x) const |
| Report if a specified point is in the problem domain. | |
| RealVec | disp (const RealVec &x1, const RealVec &x2) const |
| Get displacement vector between two points. | |
| Real | dist (const RealVec &x1, const RealVec &x2) const |
| Compute distance between two points. | |
| Real | minBoxDist (const RealVec &x, const RealVec &boxLo, const RealVec &boxHi) const |
| Return minimum distance between a point and a box. | |
| Real | maxBoxDist (const RealVec &x, const RealVec &boxLo, const RealVec &boxHi) const |
| Return maximum distance between a point and a box. | |
| void | minMaxBoxDist2 (const RealVec &x, const RealVec &boxLo, const RealVec &boxHi, RealVec &d2Min, RealVec &d2Max) const |
| Compute min and max squared distances between a point and a box. | |
| void | minMaxBoxDist2 (const RealVec &x, const RealVec &boxLo, const RealVec &boxHi, Real &d2Min, Real &d2Max) const |
| Compute min and max squared distances between a point and a box. | |
| void | minMaxBoxDist (const RealVec &x, const RealVec &boxLo, const RealVec &boxHi, Real &dMin, Real &dMax) const |
| Compute min and max squared distances between a point and a box. | |
Private Attributes | |
| Vec3< bcType > | bcLo |
| Vec3< bcType > | bcHi |
| RealBox | box |
| RealVec | probSize |
| BoolVec | periodicity |
| bool | hasPeriodicDim |
A class that describes the geometry of a calculation.
This class provides methods to handle boundary conditions, periodicity, and other geometry-related calculations.
| Geometry::Geometry | ( | const ParmParser & | pp | ) |
Constructor.
| pp | The parameter parser, which contains the input deck |
|
inline |
Apply boundary conditions to a packet.
| x | Position of a packet |
| pkt | CR packet properties |
This routine applies the boundary conditions to a CR packet. Periodic boundaries will cause packets to loop around the box if they are outside it, reflecting boundaries will reflect the packet position, and reflectingPitchAngle boundaries will reflect the position and pitch angle.
Return high boundary conditions of computational domain.
Return low boundary conditions of computational domain.
|
inline |
Report if a specified point is in the problem domain.
| x | Position of point |
Get displacement vector between two points.
| x1 | First point |
| x2 | Second point |
This funtion returns the displacement vector between any points points. In non-periodic geometry, this is just the usual vector subtraction, but in periodic geometry dimensions are looped, so that the displacement vector is the shortest path.
Compute distance between two points.
| x1 | First point |
| x2 | Second point |
The distance returned is computed in the periodic metric if the domain is periodic; thus in any periodic dimension the maximum distance between any two points in that dimension is half the box size.
|
inline |
Return whether the domain is open in any direction.
|
inline |
Return whether the domain is periodic in any dimension.
|
inline |
Return periodicity of problem domain.
|
inline |
Return maximum distance between a point and a box.
| x | Location of the point |
| boxLo | Location of lower left corner of box |
| boxHi | Location of upper right corner of box |
The distance returned is the distance between the input point and the point contained within the box from which it is farthest. Distance is computed using the periodic distance metric if the domain is periodic. However, it is assumed that the box does not wrap around the periodic boundary.
|
inline |
Return minimum distance between a point and a box.
| x | Location of the point |
| boxLo | Location of lower left corner of box |
| boxHi | Location of upper right corner of box |
The distance returned is the distance between the input point and the point contained within the box to which it is closest. Distance is computed using the periodic distance metric if the domain is periodic. However, it is assumed that the box does not wrap around the periodic boundary.
|
inline |
Compute min and max squared distances between a point and a box.
| x | Location of the point |
| boxLo | Location of lower left corner of box |
| boxHi | Location of upper right corner of box |
| dMin | The minimum distance between the point and the box |
| dMax | The maximum distance between the point and the box |
The distances copmputed are those between the input point and the points contained within the box from which it is nearest and farthest. Distances are computed using the periodic distance metric if the domain is periodic. However, it is assumed that the box does not wrap around the periodic boundary.
|
inline |
Compute min and max squared distances between a point and a box.
| x | Location of the point |
| boxLo | Location of lower left corner of box |
| boxHi | Location of upper right corner of box |
| d2Min | The minimum squared distance between the point and the box |
| d2Max | The maximum sqaured distance between the point and the box |
The distances copmputed are those between the input point and the points contained within the box from which it is nearest and farthest. Distances are computed using the periodic distance metric if the domain is periodic. However, it is assumed that the box does not wrap around the periodic boundary.
|
inline |
Compute min and max squared distances between a point and a box.
| x | Location of the point |
| boxLo | Location of lower left corner of box |
| boxHi | Location of upper right corner of box |
| d2Min | The minimum squared distance between the point and the box |
| d2Max | The maximum squared distance between the point and the box |
The distances copmputed are those between the input point and the points contained within the box from which it is nearest and farthest. Distances are computed using the periodic distance metric if the domain is periodic. However, it is assumed that the box does not wrap around the periodic boundary. Note that this function differs from minMaxBoxDist2 called with scalar arguments for dMin and dMax in that the squared distances are returned as vectors giving the contribution from each dimension, rather than as scalar sums.
|
inline |
Loop the input coordinate over periodic boundaries.
| x | The position to loop |
| i | The dimension of the coordinate x |
| recenter | If true, re-center the domain at (0,0,0) |
This routine loops a coordinate value to lie in the problem domain. If recenter is false, the value returned is in the problem coordinate system, and thus lies in the range box.lo[i] to box.hi[i]. If recenter is true, the value returned is given in a coordinate system centered on the center of the domain, so the value returned lies in the range -probSize[i]/2 to +probSize[i]/2.
|
inline |
Loop the input position over periodic boundaries.
| x | The position to loop |
| recenter | If true, re-center the domain at (0,0,0) |
This routine loops a coordinate value to lie in the problem domain. If recenter is false, the value returned is in the problem coordinate system, and thus lies in the range box.lo to box.hi. If recenter is true, the value returned is given in a coordinate system centered on the center of the domain, so the value returned lies in the range -probSize/2 to +probSize/2.
|
inline |
Loop the input box over periodic boundaries.
| b | The box to loop |
| recenter | If true, re-center the domain at (0,0,0) |
Because RealBox objects do not know about periodic boundaries, the way this routine deals with a box that cuts across a periodic boundary is to cut the box at the boundary and return multiple boxes corresponding to the parts that lie on either side of the boundary. That is why the routine returns a vector of RealBox's rather than just a single one: there could potentially be up to eight sub-boxes.
|
inline |
Return the domain bounding box.
|
inline |
Return high boundary of computational domain.
|
inline |
Return low boundary of computational domain.
|
inline |
Return size of computational domain.
|
private |
Domain bounding box
|
private |
Is any dimension periodic?
|
private |
Periodicity of domain in each dimension
|
private |
Size of domain bounding box