Repository navigation
Rotated free slip: warn on a nonzero essential value at a shared node; document the solve's result keys and time= (#939, #887, #410) - #1127
Conversation
…and a zero one is not (#939) On development the first test fails: the solve prints nothing, and the wall-normal velocity at the corner is 0.04 where the rotated wall asks for zero. The second passes. Underworld development team with AI support from Claude Code
…node (#939); document the rotated solve's result keys (#887) The reduced constraint at a node shared with an essential condition is built as if the pinned components were zero. Where the essential value is not zero the wall-normal velocity there is not the prescribed one: 0.04 where zero was asked for, with u_z = 1/20 pinned beside a wall of normal (3/5, 4/5). The solve now says so, once, naming the essential wall, in the words of the existing partial-datum warning. A warning only: no row of any solve changes, and the affine reduction itself is not implemented here. solve_rotated_freeslip's Returns section gains the keys it already returned without describing: ref, fnorm_rest, rnorm_history, line_search_alpha, vel_its_last and pres_its_last (empty when a warm start converges at iteration 0). rnorm0 is described as the residual the reference is set from, which on a datum-only cold start is the lifted iterate's, not the initial one. Underworld development team with AI support from Claude Code
…sidual (#887); moving an enhancement issue to the roadmap rotated-freeslip.md says where the reference comes from when the only forcing is a prescribed datum, and that the projected-out rotation component is kept as solver._rotated_rotation_gauge_residual. planning-on-github.md records the rule for an enhancement request filed as an issue (Louis, 2026-11-13). Underworld development team with AI support from Claude Code
…esh.t (#410) Both solve docstrings said expressions using mesh.t evaluate at time=. For the residual and Jacobian kernels that is the documented path. An essential condition is evaluated at the model clock instead: with time=2 and the clock at 0, a wall prescribed as mesh.t holds 0, and it holds 2 once the clock is 2 (measured on a scalar solve and on Stokes). The docstrings now say so. No behaviour changes; what time= should do there is not decided here. Underworld development team with AI support from Claude Code
…#410) uw.systems.Stokes.solve overrides the base method and has its own docstring; the note added to the base class did not reach it. Underworld development team with AI support from Claude Code
Adversarial review at 65a02daCross-review by W1 (the integration session, which owns the rotated free-slip code), with a fresh reviewing agent, against Result. The solve is bitwise unchanged on every ordinary input we probed. One input now raises where Findings1. The check does not look at the wall normal, so it warns where nothing is wrong.
The first row is an axis-aligned free-slip lid beside an inflow wall, and the message tells that user "v.n at the node is not the prescribed one". Counting component 2. Every symbolic value is read as nonzero, and the message states it as fact. The test is
The helper's docstring says "not known to be zero"; the printed text says "prescribes a nonzero essential value there". Either evaluate the value at the node or word the message as "may be nonzero". 3. A new exception in the solve. 4. Silent where the conflict is largest. A node with every component pinned is skipped ( 5. "Once" is once per process and rank. The guard is a module global. Left 6. Bare 7. The
8. Returns section of 9. 10. The two new tests can fail and pin little. Mutants:
The assertions are substring checks. The count, the symbolic branch, a second wall and the flat-normal case of finding 1 are untested. 11. Scope. What holds
Not checkedAnything on more than one rank (finding 6 is by reading; the parallel tests the PR body lists; the collective-guard scan). Issue verdicts
Underworld development team with AI support from Claude Code |
The warning must depend on the pinned value's component along the wall normal at the shared node: reported for a tilted lid beside u_z = 1/20 (0.04), for a node with every component pinned (0.07), once per essential wall, for a clock-following value once it is nonzero, as 'may' for a field-valued pin; and silent for a zero pin, an inflow wall beside a flat lid, a profile that is zero at the corners, mesh.t at clock 0 and an expression holding zero. The older components= form of an essential condition must still solve. Seven of these fail at the previous head. Underworld development team with AI support from Claude Code
…ode (review of #1127) The first version warned whenever a pinned component had a value not provably zero. It warned for an inflow wall beside a flat lid, where n.v is exactly zero, and for any symbolic value; it was silent at a node with every component pinned; and it raised IndexError for an essential condition given in the older components= form. The check is now the quantity #939 is about: the pinned part of the wall normal against the prescribed value, n_P . g_P, with the value evaluated at the node (constants, coordinates and the model clock; a field-valued pin is reported as possibly nonzero). Pinned components are read from the section, so ghost copies agree with owners, and nodes with every component pinned are included. Conflicts are gathered across ranks and reported once per solver and essential wall through mpi.pprint, with the size. No row of any solve changes. The Returns entries for line_search_alpha, vel_its_last and pres_its_last are completed as the review measured them. Underworld development team with AI support from Claude Code
…tated free-slip page (review of #1127) The review measured that an expression written with mesh.t follows the model clock in source terms as well as in essential conditions, so the sentence that time= evaluates mesh.t in the residual and Jacobian kernels was wrong too. The three solve docstrings now say what time= sets and that mesh.t follows the clock. rotated-freeslip.md limits the two-increment remark to a linear model and says when the pressure-gauge residual attribute exists. Underworld development team with AI support from Claude Code
Adversarial review, round 2, at 1f3f27fRe-check by W1 (the integration session, which owns the rotated free-slip code) of the three findings we asked to be fixed before merge, with the comparison against Result. Findings 1, 2 and 4 to 9 of round 1 are closed. One input class now raises where FindingsA. A pinned value that is a bare coordinate raises
The raise is made inside the node loop, on a rank that holds a shared node, before the new gather. By reading, not run: on several ranks the others would wait in B. The check runs when the rotation is built, not at each solve. The default (iterative, no datum) route keeps the rotation across solves. One solver,
C. D. Tests.
The first three survivors are untested lines: no test has a datum wall beside a pin, a second build on one solver, or a wall with two shared nodes of different size. The last needs the warning tests on two ranks or more, which the PR body says were not run; one case there with the shared corner on a rank other than 0 would pin the gather and the print. E. Tolerances in the change, for the PR body. F. Scope. The paragraph added to What holds
Not checkedAnything on more than one rank: the warning at np 2 or more, whether a ghost copy of a shared node reports the same size as its owner on a wall with mesh normals, and the hang we read in A. 3-D and edge nodes. A fault pair node with a pinned component. Issue verdicts
Underworld development team with AI support from Claude Code |
… warns and does not raise (second review of #1127) Four fail at the previous head: the three bare-coordinate pins raise AttributeError inside the check, and a value whose evaluation raises is not caught. Two more cases pin behaviour the review's mutants showed untested: the size reported is the largest over a wall's shared nodes, and a node with a prescribed wall-normal datum is left to its own warning. Underworld development team with AI support from Claude Code
…(second review of #1127) A pinned value that is a bare coordinate raised AttributeError in _value_at_point: xreplace on a lone symbol returns a plain float. The check runs on the ranks that hold a shared node, ahead of the collective report, so a raise there leaves the other ranks waiting in the gather. The result is now sympified, and reading a value (the stored entry and its evaluation) is guarded: anything it raises becomes the 'could not be evaluated' report, and every rank goes on to the gather. The value is read when the rotation is built and the rotation is kept across solves; the docstring and the warning text now say that a value which changes later is not read again while the rotation is kept. The warning tests assert on what rank 0 printed, on every rank, so they can be run in parallel. Underworld development team with AI support from Claude Code
|
The parallel half at 0764729: READY, with one test to make rank-safe. Measured by H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). The branch was built at 0764729. The first-review head 1f3f27f was run as its Shared corners off rank 0. Before the runs, a probe recorded which rank owns and which ranks hold the lid's ends, (0, 1) and (1, 1), on
So in every run below at least one shared corner is owned off rank 0, and in the shell layouts the corners are also held by two ranks. test_1066 at np 2 and 3, on every rank:
The seventeen warning cases pass on every rank in every layout, with no hang. The one failure is
W1's A input on the old head.
Not run: np above 3; the bitwise comparison against development (W1's). Underworld development team with AI support from Claude Code |
A rank that holds no lid node raised on the maximum of an empty array. The whole file now passes on every rank at two and three ranks. Underworld development team with AI support from Claude Code
Adversarial review, round 3, at e4faf9bRe-check by W1 (the integration session, which owns the rotated free-slip code) of round 2's findings, with the comparison against Result. Findings A, B and C of round 2 are closed. Nothing here blocks the merge. Two small items remain for the body and the tests (1 and 2 below). Round 2's findingsA. A bare-coordinate pin raised in the check: closed. Every input that raised at 1f3f27f now solves, with the same corner value as
The last two are bad inputs on both; what matters here is that the check adds no exception of its own. The guard's comment states the sanctioned failure mode. Three mutants of the fix are each killed: the B. The check runs when the rotation is built: closed by documenting it. Unchanged in behaviour (one solver, C. D. Mutants that survived.
Remaining, neither blocks1. The body says "no tolerance"; the warning has two. 2. "Once per solver and essential wall" is still an untested line. No test builds the rotation twice on one solver. A second build after a wall value is reassigned, asserting no second line, would pin it. The paragraph in What holds
Not checkedAnything on more than one rank. 3-D and edge nodes. A fault pair node with a pinned component. Issue verdictsUnchanged from round 2.
Underworld development team with AI support from Claude Code |
…1129, with #1127) #1127's test called add_dirichlet_bc(0.05, "Left", 1), the one-entry value naming component 1 that this branch refuses. It now asserts the refusal: the same message on every rank, naming the missing entry and the full-length form (None, 0.05). Underworld development team with AI support from Claude Code
A warning and documentation for the rotated free-slip solve, from a probe of old issues against
development01dec8d. No solve changes: no row of any system, no solver tolerance, no default. The warning itself makes three numerical decisions, listed below.What changes
u_z = 1/20pinned on Left; at the shared cornern·v = 0.04where zero was asked, with nothing printed. The solve now reports that quantity when it is not zero: once per solver and essential wall, with its size, gathered across ranks and printed through the rank-safe print. The value is evaluated at the node from constants, coordinates and the model clock; a field-valued pin is reported as "may have a component along the wall normal". Nodes with every component pinned are included. The proper fix (reducing the constraint against the pinned value) is not in this PR.solve_rotated_freeslip's Returns section gains the keys it already returned without describing (ref,fnorm_rest,rnorm_history,line_search_alpha,vel_its_last,pres_its_last, the last two empty when a warm start converges at iteration 0), andrnorm0is described as the residual the reference is set from.rotated-freeslip.mdsays where the reference comes from when the only forcing is a prescribed datum, and that the projected-out rotation component is kept assolver._rotated_rotation_gauge_residual.solvedocstrings said expressions usingmesh.tevaluate attime=. They do not, anywhere:mesh.tcarries the model clock, in source terms and in essential conditions alike. Measured here on a scalar wall value and a Stokes lid (withtime=2and the clock at 0 the wall holds 0; with the clock at 2 it holds 2), and in the review on a Poisson source and a Stokes body force. The three docstrings now say whattime=sets and thatmesh.tfollows the clock. Whattime=should do is not decided here.The numerical decisions in the warning
They decide only whether a line is printed; nothing in the solve reads them.
0.0. This is what keeps an inflow wall beside an axis-aligned lid silent.0.0at the node contributes nothing and is skipped.|n_P·g_P|over the node's normals. It is reported only if it exceeds1e-12times the largest pinned value at the node, so a normal that is axis-aligned up to round-off against a pinned value does not produce a line. It is a multiple of round-off, not a physical tolerance: a real conflict is of the order of the value itself.After review
The first version of the warning looked only at whether a pinned value was provably zero. The review (above, by the session that owns the rotated free-slip code, run on macOS, 12-core Apple M4, serial) showed it warned where
n·vwas exactly zero (an inflow wall beside a flat lid; any symbolic value), was silent at nodes with every component pinned, and raisedIndexErrorfor an essential condition given in the oldercomponents=form. The check was rewritten as described above, and the review's corrections to the Returns section, thetime=docstrings and the docs page are taken.After the second review
A pinned value that is a bare coordinate (
u_x = zon a side wall, simple shear) raisedAttributeErrorinside the check. The check runs on the ranks that hold a shared node, ahead of the collective report, so a raise there would leave the other ranks waiting in the gather. The evaluated result is now a sympy object, and reading a value is guarded: anything it raises becomes the "could not be evaluated" report and every rank goes on to the gather.The value is read when the rotation is built, and the rotation is kept across solves. A value that changes later (one that follows the model clock) is therefore not read again on the same solver until the rotation is rebuilt; the docstring and the warning say so. Evaluating per solve was the alternative and is not done here.
Tests
tests/test_1066_rotated_meets_essential.pygains seventeen cases, both directions. Reported: a tilted lid besideu_z = 1/20(0.04); a node with every component pinned (0.07); one line per essential wall when two conflict; the largest size over a wall's shared nodes (0.05); a clock-following value once the clock is 2 (0.08); a field-valued pin, as "may"; the oldercomponents=form, which must also still solve; bare-coordinate pinsu_z = z(0.8) andu_x = z(0.6); a value whose evaluation raises, reported as "could not be evaluated" with no exception. Silent: a zero pin; an inflow wall beside a flat lid; a profile that is zero at the corners;mesh.tat clock 0; an expression holding zero;u_z = xon the wall x = 0; a node with a prescribed wall-normal datum, which keeps its own warning. The warning tests assert, on every rank, on what rank 0 printed.Verification
On a 96-thread Linux workstation (single system image, Intel Xeon Gold 6240R, MPICH 5.0.1, PETSc int32), head 0764729:
test_1066_rotated_meets_essential.py,test_1018_rotated_freeslip,test_1085_build_rotation_setupparallel/test_1066_rotated_datum_parallel,test_1064_rotated_freeslip_parallel,test_1084_rotated_datum_collectivesat np 2 and 3test_1066_rotated_meets_essential.pyat np 2 and 3, head e4faf9btest_1131,test_0846,test_1077,test_1092(without Maxwell) with the aboveUntested: that the report is made once per solver (the set that records reported walls has no test).
Established in review, not by us: shared corners on ranks other than rank 0 at np 2 and np 3, with all warning cases passing and no hang, and the bare-coordinate input hanging at the previous head and passing at 0764729. The library code is unchanged since 0764729; only one test changed after it.
Issues
development; the docstring is corrected here, and whattime=should do for an essential condition remains open.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