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

Use functions from analysis_integrals #152

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ end

for (i, (name, integral)) in enumerate(pairs(ints))
name in exclude && continue
name_function = getfield(@__MODULE__, name)
quantity = cb.affect!.analysis_integrals[i]
@series begin
subplot --> subplot
label := pretty_form_utf(name_function) * " " * label_extension
label := pretty_form_utf(quantity) * " " * label_extension
title --> "change of invariants"
xguide --> "t"
yguide --> "change of invariants"
Expand Down
4 changes: 3 additions & 1 deletion test/test_visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ using DispersiveShallowWater
using Plots

@testset "Visualization" begin
trixi_include(@__MODULE__, default_example(), tspan = (0.0, 1.0))
custom_integral(q, equations) = q[1]^2
DispersiveShallowWater.pretty_form_utf(::typeof(custom_integral)) = "∫η²"
trixi_include(@__MODULE__, default_example(), tspan = (0.0, 1.0), extra_analysis_integrals = (waterheight_total, custom_integral))
JoshuaLampert marked this conversation as resolved.
Show resolved Hide resolved
@test_nowarn plot(semi => sol)
@test_nowarn plot!(semi => sol, plot_initial = true)
@test_nowarn plot(semi, sol, conversion = prim2cons, plot_bathymetry = false)
Expand Down
Loading