Skip to content

ForceFreeStates - REFACTOR! - Run deck matching through a MatchProblem clause in main - #554

Merged
matt-pharr merged 2 commits into
refactor/stage-timing-in-mainfrom
refactor/deck-match-in-main
Oct 26, 2026
Merged

matt-pharr merged 2 commits into
refactor/stage-timing-in-mainfrom
refactor/deck-match-in-main

Conversation

@matt-pharr

@matt-pharr matt-pharr commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Release note

  • Audience: users
  • Numerical impact: none (harness @ 4d2a8cb)
  • Migration: A deck run with gal_match_flag no longer writes SingularSurfaces/Match/Inner/; the composite inner-region profiles are a scripting diagnostic (Galerkin(; cut_solution=true) then solve(MatchProblem(...))). gal_cut_solution is no longer a deck key; keep the cut solution from a script with Galerkin(; cut_solution=true). solve(EulerLagrangeProblem; gal_match_flag=true) now errors; match the result with solve(MatchProblem(ffs; eta, rho, rotation), GGJModel()).

A deck now matches the inner layer through the same MatchProblem a script poses, run by main after the outer solve. That also lets a deck match a Riccati solve, where gal_match_flag used to be silently ignored, and makes a forward solve with gal_match_flag fail with a clear error instead.

Regression report

Stacked on #552, so the baseline is refactor/stage-timing-in-main.

SDCC fan-out at 4d2a8cb7f (vs refactor/stage-timing-in-main @ 4d75b8047) is running after the rebase onto develop 2842dfc2d;
the full report replaces this block when it lands.

gal_resistive_pe is N/A on both refs: a matched result publishes no ideal δW, so PerturbedEquilibrium skips it. That is the existing state, not a change here.

Notes for reviewers

Stacked on #552, which sits on #546 (stack B). Closes 7d-match-into-main, match-riccati and match-resistive.

  • The gal_match_flag block moves out of run_force_free_states into run_deck_match(result, ctrl). main calls it right after the outer solve and before the HDF5 write, so SingularSurfaces/Match is written exactly as before. It builds the same MatchProblem and GGJModel a script would.
  • The integrator == "galerkin" gate is gone. A Riccati deck with vac_flag = true now matches, and a Forward deck errors through MatchProblem ("no Δ′") instead of ignoring the flag.
  • The deck's duplicate checks (gal_rpec_flag, missing gal_eta/gal_rho/gal_rotation) are dropped; MatchProblem already rejects both. The deck-only gal_inner_solver check stays.
  • solve(EulerLagrangeProblem) rejects gal_match_flag=true, so matching has one route: a MatchProblem posed on the result.
  • Cut solution is API-only. This follows InnerLayer.GGJ - REFACTOR! - Solve the :ray BVP with the Galerkin assembly and use one parity convention #536's decision that inner-region profiles are a diagnostic not exposed in the deck. gal_cut_solution is removed from ForceFreeStatesControl; Galerkin(; cut_solution) hands it to galerkin_solve as a solve option, which no longer infers it from gal_match_flag. Nothing in the examples, harness or other tests read Match/Inner from a deck run.
  • A deck match with gal_inner_solver = "galerkin" logs MatchProblem's existing one-time warning that no cut solution was retained. Since InnerLayer.GGJ - REFACTOR! - Solve the :ray BVP with the Galerkin assembly and use one parity convention #536, :ray returns layer-centre values only, so :ray decks don't see it.

Tests (runtests_solve_api.jl):

  • Test - TEST - Add deck/API parity tests with the known drifts marked broken #546's cut-solution test now passes, so it is no longer marked broken. The deck and the API without the cut agree on bpen, the matched ξ and the (empty) inner profiles, and the API with cut_solution=true still produces them.
  • New: deck/API parity for a Riccati match (bpen, cout), a Forward deck with gal_match_flag erroring, and solve(...; gal_match_flag=true) erroring.
  • runtests_solve_api, runtests_galerkin and runtests_matching_models pass locally.

The gal_* match keys are now misnamed, since Riccati matches too. A follow-up (roadmap PR 8b) moves them into a [Match] section named after the MatchProblem keywords, with a warn-and-map shim for one release.

Overlap: #536 edits the gal_inner_solver comment line in CoreTypes.jl, next to the gal_cut_solution and gal_match_flag comment lines changed here. Whichever lands second resolves a one-line conflict.

🤖 Generated with Claude Code

@matt-pharr matt-pharr self-assigned this Oct 21, 2026
@matt-pharr
matt-pharr requested a review from logan-nc October 21, 2026 15:25
@github-actions github-actions Bot added changed-results Results move or an interface breaks - read before upgrading refactor Behavior-preserving restructuring labels Oct 21, 2026
@matt-pharr
matt-pharr added this pull request to stack #553 October 22, 2026 12:38

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read in full. Ready to approve from my read, with one migration nit for you to decide.

gal_cut_solution leaves ForceFreeStatesControl but is not added to _DEPRECATED_FFS_KEYS or the toml-no-deprecated-keys pre-commit regex. A deck that still sets it fails as an unknown keyword (MethodError) instead of the deprecation message, and once #569 lands, instead of its stop. One tuple entry plus one regex token would fix it. I did not push it because it touches src/ (stamp) and #569 edits the same lists. Nothing else: Match/Inner has no remaining readers, run_deck_match builds the same MatchProblem/GGJModel the old block did, and the Riccati-match and forward-error tests cover the two behaviour changes.

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 769685c on the comment review above. Whether gal_cut_solution gets a deprecation entry is your call and does not block this.

matt-pharr and others added 2 commits October 26, 2026 09:47
gal_cut_solution is no longer a ForceFreeStatesControl field or a deprecated
deck key. Galerkin(; cut_solution=true) passes it to galerkin_solve as a solve
option, so only a script can keep the cut solution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matt-pharr
matt-pharr force-pushed the refactor/deck-match-in-main branch from 769685c to 4d2a8cb Compare October 26, 2026 08:48
@matt-pharr
matt-pharr merged commit 578376d into develop Oct 26, 2026
10 of 16 checks passed
@matt-pharr
matt-pharr deleted the refactor/deck-match-in-main branch October 26, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changed-results Results move or an interface breaks - read before upgrading refactor Behavior-preserving restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants