|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
A class to manage Gas packets for Lagrangian gas descriptions. More...
#include <GasTree.H>
Public Member Functions | |
| GasTree (std::vector< RealVec > positions, std::vector< Real > smoothingLengths, Real hLimit=0, int leafSize_=16) | |
| Construct a GasTree with only its root node. | |
| void | buildTree () |
| Build a GasTree given that it has a well defined root node. | |
| void | partitionNode (GasNode &nd) |
| Partition a GasNode at the median point. | |
| std::vector< IdxType > | getIdxs (const RealVec &targetPos, const Real smoothingScale=1) const |
| Searches a GasTree to find indices of points close to the target. | |
Static Public Member Functions | |
| static RealBox | constructBox (std::vector< RealVec > positions) |
| Construct a bounding box from a list of positions. | |
| static bool | inBox (const RealVec &pos_, const RealBox &bx) |
| Determine if a position is inside a bounding box. | |
Private Attributes | |
| std::vector< RealVec > | posArray |
| std::vector< IdxType > | idxs |
| std::vector< Real > | hs |
| Real | hLim |
| std::vector< GasNode > | nodes |
| int | leafSize |
A class to manage Gas packets for Lagrangian gas descriptions.
This class stores the position and smoothing length data of a Lagrangian snapshot-based gas description to optimise searching through particle properties when recovering gas properties. It requires a vector of packet positions and smoothing lengths (as RealVec and Real values) without assumptions on how those properties are read in from snapshot files
| GasTree::GasTree | ( | std::vector< RealVec > | positions, |
| std::vector< Real > | smoothingLengths, | ||
| Real | hLimit = 0, |
||
| int | leafSize_ = 16 |
||
| ) |
Construct a GasTree with only its root node.
| positions | vector<RealVec> of packet positions |
| smoothingLengths | vector<Real> of packet smoothing lengths |
| hLimit | Real number representing a cap on smoothing length in each node. Zero means no cap |
| leafSize_ | Integer representing maximum number of packets in a leaf |
| void GasTree::buildTree | ( | ) |
Build a GasTree given that it has a well defined root node.
Construct a bounding box from a list of positions.
| positions | vector<RealVec> of positions |
| vector< IdxType > GasTree::getIdxs | ( | const RealVec & | targetPos, |
| const Real | smoothingScale = 1 |
||
| ) | const |
Searches a GasTree to find indices of points close to the target.
| targetPos | Target position to find nearby indices |
| smoothingScale | Scaling factor applied to all smoothing lengths |
Retrieves all nearby particle indices at a point. smoothingScale is used in the case where no nearby particles exist at targetPos (a 'hole' in the data).
Determine if a position is inside a bounding box.
| pos_ | RealVec position to test |
| bx | RealBox of bounds to determine if the position is inside |
| void GasTree::partitionNode | ( | GasNode & | nd | ) |
Partition a GasNode at the median point.
| nd | The node to partition |
This routine partitions a node at the median point, and sets the properties of the partition. The median point is the median of the dimension with the largest range of values.
|
private |
Cap on smoothing lengths on tree nodes
|
private |
Smoothing lengths of points in the tree
|
private |
Indices of points in the tree
|
private |
|
private |
Nodes of the tree
|
private |
Positions stored in the tree