Repository navigation
Conversation
Elements of an unsupported type are skipped when an UnstructuredMesh is written to VTK, but the values for those elements were still written to the cell data. The cell arrays then had more values than cells and every value after a skipped element was shifted onto the wrong cell. This affected both the VTKHDF and the legacy VTK/VTU writers. The data and the volumes used for normalization are now filtered to the written elements. This also stops volume normalization from dividing the caller's array in place.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If an unstructured mesh has elements that aren't linear tets or hexes,
write_data_to_vtkskips them but still writes their data. So the cell arrays end up longer than the number of cells and everything after a skipped element is shifted onto the wrong cell. This happens for both.vtkhdfand the legacy.vtk/.vtuoutput.This PR drops the data (and volumes) for the skipped elements so things line up again. It also stops volume normalization from modifying the user's array in place.
Spotted by CodeRabbit on openmc-dev#3877.
The new test writes a small mesh with one unsupported element in the middle and checks the values read back from both file formats.
Checklist