Skip to content

Commit fd81086

Browse files
authored
Merge branch 'main' into open-boundaries-nhs-fix-patch-2
2 parents 63b60a1 + 74ac372 commit fd81086

File tree

7 files changed

+305
-339
lines changed

7 files changed

+305
-339
lines changed

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1313
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
1414
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1515
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
16+
TrixiTest = "0a316866-cbd0-4425-8bcb-08103b2c1f26"
1617

1718
[compat]
1819
CSV = "0.10"
@@ -25,3 +26,4 @@ OrdinaryDiffEq = "6.49"
2526
Plots = "1"
2627
Polyester = "0.7"
2728
QuadGK = "2"
29+
TrixiTest = "0.1"

test/examples/dam_break_2d_corrections.jl

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,17 @@
6161
)
6262

6363
@testset "continuity_reinit" begin
64-
@test_nowarn_mod trixi_include(@__MODULE__,
65-
joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
66-
fluid_particle_spacing=particle_spacing,
67-
smoothing_length=1.5 * particle_spacing,
68-
boundary_density_calculator=ContinuityDensity(),
69-
fluid_density_calculator=ContinuityDensity(),
70-
correction=nothing, use_reinit=true,
71-
prefix="continuity_reinit", tspan=tspan,
72-
fluid_density=fluid_density,
73-
density_diffusion=nothing)
64+
@trixi_test_nowarn trixi_include(@__MODULE__,
65+
joinpath(examples_dir(), "fluid",
66+
"dam_break_2d.jl"),
67+
fluid_particle_spacing=particle_spacing,
68+
smoothing_length=1.5 * particle_spacing,
69+
boundary_density_calculator=ContinuityDensity(),
70+
fluid_density_calculator=ContinuityDensity(),
71+
correction=nothing, use_reinit=true,
72+
prefix="continuity_reinit", tspan=tspan,
73+
fluid_density=fluid_density,
74+
density_diffusion=nothing)
7475

7576
@test sol.retcode == ReturnCode.Success
7677
@test count_rhs_allocations(sol, semi) == 0
@@ -85,20 +86,21 @@
8586
println("="^100)
8687
println("fluid/dam_break_2d.jl with ", correction_name)
8788

88-
@test_nowarn_mod trixi_include(@__MODULE__,
89-
joinpath(examples_dir(), "fluid", "dam_break_2d.jl"),
90-
fluid_particle_spacing=particle_spacing,
91-
smoothing_length=smoothing_length,
92-
boundary_density_calculator=SummationDensity(),
93-
fluid_density_calculator=fluid_density_calculator,
94-
correction=correction, use_reinit=false,
95-
clip_negative_pressure=(fluid_density_calculator isa
96-
SummationDensity),
97-
smoothing_kernel=smoothing_kernel,
98-
prefix="$(correction_name)", tspan=tspan,
99-
fluid_density=fluid_density,
100-
density_diffusion=nothing,
101-
boundary_layers=5, sol=nothing)
89+
@trixi_test_nowarn trixi_include(@__MODULE__,
90+
joinpath(examples_dir(), "fluid",
91+
"dam_break_2d.jl"),
92+
fluid_particle_spacing=particle_spacing,
93+
smoothing_length=smoothing_length,
94+
boundary_density_calculator=SummationDensity(),
95+
fluid_density_calculator=fluid_density_calculator,
96+
correction=correction, use_reinit=false,
97+
clip_negative_pressure=(fluid_density_calculator isa
98+
SummationDensity),
99+
smoothing_kernel=smoothing_kernel,
100+
prefix="$(correction_name)", tspan=tspan,
101+
fluid_density=fluid_density,
102+
density_diffusion=nothing,
103+
boundary_layers=5, sol=nothing)
102104

103105
# Some correction methods require very small time steps at the beginning of the simulation.
104106
# An adaptive time integrator makes this easier and faster.

test/examples/examples.jl

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,92 +5,92 @@
55

66
@testset verbose=true "Solid" begin
77
@trixi_testset "solid/oscillating_beam_2d.jl" begin
8-
@test_nowarn_mod trixi_include(@__MODULE__,
9-
joinpath(examples_dir(), "solid",
10-
"oscillating_beam_2d.jl"),
11-
tspan=(0.0, 0.1))
8+
@trixi_test_nowarn trixi_include(@__MODULE__,
9+
joinpath(examples_dir(), "solid",
10+
"oscillating_beam_2d.jl"),
11+
tspan=(0.0, 0.1))
1212
@test sol.retcode == ReturnCode.Success
1313
@test count_rhs_allocations(sol, semi) == 0
1414
end
1515
end
1616

1717
@testset verbose=true "FSI" begin
1818
@trixi_testset "fsi/falling_water_column_2d.jl" begin
19-
@test_nowarn_mod trixi_include(@__MODULE__,
20-
joinpath(examples_dir(), "fsi",
21-
"falling_water_column_2d.jl"),
22-
tspan=(0.0, 0.4))
19+
@trixi_test_nowarn trixi_include(@__MODULE__,
20+
joinpath(examples_dir(), "fsi",
21+
"falling_water_column_2d.jl"),
22+
tspan=(0.0, 0.4))
2323
@test sol.retcode == ReturnCode.Success
2424
@test count_rhs_allocations(sol, semi) == 0
2525
end
2626

2727
@trixi_testset "fsi/dam_break_plate_2d.jl" begin
2828
# Use rounded dimensions to avoid warnings
29-
@test_nowarn_mod trixi_include(@__MODULE__,
30-
joinpath(examples_dir(), "fsi",
31-
"dam_break_plate_2d.jl"),
32-
initial_fluid_size=(0.15, 0.29),
33-
tspan=(0.0, 0.4),
34-
dtmax=1e-3)
29+
@trixi_test_nowarn trixi_include(@__MODULE__,
30+
joinpath(examples_dir(), "fsi",
31+
"dam_break_plate_2d.jl"),
32+
initial_fluid_size=(0.15, 0.29),
33+
tspan=(0.0, 0.4),
34+
dtmax=1e-3)
3535
@test sol.retcode == ReturnCode.Success
3636
@test count_rhs_allocations(sol, semi) == 0
3737
end
3838

3939
@trixi_testset "fsi/dam_break_gate_2d.jl" begin
40-
@test_nowarn_mod trixi_include(@__MODULE__,
41-
joinpath(examples_dir(), "fsi",
42-
"dam_break_gate_2d.jl"),
43-
tspan=(0.0, 0.4),
44-
dtmax=1e-3)
40+
@trixi_test_nowarn trixi_include(@__MODULE__,
41+
joinpath(examples_dir(), "fsi",
42+
"dam_break_gate_2d.jl"),
43+
tspan=(0.0, 0.4),
44+
dtmax=1e-3)
4545
@test sol.retcode == ReturnCode.Success
4646
@test count_rhs_allocations(sol, semi) == 0
4747
end
4848

4949
@trixi_testset "fsi/falling_spheres_2d.jl" begin
50-
@test_nowarn_mod trixi_include(@__MODULE__,
51-
joinpath(examples_dir(), "fsi",
52-
"falling_spheres_2d.jl"),
53-
tspan=(0.0, 1.0))
50+
@trixi_test_nowarn trixi_include(@__MODULE__,
51+
joinpath(examples_dir(), "fsi",
52+
"falling_spheres_2d.jl"),
53+
tspan=(0.0, 1.0))
5454
@test sol.retcode == ReturnCode.Success
5555
@test count_rhs_allocations(sol, semi) == 0
5656
end
5757
end
5858

5959
@testset verbose=true "N-Body" begin
6060
@trixi_testset "n_body/n_body_solar_system.jl" begin
61-
@test_nowarn_mod trixi_include(@__MODULE__,
62-
joinpath(examples_dir(), "n_body",
63-
"n_body_solar_system.jl"))
61+
@trixi_test_nowarn trixi_include(@__MODULE__,
62+
joinpath(examples_dir(), "n_body",
63+
"n_body_solar_system.jl"))
6464
@test sol.retcode == ReturnCode.Success
6565
@test count_rhs_allocations(sol, semi) == 0
6666
end
6767

6868
@trixi_testset "n_body/n_body_benchmark_trixi.jl" begin
69-
@test_nowarn_mod trixi_include(@__MODULE__,
70-
joinpath(examples_dir(), "n_body",
71-
"n_body_benchmark_trixi.jl")) [
69+
@trixi_test_nowarn trixi_include(@__MODULE__,
70+
joinpath(examples_dir(), "n_body",
71+
"n_body_benchmark_trixi.jl")) [
7272
r"WARNING: Method definition interact!.*\n"
7373
]
7474
end
7575

7676
@trixi_testset "n_body/n_body_benchmark_reference.jl" begin
77-
@test_nowarn_mod trixi_include(@__MODULE__,
78-
joinpath(examples_dir(), "n_body",
79-
"n_body_benchmark_reference.jl"))
77+
@trixi_test_nowarn trixi_include(@__MODULE__,
78+
joinpath(examples_dir(), "n_body",
79+
"n_body_benchmark_reference.jl"))
8080
end
8181

8282
@trixi_testset "n_body/n_body_benchmark_reference_faster.jl" begin
83-
@test_nowarn_mod trixi_include(joinpath(examples_dir(), "n_body",
84-
"n_body_benchmark_reference_faster.jl"))
83+
@trixi_test_nowarn trixi_include(joinpath(examples_dir(), "n_body",
84+
"n_body_benchmark_reference_faster.jl"))
8585
end
8686
end
8787

8888
@testset verbose=true "Postprocessing" begin
8989
@trixi_testset "postprocessing/interpolation_plane.jl" begin
90-
@test_nowarn_mod trixi_include(@__MODULE__,
91-
joinpath(examples_dir(), "postprocessing",
92-
"interpolation_plane.jl"),
93-
tspan=(0.0, 0.01)) [
90+
@trixi_test_nowarn trixi_include(@__MODULE__,
91+
joinpath(examples_dir(), "postprocessing",
92+
"interpolation_plane.jl"),
93+
tspan=(0.0, 0.01)) [
9494
r"WARNING: importing deprecated binding Makie.*\n",
9595
r"WARNING: using deprecated binding Colors.*\n",
9696
r"WARNING: using deprecated binding PlotUtils.*\n",
@@ -101,50 +101,51 @@
101101
@test sol.retcode == ReturnCode.Success
102102
end
103103
@trixi_testset "postprocessing/interpolation_point_line.jl" begin
104-
@test_nowarn_mod trixi_include(@__MODULE__,
105-
joinpath(examples_dir(), "postprocessing",
106-
"interpolation_point_line.jl"))
104+
@trixi_test_nowarn trixi_include(@__MODULE__,
105+
joinpath(examples_dir(), "postprocessing",
106+
"interpolation_point_line.jl"))
107107
@test sol.retcode == ReturnCode.Success
108108
end
109109
@trixi_testset "postprocessing/postprocessing.jl" begin
110-
@test_nowarn_mod trixi_include(@__MODULE__,
111-
joinpath(examples_dir(),
112-
"postprocessing",
113-
"postprocessing.jl"))
110+
@trixi_test_nowarn trixi_include(@__MODULE__,
111+
joinpath(examples_dir(),
112+
"postprocessing",
113+
"postprocessing.jl"))
114114
@test sol.retcode == ReturnCode.Success
115115
end
116116
end
117117

118118
@testset verbose=true "Preprocessing" begin
119119
@trixi_testset "preprocessing/packing_2d.jl" begin
120-
@test_nowarn_mod trixi_include(@__MODULE__,
121-
joinpath(examples_dir(), "preprocessing",
122-
"packing_2d.jl"))
120+
@trixi_test_nowarn trixi_include(@__MODULE__,
121+
joinpath(examples_dir(), "preprocessing",
122+
"packing_2d.jl"))
123123
@test sol.retcode == ReturnCode.Terminated
124124
end
125125
@trixi_testset "preprocessing/packing_2d.jl validation" begin
126-
@test_nowarn_mod trixi_include(@__MODULE__,
127-
joinpath(examples_dir(), "preprocessing",
128-
"packing_2d.jl"), particle_spacing=0.4)
126+
@trixi_test_nowarn trixi_include(@__MODULE__,
127+
joinpath(examples_dir(), "preprocessing",
128+
"packing_2d.jl"),
129+
particle_spacing=0.4)
129130
expected_coordinates = [-0.540548 -0.189943 0.191664 0.542741 -0.629391 -0.196159 0.197725 0.63081 -0.629447 -0.196158 0.19779 0.631121 -0.540483 -0.190015 0.191345 0.540433;
130131
-0.541127 -0.630201 -0.630119 -0.539294 -0.190697 -0.196942 -0.196916 -0.190324 0.190875 0.197074 0.196955 0.190973 0.541206 0.630323 0.630178 0.541314]
131132

132133
@test isapprox(packed_ic.coordinates, expected_coordinates, atol=1e-5)
133134
end
134135
@trixi_testset "preprocessing/packing_3d.jl" begin
135-
@test_nowarn_mod trixi_include(@__MODULE__,
136-
joinpath(examples_dir(), "preprocessing",
137-
"packing_3d.jl"))
136+
@trixi_test_nowarn trixi_include(@__MODULE__,
137+
joinpath(examples_dir(), "preprocessing",
138+
"packing_3d.jl"))
138139
end
139140
end
140141
end
141142

142143
@testset verbose=true "DEM" begin
143144
@trixi_testset "dem/rectangular_tank_2d.jl" begin
144-
@test_nowarn_mod trixi_include(@__MODULE__,
145-
joinpath(examples_dir(), "dem",
146-
"rectangular_tank_2d.jl"),
147-
tspan=(0.0, 0.1))
145+
@trixi_test_nowarn trixi_include(@__MODULE__,
146+
joinpath(examples_dir(), "dem",
147+
"rectangular_tank_2d.jl"),
148+
tspan=(0.0, 0.1))
148149
@test sol.retcode == ReturnCode.Success
149150
@test count_rhs_allocations(sol, semi) == 0
150151
end

0 commit comments

Comments
 (0)