Aggregate Plan
AggregatePlan describes the upward aggregation traversal on a tree. It specifies:
- which nodes are visited per level during aggregation,
- which node moments must be stored for later phases, and
This is a non-translating aggregation plan. Its counterpart for a matrix-vector product is DisaggregateTranslatePlan.
Building an AggregatePlan
Conceptually, AggregatePlan is built from a tree and a function aggregatenode(node).
- If
aggregatenode(node)istrue, that node is marked for storage. - If not, the node is still included in traversal when one of its ancestors is a storing node.
- Aggregation levels are organized from leaves toward the root.
This ensures aggregation paths remain complete for all moments that must be available later.
Fields
An AggregatePlan stores:
nodes: aggregation nodes grouped by level.levels: aggregation levels, ordered leaves-to-root.storenode: booleans indicating which node moments are stored.rootoffset: offset used to convert node ids to compact 1-based indices.tree: the tree associated with the plan.
Example
The example below constructs Galerkin plans in AggregateMode() and extracts the trial-side AggregatePlan.
plans = H2Trees.galerkinplans(tree, aggregatenode, tfiterator, H2Trees.AggregateMode())
aggregateplan = plans.trialaggregationplan
aggregateplanAggregatePlan{TwoNTree{3, BoxData{3, Float64}, Float64}}([[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
)