fix(issue-3): extend Anderson acceleration skip guard to DPS and SLOT…#62
Merged
cbuahin merged 2 commits intoHydroCouple:swmm6_relfrom Apr 20, 2026
Conversation
… regimes
Anderson acceleration (AA) requires a smooth fixed-point operator G
between consecutive Picard iterates. Three surcharge formulations
violate this assumption:
EXTRAN: discontinuous dQ/dH formulation at crown
DYNAMIC_SLOT: per-iterate geometry rewrite (Sharior et al. 2023)
SLOT: C⁰ kink at the slot cutoff (~0.985·yFull)
The existing code only skipped AA for EXTRAN surcharged nodes (from
pr/aa-extran-guard). This extends the guard to all three regimes via
a per-node aa_skip_ flag vector, scatter-computed each Picard iteration
after geometry is known:
- EXTRAN: skip when xnode_.is_surcharged
- DPS: skip end-nodes of conduits with active slot area (As > 0)
- SLOT: skip end-nodes of conduits with depth_mid/yFull in [0.98, 1.02]
Free-surface nodes (95%+ of network) retain full AA speedup.
No physics is altered; only the numerical accelerator is gated.
Implementation:
- DynamicWave.hpp: add aa_skip_ (vector<uint8_t>), computeAASkipFlags()
declaration, aaSkipFlags() const accessor
- DynamicWave.cpp: allocate aa_skip_ in init(), implement
computeAASkipFlags() with O(n_conduits) scatter, call after
computeLinkGeometry() in execute(), guard AA block in
updateNodeDepths() with !aa_skip_[ui]
Tests: 6 new AASkipFlagTest cases in test_routing.cpp
- FreeSurfaceNoSkip, ExtranSurchargedSkips, DPSActiveSkipsEndNodes,
SlotNearKinkSkipsEndNodes, SlotFarFromKinkNoSkip, AADisabledNoFlags
All 61 routing tests pass.
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.
… regimes
Anderson acceleration (AA) requires a smooth fixed-point operator G between consecutive Picard iterates. Three surcharge formulations violate this assumption:
EXTRAN: discontinuous dQ/dH formulation at crown
DYNAMIC_SLOT: per-iterate geometry rewrite
SLOT: C⁰ kink at the slot cutoff (~0.985·yFull)
The existing PR only skipped AA for EXTRAN surcharged nodes (from pr/aa-extran-guard). This extends the guard to all three regimes via a per-node aa_skip_ flag vector, scatter-computed each Picard iteration after geometry is known:
Free-surface nodes (95%+ of network) retain full AA speedup. No physics is altered; only the numerical accelerator is gated.
Implementation:
Tests: 6 new AASkipFlagTest cases in test_routing.cpp