Contours via Plots.jl are supported for TreeMesh
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:
For all the other cases the image displayed is
This is very cool that it works with the contour plots. Any idea why it does not work for P4estMesh?
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
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.
ps: it looks like that the minimum version of
CairoMakiethat 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
ps: it looks like that the minimum version of
CairoMakiethat 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.13Updated on
main
Thank you! Now it is possible to visualize contours, but there are errors in the interpolation.
For example:
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).