HM3
Hierarchical Multi-physics Multi-scale Methods
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
hm3::tree::tree< Nd > Struct Template Reference

Description

template<uint_t Nd>
struct hm3::tree::tree< Nd >

Nd-octree data-structure.

nd-tree

+ Inheritance diagram for hm3::tree::tree< Nd >:

Data (all member variables of the tree)

Memory layout: siblings (node with the same parent) are stored contiguously in memory in Morton Z-Curve order.

The order of groups of children is arbitrary.

Memory requirements: 1 word + 1 / no_children word per node

  • each node stores the index of its first child (the other children are stored contiguously after the first in Z-Order)
  • each group of siblings stores the index of its parent
Warning
the interanals are public by design (e.g. for extensible serialization) but unstable (i.e. subjected to change without prior notice).
siblings_idx sg_capacity_ = 0_sg
 Sibling group capacity: maximum number of sibling groups that the tree can store.
 
std::unique_ptr< node_idx[]> parents_ = nullptr
 Indices to the parent node of each sibling group (1 index / sibling group)
 
std::unique_ptr< node_idx[]> first_children_ = nullptr
 Indices of the first children of each node (1 index / node)
 
node_idx size_ = 0_n
 Number of nodes in the tree.
 
siblings_idx first_free_sibling_group_ {0}
 First group of siblings that is free (i.e. not in use)
 

Spatial constants

static constexpr int_t dimension () noexcept
 Number of spatial dimensions of the tree.
 
static constexpr auto dimensions () noexcept
 Range of spatial dimensions of the tree: [0, Nd)