Skip to content

Commit 1f925ee

Browse files
committed
Added tests for ZEMWan
1 parent 109cdad commit 1f925ee

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

test/integration/b_int_correspondence.jl

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Internal force density correspondence" begin
1+
@testitem "Internal force density correspondence ZEMSilling" begin
22
ref_position = [0.0 1.0 0.0 0.0 2.0
33
0.0 0.0 1.0 0.0 2.0
44
0.0 0.0 0.0 1.0 2.0]
@@ -30,6 +30,38 @@
3030
@test b_int[:,5] [0.0, 0.0, 0.0]
3131
end
3232

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+
3365
@testitem "Internal force density correspondence interface" begin
3466
ref_position = [0.0 1.0 0.0 0.0 2.0
3567
0.0 0.0 1.0 0.0 2.0
@@ -94,3 +126,35 @@ end
94126
@test b_int[:,4] [4.978997086274901e-15, 1.2267494956589887e-15, -2.8600080143070235e-14]
95127
@test b_int[:,5] [0.0, 0.0, 0.0]
96128
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

Comments
 (0)