-
Notifications
You must be signed in to change notification settings - Fork 276
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
error using annotate_contour with exodus II data #4716
Comments
hi @ahzeeshan , thank you for reporting this from what I can grasp, what's happening internally is that the yt/yt/visualization/plot_modifications.py Line 1000 in 8a43695
I am not familiar with exodusII data or unstructured mesh, so I don't know off-hand if this is to be expected. Is it ? |
Thanks @neutrinoceros. This shape mismatch error seems related to #1916 and #1918. However, I am not sure how to modify my code. I am also not very familiar with exodusII data but my guess is the 4 comes from the 4 nodes corresponding to each element of the QUAD4 mesh. |
thanks for digging up those relevant issues/PRs, this is helpful. |
@neutrinoceros @ahzeeshan Thanks for the ping! I absolutely would like to look at this. I really appreciate the relevant PRs and the thoughtful method of supplying relevant test data. I will attempt to dig in this afternoon or tomorrow! |
Sorry for taking so long, but I've figure out the first bit that's an issue. The current setup is feeding in the vertex data, which is of shape (N, 4) as the "z" array. The x and y are of shape N, however. This is because the slice functionality for unstructured mesh data utilizes all four values to compute the local points (i.e., doing intra-cell computation). I believe that this is tractable by utilizing a different pixelizer on the yt side. I am going to continue to investigate. |
After digging in, I'm not entirely certain I know the specific right thing to do. I had forgotten the specifics of how this worked, but now that I am reminding myself, I see the issue. It does not pixelize -- instead, it feeds the raw data locations in to matplotlib, and then uses that to generate the results. The main upshot of this is that for cell-centered data that occupies more than one pixel per voxel, it prevents really gross "let's trace the boxes with our contours" situations. It's slower than our pixelizer, but that is what it is. So, some options:
I'll give it some more thought and experiment a bit. |
I should note, item 2 on that list is made more complicated in 3D. |
Can confirm I used option 3 as a temporary solution and it gave satisfactory results. However, the element value may not always be the mean of the node values. The form of interpolation depends on the shape functions used. |
Bug report
Bug summary
Cannot plot contours using data from exodus II file.
Code for reproduction
Exodus file is gold.e from http://use.yt/upload/a113f8e3
Actual outcome
Expected outcome
Contours on top of the color plot.
Version Information
The text was updated successfully, but these errors were encountered: