|
230 | 230 | @test ch.localizer[3] == 1 |
231 | 231 | @test ch.localizer[4] == 2 |
232 | 232 | end |
| 233 | + |
| 234 | +@testitem "precrack bond system with filter" begin |
| 235 | + # setup |
| 236 | + position = [0.0 1.0 0.0 0.0 |
| 237 | + 0.0 0.0 1.0 0.0 |
| 238 | + 0.0 0.0 0.0 1.0] |
| 239 | + volume = [1.1, 1.2, 1.3, 1.4] |
| 240 | + mat = CKIMaterial() |
| 241 | + body = Body(mat, position, volume) |
| 242 | + material!(body, horizon=2, rho=1, E=1, nu=0.25, Gc=1) |
| 243 | + point_set!(body, :set_a, 1:2) |
| 244 | + point_set!(body, :set_b, 3:4) |
| 245 | + precrack!(body, :set_a, :set_b; update_dmg=false) |
| 246 | + pd = Peridynamics.PointDecomposition(body, 2) |
| 247 | + |
| 248 | + # 1 |
| 249 | + system = Peridynamics.InteractionSystem(body, pd, 1) |
| 250 | + |
| 251 | + @test system.position == position[:, 1:2] |
| 252 | + @test system.volume == volume[1:2] |
| 253 | + @test system.one_nis == [ |
| 254 | + Peridynamics.Bond(2, 1.0, true), |
| 255 | + Peridynamics.Bond(1, 1.0, true), |
| 256 | + ] |
| 257 | + @test system.n_one_nis == [1, 1] |
| 258 | + @test system.one_ni_idxs == [1:1, 2:2] |
| 259 | + |
| 260 | + ch = system.chunk_handler |
| 261 | + @test ch.point_ids == [1, 2] |
| 262 | + @test ch.loc_points == [1, 2] |
| 263 | + @test ch.halo_points == Int[] |
| 264 | + @test ch.hidxs_by_src == Dict{Int,UnitRange{Int}}() |
| 265 | + for i in 1:2 |
| 266 | + @test ch.localizer[i] == i |
| 267 | + end |
| 268 | + |
| 269 | + # 2 |
| 270 | + system = Peridynamics.InteractionSystem(body, pd, 2) |
| 271 | + |
| 272 | + @test system.position == position[:, 3:4] |
| 273 | + @test system.volume == volume[3:4] |
| 274 | + @test system.one_nis == [ |
| 275 | + Peridynamics.Bond(2, √2, true), |
| 276 | + Peridynamics.Bond(1, √2, true), |
| 277 | + ] |
| 278 | + @test system.n_one_nis == [1, 1] |
| 279 | + @test system.one_ni_idxs == [1:1, 2:2] |
| 280 | + |
| 281 | + ch = system.chunk_handler |
| 282 | + @test ch.point_ids == [3, 4] |
| 283 | + @test ch.loc_points == [3, 4] |
| 284 | + @test ch.halo_points == Int[] |
| 285 | + @test ch.hidxs_by_src == Dict{Int,UnitRange{Int}}() |
| 286 | + @test ch.localizer[3] == 1 |
| 287 | + @test ch.localizer[4] == 2 |
| 288 | +end |
0 commit comments