Skip to content

Commit

Permalink
move new TimeSeries test into the unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwinters5000 committed Mar 12, 2024
1 parent fe4f431 commit fa5daa8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 11 additions & 0 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ end
end

@timed_testset "TimeSeriesCallback" begin
# Test the 2D TreeMesh version of the callback and some warnings
@test_nowarn_mod trixi_include(@__MODULE__,
joinpath(examples_dir(), "tree_2d_dgsem",
"elixir_acoustics_gaussian_source.jl"),
Expand All @@ -615,6 +616,16 @@ end
@test_nowarn show(stdout, time_series)
@test_throws ArgumentError TimeSeriesCallback(semi, [(1.0, 1.0)]; interval = -1)
@test_throws ArgumentError TimeSeriesCallback(semi, [1.0 1.0 1.0; 2.0 2.0 2.0])
# Test the 2D unstructured mesh version of the callback
@test_nowarn_mod trixi_include(@__MODULE__,
joinpath(examples_dir(), "unstructured_2d_dgsem",
"elixir_euler_time_series.jl"),
tspan = (0.0, 0.2))

point_data_1 = time_series.affect!.point_data[1]
@test all(isapprox.(point_data_1[1:4],
[ 1.9548629504390056, 1.9548895017871935,
1.9548892928720158, 3.821760762385351]))
end

@timed_testset "Consistency check for single point flux: CEMCE" begin
Expand Down
5 changes: 0 additions & 5 deletions test/test_unstructured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ end
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
# Extra test to make sure the `TimeSeriesCallback` made correct data
point_data_1 = time_series.affect!.point_data[1]
@test all(isapprox.(point_data_1[1:4],
[1.9548629504179071, 1.9548895017660788,
1.954889292850916, 3.8217607623030623]))
end

@trixi_testset "elixir_acoustics_gauss_wall.jl" begin
Expand Down

0 comments on commit fa5daa8

Please sign in to comment.