Skip to content

Commit e205698

Browse files
committed
Added tests of the material limitation of the NewtonRaphson solver
1 parent 5993566 commit e205698

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/time_solvers/test_newton_raphson.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,3 +503,37 @@ end
503503
job = Job(body, nr)
504504
@test_throws ErrorException submit(job)
505505
end
506+
507+
@testitem "Material limitation errors" begin
508+
using Peridynamics: NewtonRaphson, displacement_bc!
509+
510+
## CRMaterial should not work with NewtonRaphson
511+
position = [0.0 1.0 0.0 0.0
512+
0.0 0.0 1.0 0.0
513+
0.0 0.0 0.0 1.0]
514+
volume = [1.0, 1.0, 1.0, 1.0]
515+
body = Body(CRMaterial(), position, volume)
516+
material!(body, horizon=2, rho=1, E=1, nu=0.25)
517+
point_set!(body, :top, [4])
518+
point_set!(body, :bottom, [1])
519+
displacement_bc!(p -> 0.1, body, :top, :y)
520+
displacement_bc!(p -> 0.0, body, :bottom, :x)
521+
displacement_bc!(p -> 0.0, body, :bottom, :y)
522+
displacement_bc!(p -> 0.0, body, :bottom, :z)
523+
nr = NewtonRaphson(steps=10, stepsize=0.1, maxiter=2, tol=1e-6)
524+
job = Job(body, nr)
525+
@test_throws ArgumentError submit(job)
526+
527+
## RKCRMaterial should not work with NewtonRaphson
528+
body = Body(RKCRMaterial(), position, volume)
529+
material!(body, horizon=2, rho=1, E=1, nu=0.25)
530+
point_set!(body, :top, [4])
531+
point_set!(body, :bottom, [1])
532+
displacement_bc!(p -> 0.1, body, :top, :y)
533+
displacement_bc!(p -> 0.0, body, :bottom, :x)
534+
displacement_bc!(p -> 0.0, body, :bottom, :y)
535+
displacement_bc!(p -> 0.0, body, :bottom, :z)
536+
nr = NewtonRaphson(steps=10, stepsize=0.1, maxiter=2, tol=1e-6)
537+
job = Job(body, nr)
538+
@test_throws ArgumentError submit(job)
539+
end

0 commit comments

Comments
 (0)