BEAST
The basis functions defined in BEAST.jl can be sorted into trees.
TwoNTree together with BEAST
For BEAST spaces, TwoNTree(space) and buildtree(space) use the builder workflow and resolve the default AutoProtrusionCheck() to ProtrusionCheck(; max=0.25, compute=BEASTProtrusionFunctor(space)). Use NoProtrusionCheck() to opt out, or pass an explicit ProtrusionCheck to choose another threshold.
For the Galerkin case:
using BEAST, CompScienceMeshes
using H2Trees
m = meshsphere(1.0, 0.1)
X = raviartthomas(m)
tree = TwoNTree(X; builder=TwoNTreeBuilder(; minhalfsize=0.0, minvalues=200))TwoNTree{3,Float64}
level nodes avg values avg children halfsize
1 1 4821.0 8.0 0.9975383534182404
2 8 602.62 7.0 0.4987691767091202
3 56 86.09 0.0 0.2493845883545601
For the Petrov-Galerkin case:
using BEAST, CompScienceMeshes
using H2Trees
using PlotlyJS
m = meshsphere(1.0, 0.1)
X = raviartthomas(m)
Y = buffachristiansen(m)
tree = buildtree(
X,
Y;
builder=BlockTreeBuilder(;
test=TwoNTreeBuilder(; minhalfsize=0.0, protrusion=ProtrusionCheck(; max=0.3)),
trial=TwoNTreeBuilder(; minhalfsize=0.0, protrusion=ProtrusionCheck(; max=0.3)),
),
)BlockTree(test=TwoNTree{3,Float64}(nodes=89, leaves=76, levels=2:5, root=1), trial=TwoNTree{3,Float64}(nodes=91, leaves=74, levels=1:4, root=1))The same BEAST-space entry point also accepts the clustering builders:
using BEAST, CompScienceMeshes
using H2Trees
using ParallelKMeans
m = meshsphere(1.0, 0.1)
X = lagrangecxd0(m)
tree = buildtree(X; builder=KMeansTreeBuilder())BoundingBallTree{3,Float64}
level nodes avg values avg children radius
1 1 3214.0 4.0 1.9544137260755616
2 4 803.5 4.0 1.2943704896768577
3 16 200.88 4.0 0.6907493896887219
4 64 50.22 0.0 0.3236778507834521
For METIS-based trees the graph is derived from the space by default, or can be passed explicitly with graphweights=(graph, weights):
using BEAST, CompScienceMeshes
using H2Trees
using Metis
m = meshsphere(1.0, 0.1)
X = lagrangecxd0(m)
tree = buildtree(X; builder=MetisTreeBuilder())
forest = buildforest(X; builder=MetisForestBuilder())Forest with 1 tree(s): 1385 total node(s), 1039 total leaves, levels 1:7
[1] BoundingBallTree{3,Float64}(nodes=1385, leaves=1039, levels=1:7, root=1)