Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten relative tolerance for the testing #341

Merged
merged 6 commits into from
Nov 17, 2020
Merged
2 changes: 1 addition & 1 deletion examples/1d/elixir_euler_sedov_blast_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ amr_callback = AMRCallback(semi, amr_controller,

summary_callback = SummaryCallback()

stepsize_callback = StepsizeCallback(cfl=0.8)
stepsize_callback = StepsizeCallback(cfl=0.5)

save_solution = SaveSolutionCallback(interval=100,
save_initial_solution=true,
Expand Down
17 changes: 9 additions & 8 deletions test/test_examples_1d_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,24 @@ EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "1d")

@testset "elixir_euler_sedov_blast_wave.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave.jl"),
l2 = [1.2526428105949643, 0.06850036315669353, 0.9265758557535149],
linf = [2.987836852104084, 0.1706331519278507, 2.6658508877441838])
l2 = [1.250005061244617, 0.06878411345533507, 0.9264328311018613],
linf = [2.9766770877037168, 0.16838100902295852, 2.6655773445485798])
end

@testset "elixir_euler_sedov_blast_wave.jl with pressure" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave.jl"),
l2 = [1.2983852642398792, 0.07961334122389492, 0.9270679298118678],
linf = [3.185530212032373, 0.2136435252219927, 2.6651572539845736],
shock_indicator_variable = pressure)
l2 = [1.297525985166995, 0.07964929522694145, 0.9269991156246368],
linf = [3.1773015255764427, 0.21331831536493773, 2.6650170188241047],
shock_indicator_variable = pressure,
cfl = 0.2)
end

@testset "elixir_euler_sedov_blast_wave.jl with density" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave.jl"),
l2 = [1.2796976935143354, 0.07078122470157631, 0.9274308941700738],
linf = [3.1132929378257703, 0.17699767997572083, 2.66685149106963],
l2 = [1.2798798835860528, 0.07103461242058921, 0.9273792517187003],
linf = [3.1087017048015824, 0.17734706962928956, 2.666689753470263],
shock_indicator_variable = density,
cfl = 0.5)
cfl = 0.2)
end

@testset "elixir_euler_blast_wave.jl" begin
Expand Down
12 changes: 8 additions & 4 deletions test/test_examples_2d_parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "
@testset "elixir_euler_source_terms.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"),
l2 = [8.517783186497567e-7, 1.2350199409361865e-6, 1.2350199409828616e-6, 4.277884398786315e-6],
linf = [8.357934254688004e-6, 1.0326389653148027e-5, 1.0326389654924384e-5, 4.4961900057316484e-5])
linf = [8.357934254688004e-6, 1.0326389653148027e-5, 1.0326389654924384e-5, 4.4961900057316484e-5],
rtol = 2000*sqrt(eps()))
end

@testset "elixir_euler_density_wave.jl" begin
Expand All @@ -73,7 +74,8 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "
@testset "elixir_euler_nonperiodic.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_nonperiodic.jl"),
l2 = [2.3652137675654753e-6, 2.1386731303685556e-6, 2.138673130413185e-6, 6.009920290578574e-6],
linf = [1.4080448659026246e-5, 1.7581818010814487e-5, 1.758181801525538e-5, 5.9568540361709665e-5])
linf = [1.4080448659026246e-5, 1.7581818010814487e-5, 1.758181801525538e-5, 5.9568540361709665e-5],
rtol = 0.001)
end

@testset "elixir_euler_ec.jl" begin
Expand All @@ -85,13 +87,15 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "
@testset "elixir_euler_vortex.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex.jl"),
l2 = [3.6342636871275523e-6, 0.0032111366825032443, 0.0032111479254594345, 0.004545714785045611],
linf = [7.903587114788113e-5, 0.030561314311228993, 0.030502600162385596, 0.042876297246817074])
linf = [7.903587114788113e-5, 0.030561314311228993, 0.030502600162385596, 0.042876297246817074],
rtol = 0.001)
end

@testset "elixir_euler_vortex_shockcapturing.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_shockcapturing.jl"),
l2 = [3.80342739421474e-6, 5.561118953968859e-5, 5.564042529709319e-5, 0.0001570628548096201],
linf = [8.491382365727329e-5, 0.0009602965158113097, 0.0009669978616948516, 0.0030750353269972663])
linf = [8.491382365727329e-5, 0.0009602965158113097, 0.0009669978616948516, 0.0030750353269972663],
rtol = 0.001)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ macro test_trixi_include(elixir, args...)
local l2 = get_kwarg(args, :l2, nothing)
local linf = get_kwarg(args, :linf, nothing)
local atol = get_kwarg(args, :atol, 200*eps())
local rtol = get_kwarg(args, :rtol, 0.001)
local rtol = get_kwarg(args, :rtol, sqrt(eps()))
local kwargs = Pair{Symbol, Any}[]
for arg in args
if arg.head == :(=) && !(arg.args[1] in (:l2, :linf, :atol, :rtol))
Expand Down