Motivation
ForceFreeStates has grown organically: Riccati.jl is a ~2000-line monolith mixing four distinct concerns, the singular-surface machinery is scattered across files, and ForceFreeStatesStructs.jl is an everything-bucket of types owned by different subsystems. Galerkin already shows the target pattern (its own subdirectory); the rest of the module should follow.
Proposed layout
Riccati/ — split the monolith along its natural seams:
Propagators.jl — FM propagator integration (chunk integration, bidirectional crossing chunks)
DeltaPrimeBVP.jl — Δ′ BVP assembly + solve + PEST-3 decomposition
Crossings.jl — singular-surface crossing algorithms
Driver.jl — chunk orchestration (riccati_eulerlagrange_integration)
Surfaces/ — singular-surface finding/filtering and GGJ coefficients in one place: sing_lim!, sing_find!, sing_min!, resist_eval_all!, SingType
Matching/ — new home for inner-layer matching work (delta_mn, ResistiveMatch models; see REFACTOR_PLAN.md D13/D14) rather than bolting it onto Riccati or Galerkin
- Structs colocated with owners — dissolve
ForceFreeStatesStructs.jl so each type lives next to the code that produces it
Exact file boundaries to be finalized when the PR is cut; the list above is the agreed shape.
Process constraints (agreed, non-negotiable)
Verification
- Full test suite unchanged
- Byte-identical
gpec.h5 on a forward and a riccati deck vs the pre-move commit
- Regression harness: no tracked quantity moves
🤖 Generated with Claude Code
Motivation
ForceFreeStates has grown organically:
Riccati.jlis a ~2000-line monolith mixing four distinct concerns, the singular-surface machinery is scattered across files, andForceFreeStatesStructs.jlis an everything-bucket of types owned by different subsystems. Galerkin already shows the target pattern (its own subdirectory); the rest of the module should follow.Proposed layout
Riccati/— split the monolith along its natural seams:Propagators.jl— FM propagator integration (chunk integration, bidirectional crossing chunks)DeltaPrimeBVP.jl— Δ′ BVP assembly + solve + PEST-3 decompositionCrossings.jl— singular-surface crossing algorithmsDriver.jl— chunk orchestration (riccati_eulerlagrange_integration)Surfaces/— singular-surface finding/filtering and GGJ coefficients in one place:sing_lim!,sing_find!,sing_min!,resist_eval_all!,SingTypeMatching/— new home for inner-layer matching work (delta_mn,ResistiveMatchmodels; seeREFACTOR_PLAN.mdD13/D14) rather than bolting it onto Riccati or GalerkinForceFreeStatesStructs.jlso each type lives next to the code that produces itExact file boundaries to be finalized when the PR is cut; the list above is the agreed shape.
Process constraints (agreed, non-negotiable)
git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change --histogramplus a byte-identity HDF5 check.Verification
gpec.h5on a forward and a riccati deck vs the pre-move commit🤖 Generated with Claude Code