Skip to content

Commit 85263bf

Browse files
committed
Fixed tests that broke due to change of the default model
1 parent 523ef67 commit 85263bf

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/physics/correspondence_rotated.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function CRMaterial(; kernel::Function=linear_kernel,
2727
model::AbstractConstitutiveModel=SaintVenantKirchhoff(),
2828
zem::AbstractZEMStabilization=ZEMSilling(),
2929
dmgmodel::AbstractDamageModel=CriticalStretch(), maxdmg::Real=0.85)
30-
if !(model <: Union{SaintVenantKirchhoff,LinearElastic})
31-
msg = "model `$(model)` is currently not supported for `CRMaterial`!\n"
30+
if !(typeof(model) <: Union{SaintVenantKirchhoff,LinearElastic})
31+
msg = "model `$(typeof(model))` is currently not supported for `CRMaterial`!\n"
3232
throw(ArgumentError(msg))
3333
end
3434
return CRMaterial(kernel, model, zem, dmgmodel, maxdmg)

src/physics/rk_correspondence_rotated.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function RKCRMaterial(; kernel::Function=cubic_b_spline_kernel,
2828
model::AbstractConstitutiveModel=SaintVenantKirchhoff(),
2929
dmgmodel::AbstractDamageModel=CriticalStretch(), maxdmg::Real=1.0,
3030
reprkernel::Symbol=:C1, regfactor::Real=1e-13)
31-
if !(model <: Union{SaintVenantKirchhoff,LinearElastic})
32-
msg = "model `$(model)` is currently not supported for `CRMaterial`!\n"
31+
if !(typeof(model) <: Union{SaintVenantKirchhoff,LinearElastic})
32+
msg = "model `$(typeof(model))` is currently not supported for `RKCRMaterial`!\n"
3333
throw(ArgumentError(msg))
3434
end
3535
get_q_dim(reprkernel) # check if the kernel is implemented

test/discretization/test_body.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ end
774774
MATERIAL
775775
material type ...................................................... CMaterial
776776
kernel function ................................................ linear_kernel
777-
constitutive model .............................. Peridynamics.LinearElastic()
777+
constitutive model ....................... Peridynamics.SaintVenantKirchhoff()
778778
zero-energy mode stabilization ................ Peridynamics.ZEMSilling(100.0)
779779
damage model type ............................... Peridynamics.CriticalStretch
780780
maximum damage .......................................................... 0.85
@@ -839,7 +839,7 @@ end
839839
MATERIAL
840840
material type .................................................... BACMaterial
841841
kernel function ................................................ linear_kernel
842-
constitutive model .............................. Peridynamics.LinearElastic()
842+
constitutive model ....................... Peridynamics.SaintVenantKirchhoff()
843843
damage model type ............................... Peridynamics.CriticalStretch
844844
maximum damage .......................................................... 0.85
845845
MATERIAL PROPERTIES #1

test/physics/test_correspondence_rotated.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@testitem "CRMaterial" begin
22
mat = CRMaterial()
3-
@test mat.constitutive_model isa LinearElastic
3+
@test mat.constitutive_model isa SaintVenantKirchhoff
44

55
@test_throws ArgumentError CRMaterial(model=NeoHookePenalty())
66

test/physics/test_rk_correspondence.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040
# Test default constructor
4141
mat1 = RKCMaterial()
4242
@test mat1.kernel == cubic_b_spline_kernel
43-
@test mat1.constitutive_model isa LinearElastic
43+
@test mat1.constitutive_model isa SaintVenantKirchhoff
4444
@test mat1.dmgmodel isa CriticalStretch
4545
@test mat1.maxdmg == 1.0
4646
@test mat1.reprkernel == :C1
@@ -49,14 +49,14 @@ end
4949
# Test constructor with parameters
5050
mat2 = RKCMaterial(
5151
kernel = linear_kernel,
52-
model = SaintVenantKirchhoff(),
52+
model = LinearElastic(),
5353
dmgmodel = CriticalStretch(),
5454
maxdmg = 0.75,
5555
reprkernel = :C1,
5656
regfactor = 1e-10
5757
)
5858
@test mat2.kernel == linear_kernel
59-
@test mat2.constitutive_model isa SaintVenantKirchhoff
59+
@test mat2.constitutive_model isa LinearElastic
6060
@test mat2.dmgmodel isa CriticalStretch
6161
@test mat2.maxdmg == 0.75
6262
@test mat2.reprkernel == :C1
@@ -71,13 +71,13 @@ end
7171
# Test default constructor
7272
mat1 = RKCRMaterial()
7373
@test mat1.kernel == cubic_b_spline_kernel
74-
@test mat1.constitutive_model isa LinearElastic
74+
@test mat1.constitutive_model isa SaintVenantKirchhoff
7575
@test mat1.dmgmodel isa CriticalStretch
7676
@test mat1.maxdmg == 1.0
7777
@test mat1.reprkernel == :C1
7878
@test mat1.regfactor == 1e-13
7979

80-
# Test constructor with parameters (only LinearElastic is supported)
80+
# Test constructor with parameters (only linear elastic models are supported)
8181
mat2 = RKCRMaterial(
8282
kernel = linear_kernel,
8383
model = LinearElastic(),
@@ -94,7 +94,7 @@ end
9494
@test mat2.regfactor == 1e-10
9595

9696
# Test failure with non-LinearElastic model
97-
@test_throws ArgumentError RKCRMaterial(model = SaintVenantKirchhoff())
97+
@test_throws ArgumentError RKCRMaterial(model = NeoHooke())
9898

9999
# Test constructor with invalid regfactor
100100
@test_throws ArgumentError RKCRMaterial(regfactor = 2.0)

0 commit comments

Comments
 (0)