Repository navigation
Conversation
…ntities In a model with reference quantities a bare number for a dimensional parameter is refused, and the example stopped at eta_0 = 1. The bulk viscosity, the cohesion, the weight per unit volume and the side-wall speed are now expressions holding the scales the example declares. The wall speed is an expression, not a bare uw.quantity, because a quantity in add_essential_bc is applied at its SI magnitude (#1238). The adjoint needs the fix for a datum that is one named constant (fix/adjoint-named-constant-datum). With that fix, `-uw_check_only 1` gives J = 1.484255e-03 and the four gradients of the same problem with no reference quantities, to every printed digit, with adjoint-to-difference ratios of 1.00000 (0.99999 flat). 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 changes for users: the fault_friction example runs in its model with reference quantities. It stopped at
eta_0 = 1, because a bare number for a dimensional parameter is refused.Documentation only:
docs/examples/adjoint/fault_segments/fault_friction.pyand its notebook. It needs #1240 to run: without it the gradient raises on the left wall's datum. Runs were by H3 (the units desk, a Claude session) on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH), on development 4ab522a.The change
The example's parameters are now expressions holding the scales it already declares:
eta_0 = 1uw.expression(r"\eta_0", REF_VISCOSITY, ...)cohesion = _nd(params.uw_cohesion / REF_STRESS)uw.expression("C", params.uw_cohesion, ...)rho_g = _nd(DENSITY * GRAVITY * DOMAIN_DEPTH / REF_STRESS)uw.expression(r"\rho g", DENSITY * GRAVITY, ...)(0.5, None),(-0.5, None)(V_wall, None),(-V_wall, None), withV_wallan expression forCONVERGENCE_RATE / 2The wall speed is an expression, not a bare
uw.quantity. A quantity inadd_essential_bcis applied at its SI magnitude, 1.3e-10 where 0.5 is right, with no warning (#1238). The bottom keeps(0.0, 0.0).Check
python fault_friction.py -uw_check_only 1(the adjoint-against-finite-difference check) gives the same numbers as the original example run with its reference quantities removed, the same non-dimensional problem, to every printed digit:The gradients
dJ/dlog muagree to every printed digit too: -1.00332984e-06, -4.38767782e-04, -3.23950066e-03, -3.98863135e-03.#1197 (open) divides the example's coordinates by its depth, on other lines of the same files. The two changes touch different hunks.
Underworld development team with AI support from Claude Code