sekelle / cornerstone-octree

Local and distributed octrees based on Morton codes with halo discovery and exchange with a 3D collision detection algorithm
Other
30 stars 4 forks source link

About an equation in the paper #26

Open UnlimitedR opened 4 months ago

UnlimitedR commented 4 months ago

Hello, I'm reading this paper for personal use. I don't have too much background knowledge and have encountered several questions but tried to figure it out with my own understanding.

However, there is still an equation that I cannot understand at all, which is equation (10) $$𝛿(K_i, d) = \Sigmal^{d/3+1} \mu{k_l},\quad \mu_0, . . . , \mu_7 = {0, −1, −2, −3, 3, 2, 1, 0},$$ May I ask what the parameters such as $\mu$ mean and how it is deduced, and which part of the codes does this equation corresponding to?

sekelle commented 4 months ago

Hi, equation 10 is implemented by this function:

https://github.com/sekelle/cornerstone-octree/blob/c41b06df0ac1ddd12b5b955693d5753553b6ef56/include/cstone/tree/octree.hpp#L72

Under the condition that each internal node has 8 children, we already know that for $n$ leaf nodes, there will be $(n-1)/7$ internal nodes. Eq. 10 provides a map or an ordering that indicates where in [0:(n-1)/7] a given internal node should be stored. This is a faster shortcut to the more straightforward way of enumerating the internal node keys as they appear in the Cornerstone leaf cell array, followed by a prefix sum (as described in Karras, 2012). The $\mu$ are the weights of the octal digits of the internal node key to be assigned a storage location. Digits 0 and 7 do not shift that location, while digits 1-3 shift it to lower indices and 4-6 to higher ones. The total sum of these $\mu$ weights determines the storage location. Eq. 10 can be deduced by induction, starting with a minimal octree, inserting additional leaf cells and determining the resulting effect on the layout of internal nodes computed by the enumeration + prefix-sum method.

UnlimitedR commented 4 months ago

I'm sorry would you mind showing it using any graph illustrations if possible?