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

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< IdxTypegetIdxs (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< RealVecposArray
 
std::vector< IdxTypeidxs
 
std::vector< Realhs
 
Real hLim
 
std::vector< GasNodenodes
 
int leafSize
 

Detailed Description

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

Constructor & Destructor Documentation

◆ GasTree()

GasTree::GasTree ( std::vector< RealVec positions,
std::vector< Real smoothingLengths,
Real  hLimit = 0,
int  leafSize_ = 16 
)

Construct a GasTree with only its root node.

Parameters
positionsvector<RealVec> of packet positions
smoothingLengthsvector<Real> of packet smoothing lengths
hLimitReal number representing a cap on smoothing length in each node. Zero means no cap
leafSize_Integer representing maximum number of packets in a leaf

Member Function Documentation

◆ buildTree()

void GasTree::buildTree ( )

Build a GasTree given that it has a well defined root node.

◆ constructBox()

RealBox GasTree::constructBox ( std::vector< RealVec positions)
static

Construct a bounding box from a list of positions.

Parameters
positionsvector<RealVec> of positions

◆ getIdxs()

vector< IdxType > GasTree::getIdxs ( const RealVec targetPos,
const Real  smoothingScale = 1 
) const

Searches a GasTree to find indices of points close to the target.

Parameters
targetPosTarget position to find nearby indices
smoothingScaleScaling 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).

◆ inBox()

static bool criptic::GasTree::inBox ( const RealVec pos_,
const RealBox bx 
)
inlinestatic

Determine if a position is inside a bounding box.

Parameters
pos_RealVec position to test
bxRealBox of bounds to determine if the position is inside

◆ partitionNode()

void GasTree::partitionNode ( GasNode nd)

Partition a GasNode at the median point.

Parameters
ndThe 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.

Member Data Documentation

◆ hLim

Real criptic::GasTree::hLim
private

Cap on smoothing lengths on tree nodes

◆ hs

std::vector<Real> criptic::GasTree::hs
private

Smoothing lengths of points in the tree

◆ idxs

std::vector<IdxType> criptic::GasTree::idxs
private

Indices of points in the tree

◆ leafSize

int criptic::GasTree::leafSize
private

◆ nodes

std::vector<GasNode> criptic::GasTree::nodes
private

Nodes of the tree

◆ posArray

std::vector<RealVec> criptic::GasTree::posArray
private

Positions stored in the tree


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