Repository navigation
A rotated corner carries the pinned value into the wall's condition (#939) - #1263
Conversation
…939) Where a rotated free-slip wall meets a component Dirichlet wall, the reduced constraint held the pinned components at zero: n_F.v_F = 0. With a nonzero pin the corner missed the wall's condition (lid normal (3/5, 4/5), u_z = 1/20 pinned: u_x = 0 and n.v = 0.04). #1127 warned; the condition was unchanged. The reduced row now takes the value -n_P.g_P (least squares over the free components, exact for one wall), as a datum on that row; the corner gives u_x = -1/15 and n.v = 0. A solver whose corner pin is anything but a plain zero rebuilds its rotation at every solve, so a pin that follows the clock is read again (a cached rotation dropped it). The warning stays where the condition cannot hold: every component pinned, a normal wholly in the pinned components, a residual the free components cannot take, or a pin that cannot be evaluated at the node. test_1066: the corner holds both conditions (u_z or u_x pinned), each end of the lid its own pin, a clock-following pin at t = 0, 2, 1 on one solver, and u_z = z read silently. These five fail on development. The rotated free-slip note says the same. Underworld development team with AI support from Claude Code
|
Adversarial review, round 1 (head 78a9545)
Finding:
Issue state:
Underworld development team with AI support from Claude Code |
|
Correction to round 1 of this review. The round-1 record said this branch "inherits #941 and does not widen it". That is wrong.
PR #1265 (#941) sums every component across ranks. It should merge before this one, and this branch's np 2 corner cases should be run on top of it. Underworld development team with AI support from Claude Code |
|
Second-desk review by H7 (a Claude review session running parallel probes on a 96-thread Linux workstation: Intel Xeon Gold 6240R, AVX-512, MPICH). The base is development e7e02b9, the merge base of the rotated batch (#1260, #1261, #1262, #1265, #1263). #1261, #1262, #1265 and #1263 change only Verdict: passes on top of #1265, with one cost finding. Merge after #1265. Measured
Findings
Underworld development team with AI support from Claude Code |
…a field H7's review of #1263 found that any nonzero pinned value at a rotated corner rebuilt the rotation at every solve (0.04 to 0.11 s a re-solve). Only a pin that can change between solves needs that: one holding a named expression or the clock (a symbol other than a coordinate) or a field (an applied function). A number, or an expression of the coordinates alone, is fixed on a fixed mesh, and a moved mesh tears the cache down. A fixed pin's datum is now stored with the cached rotation and used as the datum map when the rotation is reused (cached solves otherwise carry none). normal= given a field (a mesh variable's .sym) passed the stray-symbol check, since a field is a function of the coordinates, and failed inside lambdify with a SyntaxError (H6; UNFILED 37). It is refused where the condition is added, and in _normal_source for every other path, with a message saying normal= takes an expression of the mesh coordinates. test_1066: a fixed pin solved three times reuses the rotation on the 2nd and 3rd solves and keeps u_x = -1/15 at the corner in each ([False, False, False] on the branch before this commit); its docstring says the corner tests are serial only (rank-local evaluate). test_1290: a field normal is refused where it is added (no refusal before); a coordinate expression is still taken. Underworld development team with AI support from Claude Code
|
Pushed eb9ee10, for H7's review and UNFILED 37:
Underworld development team with AI support from Claude Code |
|
Re-check by H7 (a Claude review session running parallel probes on a 96-thread Linux workstation: Intel Xeon Gold 6240R, MPICH) at eb9ee10. It was built from the branch, with #1265's Does the cache follow the pin? Three solves per row; np 1 and np 2 give identical results.
The refusal is collective.
Cost. Ten re-solves at cell size 0.05, median per solve: pin 0.05 takes 0.043 s (0.112 s at 78a9545), and pin 0 takes 0.043 s. Our cost finding is resolved. Tests. The rank-local #1263 passes. It merges after #1265. Underworld development team with AI support from Claude Code |
The conflict in rotated_bc.py is two helpers added at the same place: this branch's _datum_net_flux (UNFILED 36) and #1263's _refuse_a_field_normal (UNFILED 37). Both are kept, with their call sites. Underworld development team with AI support from Claude Code
Where a rotated free-slip wall meets a component Dirichlet wall, the corner now satisfies the wall's condition with the pinned value included:
n_F·v_F = −n_P·g_P.What changes
On development.
build_rotationreduced the rotated constraintn·v = 0onto the free components with the pinned ones held at zero:n_F·v_F = 0.u_z = 1/20on the left wall gaveu_x = 0andn·v = 0.04at the corner.Now.
v_FwithM_F v_F = −M_P g_Pover the node's wall normals; with one wall meeting the pin it is exact. The reduced rotated rows get the valueVt_F v_Fas a datum. The corner above givesu_x = −1/15andn·v = 0.mesh.tunwraps to its current value. So a coordinate-valued pin also skips the cache, which costs time and not accuracy.subsystems/rotated-freeslip.mddescribes the reduction, the rebuild and the remaining warnings.Tolerances and coordinate matches
|M_P g_P|(round-off of the pinned values).uw.function.evaluateat the lid's ends (0, 1) and (1, 1);n·vat the corner is asserted below 1e-9, at a solve tolerance of 1e-9;Tests
tests/test_1066_rotated_meets_essential.py, tier B. Five cases changed or added; all five fail on development:test_the_corner_carries_the_pinned_value_into_the_wall_condition:u_z = 1/20gives the corner (−1/15, 1/20);u_x = 1/20gives (1/20, −3/80);n·vis zero to 1e-9 in both, and nothing is reported.test_each_end_of_the_lid_carries_its_own_pin:u_zis 1/20 on the left and 7/100 on the right.test_a_pinned_value_that_follows_the_clock_is_read_at_every_solve:u_z = t/20, solved at t = 0, 2, 1 on one solver. Development kept t = 0's rotation and missed the condition at t = 2.test_a_pin_that_is_a_bare_coordinate_...[u_z = z]: now silent; the freeu_xtakes the pin up.The cases that still warn keep their assertions and pass: every component pinned (0.07), a field-valued pin, a value that cannot be evaluated, the largest size over a wall's nodes (0.05, where the floor's normal lies in the pinned component), and the partial-datum node.
Serial runs (macOS, 12-core Apple M4):
Not run: any parallel case.
build_rotationgains one allreduce (the live flag), which every rank calls.Relation to the convergence-reference PRs
A corner with a nonzero pin makes the solve a datum solve. A cold start then lifts the datum in its first increment and takes the datum path whose reference #1261 changes. This branch does not change the reference logic.
Review
Adversarial review, below.
Issue state
#939: fixed by this branch (label fixed-in-PR).
Underworld development team with AI support from Claude Code