You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Block-constrained Stokes combined with rotated free-slip is silently unguarded #464
add_rotated_freeslip_bc and the Lagrange-multiplier (block-constrained) Stokes machinery can both be active on the same solver, and nothing checks for it.
The rotated solve builds its own index-set fieldsplit over exactly two fields:
vel_is and pres_is come from solver._subdict["velocity"] / ["pressure"]. When solver._multipliers is non-empty those fields carry their own DOFs (registered at petsc_generic_snes_solvers.pyx ~7824), and those DOFs are in neither index set. The preconditioner is then built over a strict subset of the operator's rows.
build_rotation is likewise field-0/field-1 only (_VELOCITY_FIELD = 0, _PRESSURE_FIELD = 1).
add_rotated_freeslip_bc (petsc_generic_snes_solvers.pyx ~5880-5905) validates the boundary label and the datum shape but does not check for multipliers, and the solve dispatch (~8682) routes to the rotated driver without checking either.
What to do
The two mechanisms are alternative ways to impose the same constraint, so combining them is almost certainly user error rather than a configuration worth supporting. A raise at add_rotated_freeslip_bc (and symmetrically wherever a block constraint is added) naming both mechanisms would be the right size of fix.
If the combination should be supported, the rotated fieldsplit needs a third split for the multiplier fields and build_rotation needs to know about them.
Found while auditing the rotated free-slip preconditioner; not exercised by any current test or example, so this is a latent trap rather than an observed failure.
Underworld development team with AI support from Claude Code
Fixed by PR #590, merged to development as a24c558.
_reject_mixed_constraint_mechanisms refuses the combination at whichever of add_rotated_freeslip_bc, add_fault_bc or add_constraint_bc comes second, and again as the first statement of solve() — registration gives the better message, the dispatch gives the guarantee, since fault_contact writes _fault_contact_faults directly rather than through the solver API.
Took the first of the two options on the issue: the mechanisms are alternatives, not a configuration worth supporting. test_0062_rotated_constraint_exclusivity.py covers both orderings, the bypass through solve(), and the two controls that each mechanism alone is still allowed.
Auto-close does not fire because PRs target development, not the default branch.
Activity
lmoresi commentedon Aug 17, 2026
Fixed by PR #590, merged to
developmentasa24c558._reject_mixed_constraint_mechanismsrefuses the combination at whichever ofadd_rotated_freeslip_bc,add_fault_bcoradd_constraint_bccomes second, and again as the first statement ofsolve()— registration gives the better message, the dispatch gives the guarantee, sincefault_contactwrites_fault_contact_faultsdirectly rather than through the solver API.Took the first of the two options on the issue: the mechanisms are alternatives, not a configuration worth supporting.
test_0062_rotated_constraint_exclusivity.pycovers both orderings, the bypass throughsolve(), and the two controls that each mechanism alone is still allowed.Auto-close does not fire because PRs target
development, not the default branch.Refuse a rotated constraint and a block constraint on one solver; dro…
Complete rotation null modes on coupled fields; coupled fields can be…