yt.utilities.lib.cyoctree module¶
CyOctree building, loading and refining routines
- class yt.utilities.lib.cyoctree.CyOctree¶
Bases:
object
This a class to store the underlying octree and particle data that can be interacted with from both Cython and Python
- bound_particles¶
The particle selection may select SPH particles with smoothing lengths which is in the octree domains. However, if the particle center is NOT in the octree, they are not included.
So the number of particles passed to the tree may not be equal to the number of particles which are bound by the tree.
- interpolate_sph_cells(buff, buff_den, posx, posy, posz, pmass, pdens, hsml, field, kernel_name='cubic', use_normalization=0)¶
We loop through every particle in the simulation and begin to deposit the particle properties onto all of the leaves that it intersects
- Parameters:
buff (memoryview) – The array which we are depositing the field onto, it has the length of the number of leaves.
buff_den (memoryview) – The array we deposit just mass onto to allow normalization
pos<> (memoryview) – The x, y, and z coordinates of all the partciles
pmass (memoryview) – The mass of the particles
pdens (memoryview) – The density of the particles
hsml (memoryview) – The smoothing lengths of the particles
field (memoryview) – The field we are depositing for each particle
kernel_name (str, default: "cubic") – Choice of kernel for SPH deposition
use_normalization (int, default: 0) – Do we want a normalized sph field? If so, fill the buff_den.
- node_depth¶
The depth for each node in the tree. The root node is defined as a depth of 0.
- node_positions¶
The centre of every node within the octree
- node_refined¶
An array of length num_nodes which contains either True / False for whether each cell has refined or not. E.g False for a leaf, True for a node
- node_sizes¶
The size of each node in the x, y and z directions. We calculate this on the fly. As we know the size of the whole tree and the depth of each node
- num_nodes¶
The total number of nodes after tree construction