Skip to content

Commit 18e4e4c

Browse files
authored
Merge branch 'main' into robust-servedocs
2 parents d4637bf + eab5212 commit 18e4e4c

File tree

6 files changed

+84
-11
lines changed

6 files changed

+84
-11
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ LibGit2 = "1.8"
3030
LightXML = "0.9"
3131
LinearAlgebra = "1.8"
3232
MPI = "0.20.0"
33-
PointNeighbors = "0.4.5, 0.5"
33+
PointNeighbors = "0.5, 0.6"
3434
PrecompileTools = "1.0"
3535
Printf = "1.8"
3636
ProgressMeter = "1.0"

test/auxiliary/test_mpi.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ end
3535
job = Job(body, ts; path, freq=10)
3636
submit(job)
3737
"""
38-
cmd = `$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`
38+
mpiexec = Peridynamics.MPI.mpiexec()
39+
jlcmd = Base.julia_cmd()
40+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
41+
cmd = `$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`
3942
@test success(cmd) # does not print anything
4043
# for debugging use the run command:
4144
# run(cmd)

test/auxiliary/test_process_each_export.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@
7272
return nothing
7373
end
7474
"""
75-
run(`$(Peridynamics.MPI.mpiexec()) -n 3 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
75+
mpiexec = Peridynamics.MPI.mpiexec()
76+
jlcmd = Base.julia_cmd()
77+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
78+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
7679
file_1_mpi = joinpath(root_post_mpi, "max_displacement_1.txt")
7780
@test isfile(file_1_mpi)
7881
@test contains(read(file_1_mpi, String), "maximum displacement x: 0.0")

test/core/test_halo_exchange.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ end
316316
@test dh.chunk.storage.b_int[:,3:4] ≈ randbint[:,1:2]
317317
end
318318
"""
319-
cmd = `$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`
319+
mpiexec = Peridynamics.MPI.mpiexec()
320+
jlcmd = Base.julia_cmd()
321+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
322+
cmd = `$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`
320323
@test success(cmd) # does not print anything
321324
# for debugging use the run command:
322325
# run(cmd)
@@ -363,7 +366,10 @@ end
363366
@test dh.chunk.storage.position[:,1:2] ≈ position[:,1:2] + randpos[:,3:4]
364367
end
365368
"""
366-
cmd = `$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`
369+
mpiexec = Peridynamics.MPI.mpiexec()
370+
jlcmd = Base.julia_cmd()
371+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
372+
cmd = `$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`
367373
@test success(cmd) # does not print anything
368374
# for debugging use the run command:
369375
# run(cmd)

test/integration/mpi_threads_comparison.jl

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
end
4848
sim_bb(30, "$path_mpi")
4949
"""
50-
run(`$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
50+
mpiexec = Peridynamics.MPI.mpiexec()
51+
jlcmd = Base.julia_cmd()
52+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
53+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
5154

5255
@test isdir(path_threads_vtk)
5356
@test isdir(path_mpi_vtk)
@@ -112,7 +115,10 @@ end
112115
end
113116
sim_bb(30, "$path_mpi")
114117
"""
115-
run(`$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
118+
mpiexec = Peridynamics.MPI.mpiexec()
119+
jlcmd = Base.julia_cmd()
120+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
121+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
116122

117123
@test isdir(path_threads_vtk)
118124
@test isdir(path_mpi_vtk)
@@ -182,7 +188,10 @@ end
182188
end
183189
sim_bb(30, "$path_mpi")
184190
"""
185-
run(`$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
191+
mpiexec = Peridynamics.MPI.mpiexec()
192+
jlcmd = Base.julia_cmd()
193+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
194+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
186195

187196
@test isdir(path_threads_vtk)
188197
@test isdir(path_mpi_vtk)
@@ -247,7 +256,10 @@ end
247256
end
248257
sim_osb(30, "$path_mpi")
249258
"""
250-
run(`$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
259+
mpiexec = Peridynamics.MPI.mpiexec()
260+
jlcmd = Base.julia_cmd()
261+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
262+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
251263

252264
@test isdir(path_threads_vtk)
253265
@test isdir(path_mpi_vtk)
@@ -312,7 +324,10 @@ end
312324
end
313325
sim_cc(30, "$path_mpi")
314326
"""
315-
run(`$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
327+
mpiexec = Peridynamics.MPI.mpiexec()
328+
jlcmd = Base.julia_cmd()
329+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
330+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
316331

317332
@test isdir(path_threads_vtk)
318333
@test isdir(path_mpi_vtk)
@@ -378,7 +393,10 @@ end
378393
end
379394
sim_bac(30, "$path_mpi")
380395
"""
381-
run(`$(Peridynamics.MPI.mpiexec()) -n 2 $(Base.julia_cmd()) --project -e $(mpi_cmd)`)
396+
mpiexec = Peridynamics.MPI.mpiexec()
397+
jlcmd = Base.julia_cmd()
398+
pdir = normpath(joinpath(@__DIR__, "..", ".."))
399+
run(`$(mpiexec) -n 2 $(jlcmd) --project=$(pdir) -e $(mpi_cmd)`)
382400

383401
@test isdir(path_threads_vtk)
384402
@test isdir(path_mpi_vtk)

test/time_solvers/test_dynamic_relaxation.jl

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
@testitem "DynamicRelaxation wrong input" begin
2+
@test_throws ArgumentError DynamicRelaxation(steps=0)
3+
@test_throws ArgumentError DynamicRelaxation(steps=10, stepsize=0)
4+
@test_throws ArgumentError DynamicRelaxation(steps=10, damping_factor=0)
5+
end
6+
7+
@testitem "dynamic_relaxation_check" begin
8+
dr = DynamicRelaxation(steps=1)
9+
dr.n_steps = -1
10+
msg = "`n_steps` of DynamicRelaxation smaller than zero!\n"
11+
@test_throws ErrorException(msg) Peridynamics.dynamic_relaxation_check(dr)
12+
13+
dr = DynamicRelaxation(steps=1)
14+
dr.Δt = -1
15+
msg = "`Δt` of DynamicRelaxation smaller than zero!\n"
16+
@test_throws ErrorException(msg) Peridynamics.dynamic_relaxation_check(dr)
17+
18+
dr = DynamicRelaxation(steps=1)
19+
dr.Λ = -1
20+
msg = "`Λ` of DynamicRelaxation smaller than zero!\n"
21+
@test_throws ErrorException(msg) Peridynamics.dynamic_relaxation_check(dr)
22+
end
23+
24+
@testitem "_init_density_matrix" begin
25+
using Peridynamics
26+
position = [0.0 1.0 0.0 0.0
27+
0.0 0.0 0.0 1.0
28+
0.0 0.0 1.0 0.0]
29+
volume = fill(1.0, 4)
30+
body = Body(BBMaterial(), position, volume)
31+
material!(body; horizon=1.5, rho=8e-6, E=210e3)
32+
point_set!(body, :a, 1:2)
33+
material!(body, :a; horizon=1.5, rho=7.8e-6, E=200e3)
34+
35+
dr = DynamicRelaxation(steps=1)
36+
dh = Peridynamics.threads_data_handler(body, dr, 1)
37+
chunk = dh.chunks[1]
38+
Peridynamics._init_density_matrix!(chunk,dr,chunk.paramsetup)
39+
40+
@test chunk.storage.density_matrix [4.0e6 4.0e6 4.2e6 4.2e6
41+
4.0e6 4.0e6 4.2e6 4.2e6
42+
4.0e6 4.0e6 4.2e6 4.2e6]
43+
end
144

245
@testitem "show DynamicRelaxation" begin
346
io = IOBuffer()

0 commit comments

Comments
 (0)