Repository navigation
Coupling convergence: one per-field measure for the stop test, the noise floor and the check - #77
Merged
Merged
Conversation
…ise floor and the check For each exchanged field f the change is ||g_new,f - g_prev,f||_2 / ||g_new,f||_2, a discrete l2 over the interface points with equal weights (the per-field relative measure preCICE uses; Degroote et al. 2009). The norm is provisional: on an interface with uneven point spacing it depends on that spacing; a norm weighted by the interface cells would not. The statistic is the largest field's change and the coupling stops when it is strictly below tol. A change at most 1e-14 of the field counts as zero; a field whose new value is exactly zero is undefined and does not pass; a non-finite value never passes; both iterates are scaled by one power of two before squaring. Fields come from the export's optional column names (components / flux_components): ux, uy, uz form the vector field u, any other name is its own field, x/y/z are not fields. Without names each array is one field, stated in fields_judged; the column count never decides. Every exported field is judged. The noise floor is the same statistic between replicate runs, the largest defined value. The coupling check uses the same measure and limit. Removed: the entry-by-entry block residuals, their fixed-point/distance/scale clearances and the per-level 'excused if it shrinks' caveat. couple and couple_levels require tol. The interface-sensitivity probe keeps its own measure.
…r; state the provisional norm's replacement
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
The coupling driver, its noise-floor measurement and the coupling check now use one convergence measure.
For each exchanged physical field f:
This is a discrete l2 norm over the interface points with equal weights, the per-field relative measure used by preCICE (Degroote et al. 2009). g_new is the iteration's raw export and g_prev the relaxed input that produced it.
The norm is provisional. On an interface with uneven point spacing it depends on that spacing. A later release replaces it with the exact L2 norm over the declared interface cells.
Rule
tol.REL_FLOOR = 1e-14of the field (non-strict) counts as zero.infand never passes.coupleandcouple_levelsrefuse to run withouttol, with a message that names the parameter.run_couplingrefuses the same way.Which columns form a field
components, andflux_componentsdoes the same fornormal_fluxes.ux,uy,uz) form one vector field, when at least two are present.x,y,zare not fields.fields_judged.Noise floor
tol.max(tol, floor). The existing block mean over the lastnoise_blockvalues stays, as a stated setting.Removed
Unchanged
Tests
tests/test_convergence_rule.py(19 tests) covers the measure and the following controls. Each control must still fail:REL_FLOOR, andtolwithout a default.Further tests:
tol;The full suite passes: 134 passed, 15 skipped (Windows run with POSIX shims).
Recorded runs
Recorded runs keep only the global residual history, not the per-iteration field exports, so they cannot be re-judged offline. Flips in either direction can only be found by running again. The one planned re-run will state the openPASO version it used.