|
1 | 1 | using CompScienceMeshes |
2 | | -using BEAST |
3 | | -using Test |
| 2 | +using Test, JLD2 |
4 | 3 | using GraphColoring |
5 | 4 | using SparseArrays |
6 | 5 | using Graphs |
7 | 6 |
|
| 7 | +conflictexamples = load( |
| 8 | + joinpath(pkgdir(GraphColoring), "test", "assets", "conflictexamples.jld2") |
| 9 | +)["conflictsdict"] |
8 | 10 | @testset "Color zones" begin |
9 | | - ms = [ |
10 | | - meshrectangle(1.0, 1.0, 0.1), |
11 | | - meshcuboid(1.0, 1.0, 1.0, 0.1), |
12 | | - CompScienceMeshes.readmesh( |
13 | | - joinpath(pkgdir(GraphColoring), "test", "assets", "in", "sphere.in") |
14 | | - ), |
15 | | - CompScienceMeshes.readmesh( |
16 | | - joinpath(pkgdir(GraphColoring), "test", "assets", "in", "multiplerects.in") |
17 | | - ), |
18 | | - CompScienceMeshes.readmesh( |
19 | | - joinpath(pkgdir(GraphColoring), "test", "assets", "in", "twospheres.in") |
20 | | - ), |
21 | | - ] |
| 11 | + ms = ["rectangle", "cuboid", "sphere", "multiplerects", "twospheres"] |
| 12 | + Xs = ["rt", "lagrangecxd0", "lagrangec0d1", "bc"] |
22 | 13 |
|
23 | 14 | for m in ms |
24 | | - for X in [raviartthomas(m), lagrangecxd0(m), lagrangec0d1(m), buffachristiansen(m)] |
25 | | - for s in [GraphColoring.conflictmatrix(X), GraphColoring.conflictgraph(X)] |
| 15 | + for X in Xs |
| 16 | + elements, conflictindices, conflictids = conflictexamples[(m, X)] |
| 17 | + conflicts = GraphColoring.ConflictFunctor(conflictindices) |
| 18 | + c = GraphColoring.PassThroughConflictFunctor(elements, conflicts, conflictids) |
| 19 | + for s in [GraphColoring.conflictmatrix(c), GraphColoring.conflictgraph(c)] |
26 | 20 | oddzones, evenzones = GraphColoring.partition(s) |
27 | 21 |
|
28 | 22 | for algorithm in [GraphColoring.DSATUR(), GraphColoring.Greedy()] |
|
0 commit comments