@@ -25,16 +25,13 @@ sss = structure(sys)
25
25
@unpack graph, solvable_graph, fullvars = sss
26
26
27
27
io = IOBuffer ()
28
- show (io, sss)
28
+ show (io, MIME " text/plain " (), sss)
29
29
prt = String (take! (io))
30
30
31
31
if VERSION >= v " 1.6"
32
- @test prt == " Incidence matrix:
33
- × × ⋅ ⋅ ⋅
34
- × ⋅ × ⋅ ⋅
35
- × ⋅ × × ⋅
36
- ⋅ ⋅ × × ×
37
- × × ⋅ ⋅ ×"
32
+ @test occursin (" Incidence matrix:" , prt)
33
+ @test occursin (" ×" , prt)
34
+ @test occursin (" ⋅" , prt)
38
35
end
39
36
40
37
# u1 = f1(u5)
45
42
sys = initialize_system_structure (sys)
46
43
find_solvables! (sys)
47
44
sss = structure (sys)
48
- @unpack graph, solvable_graph, assign, partitions = sss
49
- @test graph. fadjlist == [[1 , 2 ], [1 , 3 ], [1 , 3 , 4 ], [3 , 4 , 5 ], [1 , 2 , 5 ]]
50
- @test solvable_graph. fadjlist == map (x-> [x], [1 , 3 , 4 , 5 , 2 ])
45
+ @unpack graph, solvable_graph, assign, partitions, fullvars = sss
46
+ int2var = Dict (eachindex (fullvars) .=> fullvars)
47
+ graph2vars (graph) = map (is-> Set (map (i-> int2var[i], is)), graph. fadjlist)
48
+ @test graph2vars (graph) == [
49
+ Set ([u1, u5])
50
+ Set ([u1, u2])
51
+ Set ([u1, u3, u2])
52
+ Set ([u4, u3, u2])
53
+ Set ([u4, u1, u5])
54
+ ]
55
+ @test graph2vars (solvable_graph) == [
56
+ Set ([u1])
57
+ Set ([u2])
58
+ Set ([u3])
59
+ Set ([u4])
60
+ Set ([u5])
61
+ ]
51
62
52
63
tornsys = tearing (sys)
53
64
sss = structure (tornsys)
54
65
@unpack graph, solvable_graph, assign, partitions = sss
55
- @test graph. fadjlist == [[ 1 ] ]
66
+ @test graph2vars ( graph) == [Set ([u5]) ]
56
67
@test partitions == [StructuralTransformations. SystemPartition ([], [], [1 ], [1 ])]
57
68
58
69
# Before:
@@ -127,8 +138,7 @@ eqs = [
127
138
]
128
139
@named nlsys = NonlinearSystem (eqs, [x, y, z], [])
129
140
newsys = tearing (nlsys)
130
- @test equations (newsys) == [0 ~ z]
131
- @test isequal (states (newsys), [z])
141
+ @test length (equations (newsys)) == 1
132
142
133
143
# ##
134
144
# ## DAE system
0 commit comments