bugfix: Avoid PETSc IS size query during boundary rebuild#288
Open
gthyagi wants to merge 1 commit into
Open
Conversation
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.
Summary
Fixes #285 on the
developmentbranch.This applies the same boundary-label rebuild fix as the release-targeted PR:
_dm_unstack_bcs()now tests the returned PETScISobject by truthiness instead of callinggetSize()before setting the stratum.Root cause
Imported DMPlex meshes can include non-boundary labels such as
Elements/ cell-region labels. DuringUW_Boundariesreconstruction,label.getStratumIS()can return a PETScISobject that should not be dereferenced withgetSize()just to decide whether it is usable. On the issue #285 reproducer, that size query aborts the process before the Stokes system is assembled.Using the PETSc object truthiness check avoids the crash while preserving the existing label reconstruction behavior for valid strata.
Validation
./uw buildPYTHONFAULTHANDLER=1 ./uw python -X faulthandler -m pytest tests/test_1012_stokesImportedDMPlex.py::test_stokes_essential_bc_imported_dmplex -ra -vv -spassed: 1 passed, 3 warningsRelated