Repository navigation
Conversation
Fails on development: the east direction's z entry is vanishing*x*y*z (1e-18*x*y*z), in the rotation matrices, the geographic east vector, and a Stokes form built from it. Underworld development team with AI support from Claude Code
The east direction's z component was written as independent_of_N, the expression vanishing*x*y*z, so every solver form built from the frame carried 1e-18*x*y*z in model units. It is now sympy.Integer(0) in the spherical rRotN and its symbolic form, and in the geographic east vector and rotation matrix. independent_of_N and zero_matrix are unchanged. Underworld development team with AI support from Claude Code
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
UNFILED 43, follow-up to #1295, from the parallel review desk's review of #1284.
The east (azimuthal) direction of the spherical and geographic frames has no z component.
coordinates.pywrote that zero asindependent_of_N, the expressionvanishing * x * y * zwithvanishing= 1e-18, so that a matrix mixing constant and coordinate-dependent entries would lambdify to one array (the reason given beside its definition; it entered the frames with 0f1dbfc, #313, and the geographic east vector with bb23386). The frames are also used to build solver forms, so every form built from the east direction (a rotated frame, a tangential body force,unit_e_2) carried 1e-18·x·y·z in model units. In a model whose values are of order one that is nothing; in a units model whose model-unit values are of order 1e-18 (#1284's J/mol case) it is an error of order one in the assembled form.Those four zeros are now
sympy.Integer(0):rRotNand its symbolic formrRotN_sym, entry (2, 2);geoRotN,unit_WEandunit_SN(built from it by a cross product);rRotN, entry (2, 2).independent_of_Nandzero_matrixare unchanged; #1295 removeszero_matrixfrom the evaluators, and this PR does not touch that file, so the two do not conflict. Evaluating the frames still returns the right shape on development's evaluator:evaluate(unit_e_2)at three points gives shape (3, 1, 3) with the z column exactly 0.What a user's run sees: on a shell or geographic mesh, forms built from the east direction lose a 1e-18·x·y·z term. Measured on a shell Stokes solve with a body force along
unit_e_2and rotated free slip on both walls (cell 0.25), against the same base without this change: velocity differs by 1.6e-15 relative; pressure differs only in its free constant (this setup has a constant-pressure null space), and with the mean removed by 1.7e-13.Test
tests/test_1296_coordinate_frames_hold_exact_zeros.py(level 1, tier B), five cases: on aSphericalShelland aRegionalGeographicBox, no frame contains the term and the east direction's z entry is exactlysympy.Integer(0); and the unwrapped F0 of a Stokes solver whose body force isunit_e_2contains no such term. All five fail on development (the term is present) and pass here.What was run
On a 96-thread Linux workstation (single system image, Intel Xeon Gold 6240R, MPICH), with another session's full-suite run sharing the machine:
test_1111's recorded answer), 1 xfailed (known)scripts/check_test_coverage.pyNot run
np 3 or more; the geographic box in a solve; macOS; the full suite.
Underworld development team with AI support from Claude Code