-
Notifications
You must be signed in to change notification settings - Fork 114
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
In-situ visualization #0: Make GLMakie available in 2D TreeMesh VisualizationCallback #2225
base: main
Are you sure you want to change the base?
In-situ visualization #0: Make GLMakie available in 2D TreeMesh VisualizationCallback #2225
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2225 +/- ##
==========================================
- Coverage 96.42% 96.34% -0.08%
==========================================
Files 487 488 +1
Lines 39345 39376 +31
==========================================
Hits 37935 37935
- Misses 1410 1441 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Nice! Looking forward to this! |
Ready for review @trixi-framework/developers . This PR involves places I have not been before (visualization, packages extensions, ...). Any feedback or hints would be highly appreciated. |
visualization = VisualizationCallback(interval = 100, clims = (0, 1), | ||
plot_creator = Trixi.show_plot_makie) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is the first time this is used you could maybe explain the kwargs here (again)? Similar to
Trixi.jl/examples/tree_1d_dgsem/elixir_advection_basic.jl
Lines 13 to 29 in 6149104
coordinates_min = -1.0 # minimum coordinate | |
coordinates_max = 1.0 # maximum coordinate | |
# Create a uniformly refined mesh with periodic boundaries | |
mesh = TreeMesh(coordinates_min, coordinates_max, | |
initial_refinement_level = 4, | |
n_cells_max = 30_000) # set maximum capacity of tree data structure | |
# A semidiscretization collects data structures and functions for the spatial discretization | |
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test, | |
solver) | |
############################################################################### | |
# ODE solvers, callbacks etc. | |
# Create ODE problem with time span from 0.0 to 1.0 | |
ode = semidiscretize(semi, (0.0, 1.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! We now use the correct arguments and added some comments.
# prevents anyone from using other packages, given that appropriate `plot_creator`s are | ||
# passed. | ||
|
||
# TODO: rest of this comment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be resolved in the merged source code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, definitely!
I just need some explanation about the Requires.jl stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sloede It's been a while since you added this note. Could you help with updating it?
…ee/Trixi.jl into bg/makie-2d-visualization-callback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I just had a quick look. This definitely should get an entry in NEWS.md
@@ -166,7 +179,7 @@ function (visualization_callback::VisualizationCallback)(integrator) | |||
end | |||
|
|||
""" | |||
show_plot(plot_data, variable_names; | |||
show_plot(visualization_callback, plot_data, variable_names; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are changes to documented API, so this is breaking. We should either enable the previous behavior again or include this only in a breaking release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True!
In fact, I did not think about someone calling show_plot
directly. For the callback it is only called internally.
Waiting for a breaking release would of course be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess nobody is using it actively, but it's documented API.
Project.toml
Outdated
@@ -55,11 +55,13 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | |||
[weakdeps] | |||
Convex = "f65535da-76fb-5f13-bab9-19810c17039a" | |||
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199" | |||
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be GLMakie.jl, or could it be also one of the other backends?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the 3D case in mind, it would be nice if you could interactively turn your plot around.
But I am not sufficiently familiar with Makie. Can you make the implementation independent of a certain backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently that is how it is supposed to work. I feel amazed...
I now removed the GLMakie extension and moved its content to our existing Makie extension. For the added elixir both using GLMakie
and using CairoMakie
work (although the latter might not be too useful).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
moved stuff to Makie extension
I converted this to a draft PR so that nobody accidentally merges it. |
This is the first step in reintegrating @s6nistam's work on in-situ visualization.
As an alternative to Plots.jl it adds plotting with GLMakie for 2D TreeMesh setups.