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

Show for Indicator Vortex #2060

Merged
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
6 changes: 5 additions & 1 deletion examples/tree_2d_dgsem/elixir_euler_vortex_amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function (indicator_vortex::IndicatorVortex)(u::AbstractArray{<:Any, 4},
t, kwargs...)
mesh = indicator_vortex.cache.mesh
alpha = indicator_vortex.cache.alpha
indicator_threaded = indicator_vortex.cache.indicator_threaded
resize!(alpha, nelements(dg, cache))

# get analytical vortex center (based on assumption that center=[0.0,0.0]
Expand Down Expand Up @@ -57,6 +56,11 @@ function periodic_distance_2d(coordinates, center, domain_length)
return sqrt(sum(abs2, dx_periodic))
end

# Optional: Nicer display of the indicator
function Base.show(io::IO, ::MIME"text/plain", indicator::IndicatorVortex)
Trixi.summary_box(io, "IndicatorVortex")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the summary box here? This is leaking an implementation detail into the examples/official API, so we should consider this

Copy link
Contributor Author

@DanielDoehring DanielDoehring Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm not really for the "use case" indicated by the screenshots above. But if you assign a variable
indicator = TrixiExtension.IndicatorVortex(semi) in the REPL you would see this box, which I use for consistency with the other indicators.

end

end # module TrixiExtension

import .TrixiExtension
Expand Down
Loading