Skip to content

bugfix: Avoid PETSc IS size query during boundary rebuild#288

Open
gthyagi wants to merge 1 commit into
underworldcode:developmentfrom
gthyagi:bugfix/imported-dmplex-boundary-is-dev
Open

bugfix: Avoid PETSc IS size query during boundary rebuild#288
gthyagi wants to merge 1 commit into
underworldcode:developmentfrom
gthyagi:bugfix/imported-dmplex-boundary-is-dev

Conversation

@gthyagi

@gthyagi gthyagi commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #285 on the development branch.

This applies the same boundary-label rebuild fix as the release-targeted PR: _dm_unstack_bcs() now tests the returned PETSc IS object by truthiness instead of calling getSize() before setting the stratum.

Root cause

Imported DMPlex meshes can include non-boundary labels such as Elements / cell-region labels. During UW_Boundaries reconstruction, label.getStratumIS() can return a PETSc IS object that should not be dereferenced with getSize() 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 build
  • PYTHONFAULTHANDLER=1 ./uw python -X faulthandler -m pytest tests/test_1012_stokesImportedDMPlex.py::test_stokes_essential_bc_imported_dmplex -ra -vv -s passed: 1 passed, 3 warnings

Related

@gthyagi gthyagi marked this pull request as ready for review June 26, 2026 03:57
@gthyagi gthyagi requested a review from lmoresi as a code owner June 26, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant