FE Quadrature Phase 01 abstract contract - #593
Conversation
updating fork repo with upstream head
update main to upstream branch
|
@ktbolt @michelebucelli let me know what you think of the abstract class contract for quadrature. I believe the public API for this contract is minimal and clean while ensuring that explicit Quadrature rules that are created can be validated. As always, happy to have more design input here and will incorporate changes pretty quickly so we can begin making a concrete QuadratureRule class. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #593 +/- ##
==========================================
+ Coverage 72.54% 72.79% +0.24%
==========================================
Files 252 255 +3
Lines 39033 39511 +478
Branches 6684 6711 +27
==========================================
+ Hits 28318 28763 +445
- Misses 10480 10513 +33
Partials 235 235 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
michelebucelli
left a comment
There was a problem hiding this comment.
Thank you @zasexton! I have left some comments. Some of them relate to the documentation, others to the interface itself.
In general, I am not sure I have understood correctly how the concrete rules are meant to be implemented (as you might see from some of my comments). In this respect, I think it would be useful to include in this PR at least one concrete rule (I assume you have implemented some, at least for the sake of testing the infrastructure), which would serve as a demonstration of how to use the abstract framework. I think this would make review a bit easier.
|
Thanks for these comments @michelebucelli I'll review these today and make appropriate changes. Overall there is a good bit of important design feedback here that will help me to improve this base abstraction (which is the main purpose of me posting this draft PR). Thank you! |
|
Thanks for the patience! I have made my relevant edits to the PR branch and will be going through and addressing comments directly now! |
|
@ktbolt and @michelebucelli let me know what you think of the changes and simplifications that have been made over the last 11 commits. I believe that I have addressed many of the original comments. Overall, I think that we are getting close to a clean abstract class here to complete phase 1 of the quadrature refactor. |
Summary
This pull request establishes Phase 01 of the finite-element Quadrature module.
It defines the immutable reference-rule contract that concrete rule generation,
selection, and consumer migration can build on in later phases.
Related to #580.
The change:
QuadratureRuleinterface for canonicalreference cells.
reference-cell measure, and const sample access.
and immutable query interface.
the FE documentation hierarchy.
Design
Immutable rule contract
QuadratureRuleowns one complete set of ordered reference points and weights.Successful construction establishes the invariant, after which consumers use
only const queries. Rule objects are non-copyable and non-movable and are
intended to be created once and shared through const ownership.
Concrete providers construct a protected
RuleDatapayload containing:The base class derives dimension and reference-cell measure from
CellFamily,preventing providers from supplying redundant topology metadata.
Supported reference cells
The Phase 01 contract covers:
Pyramid, polygon, polyhedron, and unknown families remain explicitly
unsupported.
Construction validation
Construction rejects:
validation tolerance.
Duplicate points and zero or negative individual weights remain admissible when
all other invariants hold.
The weight sum is evaluated exactly from the stored binary64 values using a
fixed-storage accumulator. Validation is therefore independent of point/weight
ordering, cancellation, intermediate floating-point overflow, and the host
long doublerepresentation. Compile-time checks document and enforce thebinary64 value model and object layout required by that accumulator; this
will be important for cross-platform compile time validation.
Phase 01 regression tests
The Phase 01 tests are intentionally limited to the new Quadrature
infrastructure. They verify:
QuadPointrepresentation.QuadratureRulequery interface.containment.
reordered inputs, and large rules.
These tests do not exercise existing quadrature tables, solver-specific selection
paths, or integration consumers.
Supporting changes
QuadratureTypeenumeration from the sharedFE vocabulary.
FE/Quadraturesources to the solver target.before documentation generation, ensuring relative paths resolve
consistently.
Scope and non-goals
This pull request intentionally does not:
mapping.
Validation performed
run_all_unit_testsandsvmultiphysics.