FE Quadrature Phase 01 abstract contract - #593
Conversation
updating fork repo with upstream head
update main to upstream branch
|
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. |
michelebucelli
left a comment
There was a problem hiding this comment.
Thank @zasexton! I have a few leftover minor comments.
I still think it would be useful if you could provide a prototypical quadrature rule implementation, to give an idea about how you envision this in the longer run.
| std::vector<QuadPoint> points, | ||
| std::vector<double> weights); |
There was a problem hiding this comment.
- It'd be better to pass these by const reference, I think.
- Since
pointsandweightsare required to have the same size, wouldn't it be better to store them (or at least require the caller to provide them) asstd::vector<std::pair<QuadPoint, double>> points_and_weights? This way, the same-size constraint would be impossible to violate. Should this be used for the data members as well, I think the overhead for access through theweight()andpoint()getters is essentially zero, while there'd be a bit more overhead for the vector accessespointsandweights.
I've made a very simple example in the |
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.