Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #645 +/- ##
==========================================
+ Coverage 73.41% 73.52% +0.11%
==========================================
Files 269 272 +3
Lines 40337 40789 +452
Branches 6755 6796 +41
==========================================
+ Hits 29612 29992 +380
- Misses 10482 10554 +72
Partials 243 243 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
michelebucelli
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @zasexton! I left some comments below.
Co-authored-by: Michele Bucelli <michelebucelli415@gmail.com>
zasexton
marked this pull request as ready for review
September 24, 2026 23:10
Propagate nonnegative counts through both generators and test helpers, keeping signed exactness and diagnostic conversions explicit. Addresses SimVascular#645 (comment)
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.
Current situation
Phase 01 (#593) introduced the concrete
QuadratureRulevalue type, but the module does not yet provide generators for Gaussian line rules. This PR implements Phase 02 of#580 by adding Gauss-Legendre and Gauss-Lobatto-Legendre generators on
[-1, 1].Both functions accept signed
int requested_exactnessand return a completeQuadratureRuleby value with at least that exactness. Each family owns its conversion to the smallest sufficient point count; future selectors do not need to duplicate these formulas or infer exactness limits from point limits. These line rules provide factors for later element generators. Existing solver quadrature tables and consumers are unchanged.Newton refinement computes the Legendre polynomial roots or stationary points needed to support each requested size. The implementation uses a three-term recurrence and analytic derivatives, computes one half of the samples, and
mirrors them into increasing order. Refinement has a defensive 100-iteration bound. Correction and measure tolerances are
64 * epsilonand32 * 128 * epsilon, respectively, whereepsilonisstd::numeric_limits<double>::epsilon(); both are qualified over every supported point count. Invalid exactness requests raiseInvalidArgumentExceptionbeforepoint-count conversion or sample allocation; unsuccessful refinement or numerical validation raises
ConvergenceException. Failed weights are never rescaled to force the reference measure.Release Notes
make_gauss_legendre_rule(int requested_exactness)for requests0..255, using integer divisionn = requested_exactness / 2 + 1to select 1 through 128 interior points with actual exactness2n - 1.make_gauss_lobatto_rule(int requested_exactness)for requests0..253, usingn = requested_exactness / 2 + 2to select 2 through 128 points, including both endpoints exactly, with actual exactness2n - 3.constexpr noexceptcapacity queriesmax_gauss_legendre_exactness()returning 255 andmax_gauss_lobatto_exactness()returning 253. The internal 128-point ceiling is a project support bound that limits construction cost and downstream product-rule growth, not a mathematical or convergence limit.Documentation
The two public headers document supported request ranges, integer-division conversion formulas, at-least-requested semantics, degree-zero behavior, actual metadata, ordering, endpoints, capacity rationale, and exception semantics in
the existing
FE_QuadratureDoxygen group. Implementation and test comments explain the numerical tolerances and qualification strategy.The PR contains only the two generator headers, their implementations, and
test_QuadratureGenerators.cpp. Current upstream'ssvmp_fe_quadraturetarget and unit-test discovery include these files without CMake edits.Testing
The eight focused tests cover:
svmp_fe_quadrature,run_all_unit_tests, andsvmultiphysicsbuilt successfully with the revised API.Code of Conduct & Contributing Guidelines