Repository navigation
Fix functional weak-form auxiliary field handling - #1663
Open
chvillanuevap wants to merge 5 commits into
Open
chvillanuevap wants to merge 5 commits into
chvillanuevap wants to merge 5 commits into
Conversation
chvillanuevap
commented
Sep 23, 2026
Member
- Refresh auxiliary fields before residual and derivative evaluations.
- Handle empty coupling parameter packs and use the correct dimension for boundary integrals.
Refresh auxiliary fields before residual and derivative evaluations. Handle empty coupling parameter packs and
use the correct dimension for boundary objectives.
chapman39
reviewed
Sep 24, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Three moderate test-coverage requests remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (4)
What changed in this PR
This pull request improves auxiliary-field refresh behavior, boundary objective integration, and empty coupling-pack handling.
Changes:
- Adds initialization-state tracking and pre-assembly refresh callbacks.
- Corrects boundary integration dimensions.
- Supports empty coupling and parameter packs.
| File | Summary | Review notes |
|---|---|---|
src/smith/physics/state/state_manager.hpp |
Adds an initialization-state query. | — |
src/smith/physics/functional_weak_form.hpp |
Refreshes auxiliary fields before evaluations. | Moderate: add regression coverage for callback refresh behavior. Nit: document the user-visible API change. |
src/smith/physics/functional_objective.hpp |
Corrects boundary integration dimension. | Moderate: add a boundary-objective regression test. |
src/smith/differentiable_numerics/coupling_params.hpp |
Handles empty coupling and parameter packs. | Moderate: add compile-time coverage for empty-pack combinations. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Add regression tests for auxiliary-field refresh across residual, Jacobian, JVP, and VJP evaluations. - Verify residual scaling, frozen-auxiliary finite differences, and derivative consistency. - Add analytic 2D and 3D boundary-objective integration tests. - Cover empty coupling and parameter pack combinations with compile-time assertions. - Simplify empty-pack handling and remove unused StateManager initialization tracking. - Document callback refresh semantics, quasi-Newton linearization, and the boundary integration dimension convention. The pre-assembly callback synchronizes externally computed auxiliary fields with the current nonlinear iterate before each evaluation. These fields are held fixed during automatic differentiation, yielding a frozen-auxiliary Jacobian rather than a total derivative through the update. The targeted FunctionalWeakForm regression passed in a Release build. The corresponding downstream auxiliary-field regression also passed.
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.

