Aggregate Translate Plan
AggregateTranslatePlan describes upward aggregation together with translations. It specifies not only which aggregation nodes are visited, but also which receiving nodes collect translated moments from those aggregation nodes.
This is a translating aggregation plan. Its counterpart for a matrix-vector product is DisaggregatePlan.
Building an AggregateTranslatePlan
Conceptually, AggregateTranslatePlan is built from a tree and a translating-nodes iterator. There are two supported forms:
AggregateTranslatePlan(tree, TranslatingNodesIterator)AggregateTranslatePlan(trialtree, testtree, TranslatingNodesIterator)
Single-tree form:
TranslatingNodesIterator(node)provides receiving nodes in the same tree.
Two-tree form:
- the plan is built on
trialtree, so aggregation/source nodes in the plan aretrialtreenodes, - receiving nodes are selected with respect to
testtree - each value
receivingnodes[level][trialnode]is a vector of translating nodes fromtesttree.
Nodes are visited if they translate directly, or if an ancestor translates. This keeps the upward traversal complete for all translating contributions.
Fields
An AggregateTranslatePlan stores:
receivingnodes: per-level dictionary mapping receiving nodes to translating nodes. (two-tree form: keys are receiving nodes intesttree; values are translating nodes intrialtree).nodes: aggregation nodes grouped by level; these are nodes in the aggregation tree (two-tree form:trialtree).levels: aggregation levels, ordered leaves-to-root.istranslatingnode: booleans over aggregation-tree node indices indicating whether a node contributes as translating node (two-tree form:trialtree).rootoffset: offset used to convert nodes to compact 1-based indices.tree: the tree associated with the plan (two-tree form:trialtree).
Example
The example below constructs Galerkin plans in AggregateTranslateMode() and extracts the trial-side AggregateTranslatePlan.
plans = H2Trees.galerkinplans(tree, aggregatenode, tfiterator, H2Trees.AggregateTranslateMode())
aggregatetranslateplan = plans.trialaggregationplan
aggregatetranslateplanAggregateTranslatePlan{TwoNTree{3, BoxData{3, Float64}, Float64}}([Dict(56 => [41, 42, 43, 44, 46, 47, 107, 108, 109, 110 … 756, 757, 758, 767, 768, 769, 770, 771, 772, 773], 425 => [376, 377, 378, 379, 380, 381, 382, 390, 391, 393 … 438, 439, 440, 505, 506, 507, 508, 509, 510, 511], 429 => [376, 377, 378, 379, 380, 381, 382, 397, 398, 399 … 440, 441, 442, 505, 506, 507, 508, 509, 510, 511], 60 => [11, 12, 13, 14, 15, 16, 17, 42, 43, 107, 108, 110, 112, 113, 756, 757, 758, 759, 760, 761], 220 => [226, 227, 229, 250, 251, 252, 253, 254, 265, 266 … 298, 299, 300, 301, 339, 340, 341, 342, 343, 344], 719 => [621, 622, 623, 624, 625, 626, 726, 727, 728, 729 … 792, 793, 794, 798, 799, 800, 801, 802, 803, 804], 734 => [621, 622, 623, 624, 625, 626, 717, 719, 767, 768, 769, 770, 771, 772, 773, 798, 799, 801, 803, 804], 699 => [613, 614, 615, 616, 617, 618, 619, 621, 622, 623 … 689, 690, 691, 692, 726, 727, 728, 729, 730, 731], 673 => [127, 128, 129, 130, 131, 132, 613, 614, 615, 616 … 688, 689, 690, 691, 692, 699, 700, 701, 704, 705], 319 => [225, 226, 227, 228, 229, 230, 325, 327, 328, 329 … 390, 391, 392, 393, 394, 398, 399, 400, 401, 402]…), Dict(35 => [5, 6, 48, 49, 52, 59, 67, 69, 70, 73 … 764, 765, 766, 774, 796, 797, 805, 806, 807, 808], 797 => [19, 27, 28, 35, 36, 38, 39, 40, 48, 49 … 697, 698, 706, 707, 708, 711, 744, 745, 755, 764], 711 => [19, 27, 28, 35, 36, 38, 39, 40, 48, 49 … 778, 779, 786, 787, 796, 797, 805, 806, 807, 808], 308 => [5, 6, 7, 8, 9, 10, 19, 27, 28, 35 … 435, 443, 445, 446, 454, 455, 456, 530, 537, 538], 67 => [6, 7, 8, 9, 19, 28, 35, 36, 38, 75 … 764, 765, 766, 774, 775, 777, 778, 779, 786, 787], 808 => [19, 27, 28, 35, 36, 38, 39, 40, 48, 49 … 744, 745, 747, 755, 763, 764, 765, 775, 777, 778], 215 => [5, 6, 7, 8, 9, 10, 19, 27, 28, 35 … 576, 583, 591, 592, 593, 629, 630, 631, 632, 640], 73 => [5, 6, 7, 8, 9, 10, 19, 27, 28, 35 … 764, 765, 766, 774, 775, 777, 778, 779, 786, 787], 115 => [5, 6, 7, 8, 9, 10, 19, 27, 28, 35 … 677, 685, 686, 693, 694, 744, 745, 746, 747, 755], 404 => [5, 6, 7, 8, 9, 10, 19, 27, 28, 35 … 592, 593, 594, 599, 607, 777, 778, 779, 786, 787]…), Dict(695 => [3, 4, 18, 37, 66, 76, 80, 101, 156, 157 … 407, 410, 430, 444, 487, 501, 502, 514, 546, 560], 501 => [3, 4, 18, 37, 51, 66, 72, 76, 80, 101 … 628, 647, 661, 662, 676, 695, 710, 743, 762, 809], 724 => [3, 4, 66, 76, 80, 101, 142, 156, 157, 171 … 272, 278, 306, 320, 321, 335, 373, 387, 546, 560], 444 => [3, 66, 72, 80, 101, 142, 156, 157, 171, 175 … 546, 560, 561, 575, 628, 647, 661, 662, 676, 695], 272 => [3, 4, 18, 37, 51, 66, 72, 101, 142, 156 … 662, 676, 695, 710, 724, 743, 762, 776, 795, 809], 320 => [3, 37, 51, 66, 72, 80, 101, 142, 156, 157 … 662, 676, 695, 710, 724, 743, 762, 776, 795, 809], 762 => [80, 101, 142, 156, 157, 171, 175, 178, 213, 257 … 502, 514, 546, 560, 561, 575, 628, 647, 661, 662], 4 => [142, 156, 157, 171, 175, 178, 257, 258, 272, 278 … 628, 647, 661, 662, 676, 695, 710, 724, 795, 809], 575 => [3, 4, 18, 37, 51, 66, 76, 101, 156, 306 … 430, 444, 487, 501, 710, 743, 762, 776, 795, 809], 661 => [3, 4, 18, 37, 51, 66, 76, 80, 101, 156 … 487, 501, 502, 514, 546, 560, 762, 776, 795, 809]…)], [[11, 12, 13, 14, 15, 16, 17, 20, 21, 22 … 792, 793, 794, 798, 799, 800, 801, 802, 803, 804], [5, 6, 7, 8, 9, 10, 19, 27, 28, 35 … 778, 779, 786, 787, 796, 797, 805, 806, 807, 808], [3, 4, 18, 37, 51, 66, 72, 76, 80, 101 … 662, 676, 695, 710, 724, 743, 762, 776, 795, 809]], 5:-1:3, Bool[0, 0, 1, 1, 1, 1, 1, 1, 1, 1 … 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 0, TwoNTree{3, BoxData{3, Float64}, Float64}
level: 1 with 1 node(s) with on average 18750.0 points and 8.0 children and halfsize: 0.9995217120782627
- level: 2 with 8 node(s) with on average 2343.75 points and 7.0 children and halfsize: 0.49976085603913134
-- level: 3 with 56 node(s) with on average 334.82 points and 4.71 children and halfsize: 0.24988042801956567
--- level: 4 with 264 node(s) with on average 69.39 points and 1.82 children and halfsize: 0.12494021400978284
---- level: 5 with 480 node(s) with on average 16.59 points and 0.0 children and halfsize: 0.06247010700489142
)