volumential.tree_interactive_build#
Interactive box-tree construction for adaptive volume FMM meshes.
This module owns the compatibility layer between volumential and the
current upstream boxtree tree-of-boxes data structures. It provides:
BoxTree, a mutable box tree that can be refined and coarsened in place while keeping a 2:1 level restriction, along with device-side views of its levels, centers and leaf boxes;QuadratureOnBoxTree, tensor-product quadrature on the leaf boxes of such a tree; andbuild_particle_tree_from_box_tree(), which converts a box tree plus its quadrature nodes into aboxtree.Treesuitable for FMM traversal.
The private helpers in between rebuild, prune and balance tree-of-boxes objects by their level/grid-index keys rather than by box id, which is what makes refinement and coarsening reproducible.
- class volumential.tree_interactive_build.BoxTree[source]#
Bases:
objectCompatibility wrapper for the old boxtree interactive build API.
This vendors the small portion of the old
xywei/boxtreeAPI thatvolumentialrelied on for adaptive mesh generation, while using current upstreamboxtree.tree_of_boxesdata structures internally.- generate_uniform_boxtree(queue, root_vertex=array([0., 0.]), root_extent=1, nlevels: int = 1, box_id_dtype=<class 'numpy.int32'>, box_level_dtype=<class 'numpy.int32'>, coord_dtype=<class 'numpy.float64'>) None[source]#
Build a uniformly refined box tree of nlevels levels.
- refine_and_coarsen(refine_flags, coarsen_flags, error_on_ignored_flags: bool = False) None[source]#
Refine and coarsen the tree in place, then restore level restriction.
Refinement is applied first; coarsening intents are tracked by parent box path so that they survive the renumbering that refinement causes.
- class volumential.tree_interactive_build.QuadratureOnBoxTree(boxtree: BoxTree, quadrature_formula=None)[source]#
Bases:
objectTensor-product quadrature on the leaf boxes of a
BoxTree.
- volumential.tree_interactive_build.build_particle_tree_from_box_tree(actx, box_tree, q_points_host)[source]#
Convert a
BoxTreeand its quadrature nodes into a particle tree.The returned
boxtree.Treeplaces every leaf box’s quadrature nodes in one contiguous run, ordered by a depth-first walk over the leaves, so that box source/target ranges are exact and no particle sorting is needed.- Parameters:
box_tree – The
BoxTreeto convert.q_points_host – Quadrature nodes on the host, shape
(nnodes, dim), laid out leaf box by leaf box inbox_treeleaf order.