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

Reuse pretty_form_utf #151

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all 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
19 changes: 5 additions & 14 deletions src/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,8 @@ end
PlotDataOverTime(semi => sol, x_value, conversion)
end

function pretty(name)
if name == :waterheight_total
return "∫η"
elseif name == :velocity
return "∫v"
elseif name in [:discharge, :momentum]
return "∫P"
elseif name == :entropy
return "∫U"
elseif name == :entropy_modified
return "∫U_mod"
elseif name == :l2_error
function pretty_form_utf(name)
if name == :l2_error
return "L² error"
elseif name == :linf_error
return "L∞ error"
Expand All @@ -196,9 +186,10 @@ end

for (i, (name, integral)) in enumerate(pairs(ints))
name in exclude && continue
name_function = getfield(@__MODULE__, name)
JoshuaLampert marked this conversation as resolved.
Show resolved Hide resolved
@series begin
subplot --> subplot
label := pretty(name) * " " * label_extension
label := pretty_form_utf(name_function) * " " * label_extension
title --> "change of invariants"
xguide --> "t"
yguide --> "change of invariants"
Expand All @@ -213,7 +204,7 @@ end
name in exclude && continue
@series begin
subplot --> subplot
label --> pretty(name) * " " * label_extension
label --> pretty_form_utf(name) * " " * label_extension
title --> "errors"
xguide --> "t"
yguide --> "sum of errors"
Expand Down
Loading