Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Functions
KarrasRadixTreeAABB.hpp File Reference
#include "shambackends/DeviceBuffer.hpp"
#include "shambackends/DeviceScheduler.hpp"
#include "shambackends/EventList.hpp"
#include "shambackends/kernel_call.hpp"
#include "shambackends/math.hpp"
#include "shamsys/NodeInstance.hpp"
#include "shamtree/CellIterator.hpp"
#include "shamtree/KarrasRadixTree.hpp"
#include "shamtree/LeafCellIterator.hpp"
#include <functional>
#include <utility>
+ Include dependency graph for KarrasRadixTreeAABB.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  shamtree::KarrasRadixTreeAABB< Tvec >
 

Functions

template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::new_empty_karras_radix_tree_aabb ()
 
template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::prepare_karras_radix_tree_aabb (const KarrasRadixTree &tree, KarrasRadixTreeAABB< Tvec > &&recycled_tree_aabb)
 Prepare a KarrasRadixTreeAABB from a KarrasRadixTree.
 
template<class Tvec >
void shamtree::propagate_aabb_up (KarrasRadixTreeAABB< Tvec > &tree_aabb, const KarrasRadixTree &tree)
 Propagates the axis-aligned bounding boxes (AABBs) upwards in the tree.
 
template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::compute_tree_aabb (const KarrasRadixTree &tree, KarrasRadixTreeAABB< Tvec > &&recycled_tree_aabb, const std::function< void(KarrasRadixTreeAABB< Tvec > &, u32)> &fct_fill_leaf)
 Compute the AABB of all cells in the tree.
 
template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::compute_tree_aabb_from_positions (const KarrasRadixTree &tree, const LeafCellIterator &cell_it, KarrasRadixTreeAABB< Tvec > &&recycled_tree_aabb, sham::DeviceBuffer< Tvec > &positions)
 Compute the AABB of all cells in the tree from positions.
 
template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::compute_tree_aabb_from_position_ranges (const KarrasRadixTree &tree, const LeafCellIterator &cell_it, KarrasRadixTreeAABB< Tvec > &&recycled_tree_aabb, sham::DeviceBuffer< Tvec > &min, sham::DeviceBuffer< Tvec > &max)
 same but for position ranges
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file KarrasRadixTreeAABB.hpp.

Function Documentation

◆ compute_tree_aabb()

template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::compute_tree_aabb ( const KarrasRadixTree tree,
KarrasRadixTreeAABB< Tvec > &&  recycled_tree_aabb,
const std::function< void(KarrasRadixTreeAABB< Tvec > &, u32)> &  fct_fill_leaf 
)

Compute the AABB of all cells in the tree.

Parameters
treeThe tree to compute the AABBs for.
iterThe cell iterator to use to compute the AABBs.
recycled_tree_aabbThe tree AABBs to recycle.
fct_fill_leafThe function to use to compute the AABBs of the leaf cells.
Returns
The tree AABBs.

Definition at line 77 of file KarrasRadixTreeAABB.cpp.

+ Here is the call graph for this function:

◆ compute_tree_aabb_from_position_ranges()

template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::compute_tree_aabb_from_position_ranges ( const KarrasRadixTree tree,
const LeafCellIterator cell_it,
KarrasRadixTreeAABB< Tvec > &&  recycled_tree_aabb,
sham::DeviceBuffer< Tvec > &  min,
sham::DeviceBuffer< Tvec > &  max 
)

same but for position ranges

Definition at line 143 of file KarrasRadixTreeAABB.cpp.

+ Here is the call graph for this function:

◆ compute_tree_aabb_from_positions()

template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::compute_tree_aabb_from_positions ( const KarrasRadixTree tree,
const LeafCellIterator cell_it,
KarrasRadixTreeAABB< Tvec > &&  recycled_tree_aabb,
sham::DeviceBuffer< Tvec > &  positions 
)

Compute the AABB of all cells in the tree from positions.

This function computes the AABBs of all cells in the tree by iterating over the objects in each cell and computing the minimum and maximum bounds.

Parameters
treeThe tree to compute the AABBs for.
cell_itThe cell iterator to use to access the cells.
recycled_tree_aabbThe tree AABBs to recycle.
positionsThe buffer of positions to use for computing the AABBs.
Returns
The tree AABBs.

Definition at line 93 of file KarrasRadixTreeAABB.cpp.

+ Here is the call graph for this function:

◆ new_empty_karras_radix_tree_aabb()

template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::new_empty_karras_radix_tree_aabb ( )

Definition at line 67 of file KarrasRadixTreeAABB.hpp.

◆ prepare_karras_radix_tree_aabb()

template<class Tvec >
KarrasRadixTreeAABB< Tvec > shamtree::prepare_karras_radix_tree_aabb ( const KarrasRadixTree tree,
KarrasRadixTreeAABB< Tvec > &&  recycled_tree_aabb 
)

Prepare a KarrasRadixTreeAABB from a KarrasRadixTree.

This function prepares a KarrasRadixTreeAABB from a KarrasRadixTree. It allocates the necessary buffers to store the AABBs of all cells in the tree and recycles the buffers from the recycled_tree_aabb argument if possible.

Parameters
treeThe KarrasRadixTree to prepare the AABBs for.
recycled_tree_aabbThe KarrasRadixTreeAABB to recycle the buffers from.
Returns
The prepared KarrasRadixTreeAABB.

Definition at line 21 of file KarrasRadixTreeAABB.cpp.

+ Here is the call graph for this function:

◆ propagate_aabb_up()

template<class Tvec >
void shamtree::propagate_aabb_up ( KarrasRadixTreeAABB< Tvec > &  tree_aabb,
const KarrasRadixTree tree 
)

Propagates the axis-aligned bounding boxes (AABBs) upwards in the tree.

This function updates the AABBs for internal nodes in a KarrasRadixTree by combining the AABBs of their child nodes. It iteratively traverses the nodes of the tree, computing the minimum and maximum bounds for each internal node by taking the minimum and maximum of the bounds of its left and right children.

Template Parameters
TvecThe vector type used for the AABB bounds.
Parameters
tree_aabbA reference to the KarrasRadixTreeAABB containing the AABBs of the tree nodes.
treeThe KarrasRadixTree whose structure is used to determine the parent-child relationships.

Definition at line 33 of file KarrasRadixTreeAABB.cpp.

+ Here is the call graph for this function: