Disaggregate Translate Plan
DisaggregateTranslatePlan describes disaggregation traversal together with translations. It specifies which disaggregation nodes are visited and, for each receiving node, which translating nodes contribute to it.
This is a translating disaggregation plan. Its counterpart for a matrix-vector product is AggregatePlan.
Building a DisaggregateTranslatePlan
Conceptually, DisaggregateTranslatePlan is built from a tree and a translating-nodes iterator. There are two supported forms:
DisaggregateTranslatePlan(tree, TranslatingNodesIterator)DisaggregateTranslatePlan(testtree, trialtree, TranslatingNodesIterator)
Single-tree form:
TranslatingNodesIterator(node)provides translating nodes for receiving nodenodein the same tree.
Two-tree form:
- the plan is built on
testtree, so receiving/disaggregation nodes in the plan aretesttreenodes, - translating nodes are selected with respect to
trialtree, - each value
translatingnodes[level][receivingnode]is a vector of translating nodes fromtrialtree.
Nodes are visited if they receive translated data directly, or if an ancestor does. This keeps the downward traversal complete for all translated contributions.
Fields
A DisaggregateTranslatePlan stores:
translatingnodes: per-level dictionary mapping receiving nodes to translating nodes. In two-tree form: keys are receiving nodes intesttree; values are translating nodes intrialtree.nodes: disaggregation nodes grouped by level; these are nodes in the disaggregation tree (two-tree form:testtree).levels: contiguous disaggregation levels, ordered root-to-leaves.isdisaggregationnode: booleans over disaggregation-tree node indices indicating whether a node is reached by disaggregation traversal.rootoffset: offset used to convert nodes to compact 1-based indices.tree: the tree associated with the plan (two-tree form:testtree).
Example
The example below constructs Galerkin plans in AggregateMode() and extracts the test-side DisaggregateTranslatePlan.
plans = H2Trees.buildplans(
tree;
builder=H2Trees.PlanBuilder(;
isnear=H2Trees.isnear(; additionalbufferboxes=1),
aggregationmode=H2Trees.AggregateMode(),
),
)
disaggregatetranslateplan = plans.testdisaggregationplan
disaggregatetranslateplanDisaggregateTranslatePlan{TwoNTree{3, BoxData{3, Float64}, Float64, Base.RefValue{TreeIndex}}}([Dict(22 => [10, 11, 12, 13, 31, 32, 33, 35, 36, 37 … 43, 44, 45, 48, 59, 60, 62, 63, 64, 65], 10 => [19, 20, 21, 22, 24, 25, 26, 27, 28, 29 … 53, 54, 55, 56, 57, 58, 59, 60, 64, 65], 38 => [10, 11, 13, 14, 15, 16, 17, 18, 19, 20 … 53, 54, 55, 56, 57, 58, 59, 61, 62, 65], 14 => [25, 26, 27, 28, 29, 30, 31, 32, 36, 37 … 44, 45, 46, 47, 48, 49, 50, 51, 54, 55], 42 => [10, 11, 13, 14, 15, 16, 17, 18, 19, 20 … 47, 48, 49, 50, 53, 54, 55, 56, 57, 58], 18 => [27, 28, 29, 30, 31, 32, 33, 35, 36, 37 … 43, 44, 45, 46, 47, 48, 49, 51, 64, 65], 63 => [17, 19, 20, 21, 22, 23, 24, 25, 26, 27 … 45, 46, 47, 48, 49, 50, 53, 54, 55, 56], 55 => [10, 11, 12, 13, 14, 15, 16, 17, 20, 21 … 43, 44, 45, 46, 47, 48, 62, 63, 64, 65], 62 => [17, 19, 20, 21, 22, 23, 24, 25, 26, 27 … 46, 47, 48, 49, 50, 51, 53, 54, 55, 56], 47 => [10, 11, 12, 13, 14, 15, 16, 17, 18, 19 … 56, 57, 58, 59, 60, 61, 62, 63, 64, 65]…), Dict(173 => [66, 70, 71, 72, 73, 75, 76, 77, 78, 79 … 209, 210, 211, 212, 213, 319, 320, 321, 322, 323], 107 => [66, 67, 68, 69, 70, 71, 72, 73, 74, 75 … 314, 315, 316, 317, 318, 319, 320, 321, 322, 323], 189 => [66, 67, 68, 69, 70, 71, 72, 73, 74, 75 … 237, 238, 239, 240, 241, 319, 320, 321, 322, 323], 274 => [105, 106, 107, 108, 109, 110, 111, 112, 113, 114 … 303, 304, 305, 306, 307, 308, 309, 310, 311, 312], 258 => [105, 106, 107, 108, 109, 110, 111, 112, 113, 114 … 292, 293, 294, 295, 296, 303, 304, 305, 306, 307], 91 => [72, 74, 75, 76, 77, 78, 80, 81, 82, 83 … 314, 315, 316, 317, 318, 319, 320, 321, 322, 323], 205 => [72, 73, 74, 75, 76, 154, 155, 156, 157, 158 … 320, 321, 322, 323, 324, 325, 326, 327, 328, 329], 306 => [72, 73, 74, 75, 76, 77, 78, 79, 80, 81 … 316, 317, 318, 319, 320, 321, 322, 323, 324, 327], 157 => [88, 89, 90, 91, 92, 116, 117, 118, 119, 120 … 259, 260, 261, 262, 263, 269, 270, 271, 272, 273], 125 => [83, 84, 85, 86, 87, 88, 89, 90, 91, 92 … 292, 293, 294, 295, 296, 308, 309, 310, 311, 312]…)], [[22, 10, 38, 14, 42, 18, 63, 55, 62, 47 … 45, 58, 49, 65, 31, 56, 29, 16, 36, 51], [173, 107, 189, 274, 258, 91, 205, 306, 157, 125 … 158, 231, 238, 216, 71, 129, 252, 85, 78, 245]], [[10, 11, 12, 13, 14, 15, 16, 17, 18, 19 … 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], [66, 67, 68, 69, 70, 71, 72, 73, 74, 75 … 320, 321, 322, 323, 324, 325, 326, 327, 328, 329]], 3:4, Bool[0, 0, 0, 0, 0, 0, 0, 0, 0, 1 … 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 0, TwoNTree{3,Float64}(nodes=329, leaves=272, levels=1:4, root=1))