Information is not correctly propagated through the macro `@trixi_testset`
bug
(See [https://github.com/trixi-framework/Trixi.jl/actions/runs/26962641741/job/79556905609?pr=3065](https://github.com/trixi-framework/Trixi.jl/actions/runs/26962641741/job/79556905609?pr=3065)).
In the following test, I have defined a different `volume_flux`:
```julia
@trixi_testset "elixir_mhd_alfven_wave_nonperiodic.jl Float32" begin
using Trixi
@inline function flux_volume_combined(u_ll, u_rr, normal_direction::AbstractVector,
equations::IdealGlmMhdEquations3D)
flux = flux_hindenlang_gassner(u_ll, u_rr, normal_direction, equations)
noncons_flux_left = flux_nonconservative_powell(u_ll, u_rr, normal_direction,
equations)
noncons_flux_right = flux_nonconservative_powell(u_rr, u_ll, normal_direction,
equations)
flux_left = flux + 0.5f0 * noncons_flux_left
flux_right = flux + 0.5f0 * noncons_flux_right
return flux_left, flux_right
end
@inline Trixi.combine_conservative_and_nonconservative_fluxes(::typeof(flux_volume_combined),
equations::IdealGlmMhdEquations3D) = Trixi.True()
@test_trixi_include(joinpath(EXAMPLES_DIR, "p4est_3d_dgsem",
"elixir_mhd_alfven_wave_nonperiodic.jl"),
l2=Float32[0.00021050235826592327, 0.0006558863204839041,
0.0002821364444400733, 0.000794748435433683,
0.0006839039307848098, 0.0006743445524692008,
0.000318156924452865, 0.0007885451771559438,
4.811726173404515e-5],
linf=Float32[0.0012031070350810857, 0.004106999758487398,
0.001783097816025008, 0.004780625055122056,
0.005095902318184908, 0.003922455893839549,
0.002515549802432071, 0.004448527671538249,
0.00019839944646198146],
RealT_for_test_tolerances=Float32,
real_type=Float32,
save_solution=nothing,
analysis_callback=AnalysisCallback(semi, interval = 100,
analysis_integrals = (entropy,)),
volume_flux=flux_volume_combined)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
semi = ode.p # `semidiscretize` adapts the semi, so we need to obtain it from the ODE problem.
@test_allocations(Trixi.rhs!, semi, sol, 600_000)
end
```
and this is where the volume flux is defined in the elixir:
```julia
volume_flux = (flux_hindenlang_gassner, flux_nonconservative_powell)
solver = DGSEM(polydeg = 3,
surface_flux = (flux_hlle,
flux_nonconservative_powell),
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
```
but it returns the following error
```julia
/home/runner/work/Trixi.jl/Trixi.jl/examples/p4est_3d_dgsem/elixir_mhd_alfven_wave_nonperiodic.jl
elixir_mhd_alfven_wave_nonperiodic.jl native: Error During Test at /home/runner/.julia/packages/TrixiTest/6CVoC/src/macros.jl:196
Got exception outside of a @test
LoadError: UndefVarError: `flux_volume_combined` not defined
Stacktrace:
[1] top-level scope
@ ~/work/Trixi.jl/Trixi.jl/examples/p4est_3d_dgsem/elixir_mhd_alfven_wave_nonperiodic.jl:19
[2] include
@ ./Base.jl:496 [inlined]
[3] trixi_include(mapexpr::typeof(identity), mod::Module, elixir::String; enable_assignment_validation::Bool, replace_assignments_recursive::Bool, kwargs::@Kwargs{save_solution::Symbol, analysis_callback::Expr, volume_flux::Symbol})
@ TrixiBase ~/.julia/packages/TrixiBase/MGeKl/src/trixi_include.jl:79
[4] trixi_include
@ ~/.julia/packages/TrixiBase/MGeKl/src/trixi_include.jl:49 [inlined]
[5] #trixi_include#6
@ ~/.julia/packages/TrixiBase/MGeKl/src/trixi_include.jl:86 [inlined]
[6] (::Main.TestExamplesKernelAbstractions.TrixiTestModule.var"#2#5")()
@ Main.TestExamplesKernelAbstractions.TrixiTestModule ~/.julia/packages/TrixiTest/6CVoC/src/macros.jl:15
[7] (::Base.RedirectStdStream)(thunk::Main.TestExamplesKernelAbstractions.TrixiTestModule.var"#2#5", stream::IOStream)
@ Base ./stream.jl:1434
[8] #1
@ ~/.julia/packages/TrixiTest/6CVoC/src/macros.jl:14 [inlined]
[9] open(::Main.TestExamplesKernelAbstractions.TrixiTestModule.var"#1#4", ::String, ::Vararg{String}; kwargs::@Kwargs{})
@ Base ./io.jl:396
[10] open(::Function, ::String, ::String)
@ Base ./io.jl:393
[11] macro expansion
@ ~/.julia/packages/TrixiTest/6CVoC/src/macros.jl:13 [inlined]
[12] macro expansion
@ ~/work/Trixi.jl/Trixi.jl/test/test_trixi.jl:35 [inlined]
[13] macro expansion
@ ~/work/Trixi.jl/Trixi.jl/test/test_kernelabstractions.jl:195 [inlined]
[14] macro expansion
@ /opt/hostedtoolcache/julia/1.10.11/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1582 [inlined]
[15] macro expansion
@ ~/work/Trixi.jl/Trixi.jl/test/test_kernelabstractions.jl:180 [inlined]
[16] top-level scope
@ ~/.julia/packages/TrixiTest/6CVoC/src/macros.jl:196
[17] eval(m::Module, e::Any)
@ Core ./boot.jl:385
[18] macro expansion
@ ~/.julia/packages/TrixiTest/6CVoC/src/macros.jl:172 [inlined]
[19] macro expansion
@ ~/work/Trixi.jl/Trixi.jl/test/test_kernelabstractions.jl:179 [inlined]
[20] macro expansion
@ /opt/hostedtoolcache/julia/1.10.11/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1582 [inlined]
[21] top-level scope
@ ~/work/Trixi.jl/Trixi.jl/test/test_kernelabstractions.jl:111
in expression starting at /home/runner/work/Trixi.jl/Trixi.jl/examples/p4est_3d_dgsem/elixir_mhd_alfven_wave_nonperiodic.jl:19
```
I will define a new elixir as a workaround.
0 条评论