|
1 | | -@testitem "Internal force density correspondence" begin |
| 1 | +@testitem "Internal force density correspondence ZEMSilling" begin |
2 | 2 | ref_position = [0.0 1.0 0.0 0.0 2.0 |
3 | 3 | 0.0 0.0 1.0 0.0 2.0 |
4 | 4 | 0.0 0.0 0.0 1.0 2.0] |
|
30 | 30 | @test b_int[:,5] ≈ [0.0, 0.0, 0.0] |
31 | 31 | end |
32 | 32 |
|
| 33 | +@testitem "Internal force density correspondence ZEMWan" begin |
| 34 | + ref_position = [0.0 1.0 0.0 0.0 2.0 |
| 35 | + 0.0 0.0 1.0 0.0 2.0 |
| 36 | + 0.0 0.0 0.0 1.0 2.0] |
| 37 | + volume = fill(1.0, 5) |
| 38 | + δ = 1.5 |
| 39 | + body = Body(CMaterial(model=MooneyRivlin(), zem=ZEMWan()), ref_position, volume) |
| 40 | + material!(body, horizon=δ, rho=1, E=1, nu=0.25, Gc=1.0) |
| 41 | + no_failure!(body) |
| 42 | + |
| 43 | + dh = Peridynamics.threads_data_handler(body, VelocityVerlet(steps=1), 1) |
| 44 | + chunk = dh.chunks[1] |
| 45 | + (; mat, storage, system, paramsetup) = chunk |
| 46 | + params = paramsetup |
| 47 | + (; position, b_int) = storage |
| 48 | + |
| 49 | + @test position == ref_position |
| 50 | + @test b_int == zeros(3, 5) |
| 51 | + |
| 52 | + # Boundary Condition: |
| 53 | + # Point 2 with v_z = 1 m/s with Δt = 0.0015 s |
| 54 | + position[1, 2] = 1.0015 |
| 55 | + |
| 56 | + Peridynamics.calc_force_density!(chunk, 0, 0) |
| 57 | + |
| 58 | + @test b_int[:,1] ≈ [0.007185432432164514, 0.0023974081843325646, 0.0023974081843347313] |
| 59 | + @test b_int[:,2] ≈ [-0.007185432432123352, -9.047513544240966e-15, -6.0453612662025915e-15] |
| 60 | + @test b_int[:,3] ≈ [-2.077199268438824e-14, -0.002397408184361381, 3.2228109102914035e-14] |
| 61 | + @test b_int[:,4] ≈ [-2.0389697546832128e-14, 3.786380931014577e-14, -0.002397408184360914] |
| 62 | + @test b_int[:,5] ≈ [0.0, 0.0, 0.0] |
| 63 | +end |
| 64 | + |
33 | 65 | @testitem "Internal force density correspondence interface" begin |
34 | 66 | ref_position = [0.0 1.0 0.0 0.0 2.0 |
35 | 67 | 0.0 0.0 1.0 0.0 2.0 |
|
94 | 126 | @test b_int[:,4] ≈ [4.978997086274901e-15, 1.2267494956589887e-15, -2.8600080143070235e-14] |
95 | 127 | @test b_int[:,5] ≈ [0.0, 0.0, 0.0] |
96 | 128 | end |
| 129 | + |
| 130 | +@testitem "Internal force density correspondence rotated ZEMWan" begin |
| 131 | + ref_position = [0.0 1.0 0.0 0.0 2.0 |
| 132 | + 0.0 0.0 1.0 0.0 2.0 |
| 133 | + 0.0 0.0 0.0 1.0 2.0] |
| 134 | + volume = fill(1.0, 5) |
| 135 | + δ = 1.5 |
| 136 | + body = Body(CRMaterial(model=LinearElastic(), zem=ZEMWan()), ref_position, volume) |
| 137 | + material!(body, horizon=δ, rho=1, E=1, nu=0.25, Gc=1.0) |
| 138 | + no_failure!(body) |
| 139 | + |
| 140 | + dh = Peridynamics.threads_data_handler(body, VelocityVerlet(steps=1), 1) |
| 141 | + chunk = dh.chunks[1] |
| 142 | + (; mat, storage, system, paramsetup) = chunk |
| 143 | + params = paramsetup |
| 144 | + (; position, b_int) = storage |
| 145 | + |
| 146 | + @test position == ref_position |
| 147 | + @test b_int == zeros(3, 5) |
| 148 | + |
| 149 | + # Boundary Condition: |
| 150 | + # Point 2 with v_z = 1 m/s with Δt = 0.0015 s |
| 151 | + position[1, 2] = 1.0015 |
| 152 | + |
| 153 | + Peridynamics.calc_force_density!(chunk, 0, 0) |
| 154 | + |
| 155 | + @test b_int[:,1] ≈ [7.105427357601002e-16, 1.5206787245922409e-15, 1.9710800241257256e-15] |
| 156 | + @test b_int[:,2] ≈ [-5.329070518200751e-16, 1.3758314660245038e-15, 1.5633181769341484e-15] |
| 157 | + @test b_int[:,3] ≈ [2.1581533343596185e-17, -2.4591894988755905e-15, -6.50044234103052e-16] |
| 158 | + @test b_int[:,4] ≈ [-1.992172172836213e-16, -4.373206917411543e-16, -2.884353966956822e-15] |
| 159 | + @test b_int[:,5] ≈ [0.0, 0.0, 0.0] |
| 160 | +end |
0 commit comments