Repository navigation
Stokes_Constrained with a discontinuous pressure: copy every unknown of each field back (#1167) - #1200
Conversation
…of each field back (#1167) get_local_field_is took all of a field's unknowns only when the PRESSURE was continuous, whatever field it was asked for, and then one index per point. With a discontinuous pressure the multipliers went through the unconstrained branch and lost their pinned interior unknowns, the velocity's complement grew by them (306 entries for a variable of 162), and the copy-back stopped with a broadcast error after the solve. Now every unknown of each point is taken for any field; the continuous case takes the same indices as before (its solve is bit-identical). tests/parallel/test_1167_constrained_stokes_discontinuous_pressure_parallel.py: the issue's case solves, the walls' normal velocity is below 1e-5, and the solution agrees with the continuous-pressure one to 1e-3; development raises the broadcast error. np 1 and 2; also in batch 3. Underworld development team with AI support from Claude Code
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) Verdict on aa49911: ready to merge on green from this review (a comment, not a GitHub approval). The index sets are right for every field and every number of unknowns per point. Every continuous-pressure case that ran before gives the same index sets and the same answer. The discontinuous-pressure constrained solve is correct: it matches plain Stokes on the same discretisation to solver tolerance. There are no blocking findings. How the builds were comparedThe PR's base is development at fafbecb. Between the development build used here (176958a) and fafbecb there are only Python changes ( FindingsNo blocking findings.Minor / informational
Bit-identity: continuous pressure, PR against developmentScript: one run solves eight consumer cases and saves every rank's raw arrays. A given rank count gives the same partition, so no gather was needed. Each build was run twice at each of np 1, 2 and 4. The cases are:
Saved per rank: velocity, pressure, multipliers, coordinates, residual fields, adjoint fields and the cached index sets themselves (velocity, pressure and each multiplier). Also recorded: the SNES reason and iteration counts, and the index-set sizes against each variable's local vector.
The index sets are what the PR changes. Since they are identical, the copy-back is the same operation on both builds. Discontinuous pressure: is the solve right?Same mesh family as #1167, 8x8 quads, P2 velocity. We compared Stokes_Constrained against plain Stokes with the side walls held by
Vector fields and multi-dof points:
What was run
Every parallel run was under the MPI supervisor with a timeout, pinned to four cores. Not run:
Logs kept by the reviewer. Underworld development team with AI support from Claude Code |
Fixes #1167.
The defect.
get_local_field_is, insideSNES_Stokes_SaddlePt._ensure_local_field_index_sets, builds the local index sets that copy the solution back into the variables. It decided whether to take every unknown of a field from the pressure's continuity, whichever field it was asked for. When it did take them all, it took one index per point.The fix. With
unconstrained=False, every unknown of each point is taken, for any field. For a field with one unknown per point, the continuous pressure and P1 multipliers, that is the same index set as before, so the continuous solve is bit-identical (max |v| 0.06878602773825046 before and after). There are no other callers.Measured on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH), on #1167's case:
Test.
tests/parallel/test_1167_constrained_stokes_discontinuous_pressure_parallel.py, tier B. It runs the issue's case, and asserts that the walls' normal velocity is below 1e-5 and that the solution agrees with the continuous-pressure one to 1e-3. Development raises; it passes at np 1 and 2, and runs in batch 3 and under--p N. The Stokes and constraint test files pass (199); the coverage gate passes.#1154 (
set_active_region) does not share this code and comes as its own PR.Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)
level_*andtier_*markers (S8)maybe_/try_/do_) and no commented-out code (S3, S4).array/mesh.X.coords— nowith ....access(...), nomesh.data(S7)pixi.toml/pixi.lockor other dependency changes riding in an unrelated PRUnderworld development team with AI support from Claude Code