Bugfix: VTK Output of empty partitions #1954
Open
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.
Describe your changes here:
Fixes #1953
We were not able to write empty partitions any more due to this call in the VTK writer:
For an empty partition (i.e. no cells to write in VTK), the cmesh function
t8_cmesh_get_local_bounding_boxis called anyways and raises the assertionT8_ASSERT (num_local_trees > 0);Fixed it by wrapping the line in an
if (num_cells > 0).This was a minimal fix, since i felt like not touching the rest of the writer code.
However, it seems like VTK is smart and does not even write a file for the empty processes.
Thus, we could also go a step further and skip all of the remaining code in the writer function if the partition is empty.
What do you think @Davknapp?
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scpto check the indentation of these files.License
doc/(or already has one).