Repository navigation
fix(friction): no endless distributed solve at near-zero contact pressure - #83
Merged
Merged
Conversation
…sure The distributed friction model subdivides every sample step in units of the slip-onset curvature, which is proportional to the reference contact pressure. An unclamped layer at zero tension (the 66 kV template under the solved contact model) returns a pressure of round-off size, about 5e-10 Pa, and a 50-sample biaxial record then needed some 1e17 substeps: compute_fatigue with friction_model="distributed", or "auto" on a non-planar path, never returned. A reference pressure at or below PRESSURE_ROUNDOFF_FRACTION (1e-14) of the wire modulus now counts as zero, as an exact zero already did (no friction, as the direction-tied law). A record that would take more substeps than its budget, MAX_SUBSTEPS_PER_SAMPLE (10 000) per sample and at least MIN_SUBSTEP_BUDGET (1 000 000), is refused with a CableInputError naming the slip-onset curvature, and "auto" (fatigue, wire stress field, neutral axes) keeps the direction-tied law for such a layer with FrictionModelFallbackWarning. distributed_substep_count and distributed_substep_budget give the kernels' count and the budget. Records within their budget give the same results as before, bit for bit. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
📖 2 files modified Preview · build overview · CableXSec · built Dec. 4, 2026, 9:29 a.m. UTC |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Problem
With
friction_model="distributed", or"auto"on a non-planar curvature path,compute_fatiguenever returned for an unclamped layer at zero tension. I found this while switching the default to"auto":test_isothermal_limit_is_bitwise_fatigueran for more than 20 minutes instead of 11 s.The cause is the distributed model's scaling. It splits every sample step into substeps of at most$\kappa_{on}$ , and
max_increment× the slip-onset curvaturethe reference contact pressure. The 66 kV template has no manufacturing clamping. At zero tension under the solved contact model, its contact pressure is round-off:
The existing guard returned zero friction only for a pressure of exactly zero.
Fix
Round-off pressure counts as zero. A reference pressure at or below
PRESSURE_ROUNDOFF_FRACTION= 1e-14 of the wire modulus (2 mPa for steel) takes the existing zero-pressure path: no friction, as for an exact zero and as in the direction-tied law. Real clamping pressures are kPa to MPa.Bounded work.$\kappa_{on}$ and the pressure. The budget is
_substep_countapplies the kernels' subdivision rule before solving. It forms each step the way the kernels do and skips repeated samples as they do, so its count equals theirs. A record that would exceed its budget is refused with aCableInputErrorthat names$$
\max\left(\mathrm{MAX_SUBSTEPS_PER_SAMPLE}\cdot n,\ \mathrm{MIN_SUBSTEP_BUDGET}\right) = \max\left(10,000,n,\ 10^6\right),
$$
for a record of$n$ samples. A normal record needs about 100 per sample, for example 90 on the 66 kV template's inner armour at its clamping. The floor admits a few coarse samples, such as the rig-test load path of $\kappa_{on}$ .
test_long_specimen_zone_tends_to_distributed_law: 2 samples, 22 800 substeps, at a real 2 MPa. A largermax_incrementis not offered as a way out: the kernel does not converge on steps of 1e7"auto"falls back. In the fatigue route,wire_stress_fieldandneutral_axes,"auto"keeps the direction-tied law for such a layer and emitsFrictionModelFallbackWarning, as it already does for a rigid interface or a varying stick modulus.New functions.
distributed_substep_count(spec, kx, ky, contact_pressure_Pa=..., max_increment=..., friction_law=...)anddistributed_substep_budget(samples)return the count and the budget. Tests check the count against the kernel's ownsubsteps.Effect on results
"distributed", or computed with the direction-tied law under"auto"."auto""auto"Tests
New file
tests/test_distributed_near_zero_pressure.pywith sixanalytical_sanitytests:"auto"falls back with the warning, bit-equal to an explicit"direction_tied", while"distributed"raises;validation_report.md: analytical_sanity 1426 → 1432, the only change.The local-analysis guide (distributed-model cost paragraph) and the CHANGELOG describe the pressure floor and the substep budget.
Checks
ruff check src tests examples validation release docandruff format --check;mypy: no issues in 124 files.@codex review