|
108 | 108 | mesh = abaqus_read_mesh(fn) |
109 | 109 | @test length(mesh["nodes"]) == 116 |
110 | 110 | end |
| 111 | + |
| 112 | +@testset "Set names" begin |
| 113 | + data = """*Nset, nset=Without quotes |
| 114 | + 1,2,3 |
| 115 | + *Nset, nset="With quotes" |
| 116 | + 3,4,5 |
| 117 | + *Nset, nset="With wrong quotes |
| 118 | + 1,2,3 |
| 119 | + *Elset, elset=Without quotes |
| 120 | + 1,2,3 |
| 121 | + *Elset, elset="With quotes" |
| 122 | + 3,4,5 |
| 123 | + *Elset, elset="With wrong quotes |
| 124 | + 1,2,3 |
| 125 | + """ |
| 126 | + data = split(data, "\n") |
| 127 | + model = Dict{String, Any}() |
| 128 | + model["node_sets"] = Dict{String, Vector{Int}}() |
| 129 | + model["element_sets"] = Dict{String, Vector{Int}}() |
| 130 | + @test parse_section(model, data, :NSET, 1, 2, Val{:NSET}) == [1,2,3] |
| 131 | + @test parse_section(model, data, :NSET, 3, 4, Val{:NSET}) == [3,4,5] |
| 132 | + @test_throws ErrorException parse_section(model, data, :NSET, 5, 6, Val{:NSET}) |
| 133 | + @test keys(model["node_sets"]) == Set(["Without", "With quotes"]) |
| 134 | + @test parse_section(model, data, :ELSET, 7, 8, Val{:ELSET}) == [1,2,3] |
| 135 | + @test parse_section(model, data, :ELSET, 9, 10, Val{:ELSET}) == [3,4,5] |
| 136 | + @test_throws ErrorException parse_section(model, data, :ELSET, 11, 12, Val{:NSET}) |
| 137 | + @test keys(model["element_sets"]) == Set(["Without", "With quotes"]) |
| 138 | +end |
0 commit comments