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

Contours via Plots.jl are supported for TreeMesh #2230

Open
MarcoArtiano opened this issue Jan 13, 2025 · 5 comments
Open

Contours via Plots.jl are supported for TreeMesh #2230

MarcoArtiano opened this issue Jan 13, 2025 · 5 comments

Comments

@MarcoArtiano
Copy link

MarcoArtiano commented Jan 13, 2025

Contour plots can be easily done as follows
pd = PlotData2D(sol), contour(pd["var_name"])

but the correct visualization is given only if the chosen mesh was TreeMesh. As an example:
image

For all the other cases the image displayed is
image

@sloede
Copy link
Member

sloede commented Jan 16, 2025

This is very cool that it works with the contour plots. Any idea why it does not work for P4estMesh?

@MarcoArtiano
Copy link
Author

MarcoArtiano commented Jan 23, 2025

This is very cool that it works with the contour plots. Any idea why it does not work for P4estMesh?

It looks like when the function PlotData2D is called, the mesh is structured as vectors for TreeMesh. That allows the correct visualization for contours.

On the other hand I saw that Makie.jl has recently came out with a feature to make contours also for unstructured/curvilinear grid, taking as inputs matrices of the spatial coordinates x and y. See Enable curvilinear contour . That will enable contours for all the other cases. However I'm having some issues with this feature.

ps: it looks like that the minimum version of CairoMakie that is compatible with Trixi is v.0.11.11, which doesn't include the above linked PR. And this looks related to Test CairoMakie 0.13

@benegee
Copy link
Contributor

benegee commented Jan 23, 2025

When working on the visualization callback (#2225 ) I only recently realized that PlotData2D is specialized for TreeMesh. It produces a PlotData2DCartesian object in this case, while there will be PlotData2DTriangulated in all the other cases.

@ranocha
Copy link
Member

ranocha commented Jan 28, 2025

ps: it looks like that the minimum version of CairoMakie that is compatible with Trixi is v.0.11.11, which doesn't include the above linked PR. And this looks related to Test CairoMakie 0.13

Updated on main

@MarcoArtiano
Copy link
Author

MarcoArtiano commented Feb 3, 2025

ps: it looks like that the minimum version of CairoMakie that is compatible with Trixi is v.0.11.11, which doesn't include the above linked PR. And this looks related to Test CairoMakie 0.13

Updated on main

Thank you! Now it is possible to visualize contours, but there are errors in the interpolation.

For example:

Image

Image

I think this is due to the fact that PlotData2D for all mesh types (except TreeMesh) returns all the DOFs of the DG grid points. For this type of grid the coordinates values are not unique. We may assume, just for visualization purposes, a "CG" structure maybe, where the values on the discontinuous interfaces are interpolated (e.g. simply averaging).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants