Dear toolkit community,
I’m struggling to find a way to plot a 1D quantity in Kuibit without merging the different meshes originated from the mesh refinement.
As a workaround, I have made a Python script that reads the file of a grid function and plots every point along the axis and its corresponding value. I can share this script if somebody is interested, but it is not very good as it breaks once you use checkpoints and has hardcoded paths.
However, it gets the job done, as you can see in an example plot below, where it is hopefully obvious that there is an increase in the number of points as z approaches 0.
Obviously, a solution that uses Kuibit would be much better. However, I cannot come up with such a solution and so I’m writing this e-mail.
From the documentation, the object that represents the simulation data (including the mesh refinement levels), is the |HierarchicalGridData|, and I know how to go from a grid function to this object.
For instance, to get the |HierarchicalGridData| that represents the real part of a scalar field along the x-axis at t=0, we do
|sd = SimDir("<output>") gf = sd.gf phi1=gf.x["phi1"].get_time(0) |
All I have to do now is plot this somehow. As it turns out, this is impossible, because according to the documentation
We cannot plot directly this object, because it is a complicated object. To plot it, we have to merge the refinement levels to a single |UniformGridData|. We can do this with |refinement_levels_merged()|.
But, all of the information regarding the mesh refinement levels is here, so it should be possible to extract this information and plot it, right?
Looking at the methods and variables in |HierarchicalGridData| I came up with nothing.
Does anybody have a solution to this?
Thank you in advance,
Best Regards,
José Ferreira