Refactor/wasow galerkin engine#249
Draft
matt-pharr wants to merge 5 commits into
Draft
Conversation
…hared WasowGalerkin engine Extract the singular-Galerkin Hermite FEM and Wasow asymptotic-basis kernel from the GGJ-specific InnerAsymptotics.jl/Galerkin.jl into a model-agnostic engine, so other toroidal inner-layer models (e.g. a future two-fluid layer) can reuse it. GGJ becomes the first client and regression oracle. - Add the WasowGalerkin engine: SystemSpec.jl (model-agnostic seam), Asymptotics.jl (generalized Wasow construction: block-Sylvester split, general Vandermonde, nterms-length recurrence, sizes as values), Galerkin.jl (FEM generic over ncomp), ParityBC.jl, FullDomain.jl, WasowGalerkin.jl. - Build the GGJ SystemSpec in GGJ/GGJSpec.jl and dispatch solve_inner to the engine; delete GGJ/InnerAsymptotics.jl and GGJ/Galerkin.jl (logic moved); keep backward-compatible build_asymptotics/evaluate_asymptotics/pick_xmax. - Extend InnerLayerInterface for the full-domain return path. - Reproduce the glasser_wang_2020_eq55 golden within the solver's xmax-bisection reproducibility floor (ggj_reference.toml thresholds widened and documented). - Add test/runtests_innerlayer.jl (wired into runtests.jl) and docs autodocs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ve via reflect-and-merge Implement and validate the WasowGalerkin full-domain (parity-coupled) path, replacing the earlier buggy scaffolding. The left half is assembled in the reflected coordinate s=-x (a standard right-oriented half-domain, operator I u_ss - V u_s + U u at x=-s, asymptotics continued by per-component parity) and merged with the right half at the shared center node x=0 (value DOFs identified, derivative DOFs sign-flipped; the two x=0 IBP surface terms cancel). This reuses the validated half-domain assembly on each side and fixes all three full-domain bugs, including left ext-cell DOF aliasing. - Add SystemSpec.component_parity (sigma_c, derived from bc: NEUMANN->+1, DIRICHLET->-1; GGJ (+1,-1,-1)); replace the uniform sign-flip in _eval_physical. - FullDomainMatching now holds the general 2x2 end-matching matrix M; add parity_recombine for the symmetric/antisymmetric projection. - For GGJ M is symmetric (rel asym ~1e-10) and recombines to the half-domain (Delta_odd, Delta_even) to ~2e-7 at gamma=1+1i and 0.5+0.3i. M is the general deliverable (asymmetric by design for a parity-broken two-fluid layer). - Half-domain path unchanged bit-for-bit (verified); ggj_reference regression OK. - test/runtests_innerlayer.jl: full-domain recombination + parity-broken cases (44/44). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…gle full-domain solve - Precompute the x-independent Horner-coefficient packings (cc, dd) and fractional-power exponents (rvec = -R/2) once in build_wasow and store them in WasowCache, instead of rebuilding them on every evaluate_wasow call. Cuts evaluate_wasow allocations from 8960 to 6336 bytes/call (~29%); solve_inner drops from 21.0 to 19.4 MB. Output bit-for-bit unchanged (verified). - solve_galerkin_full: factorize once and solve both driving columns together (lu(A) \ rhs) instead of two separate solves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
This is a refactor of the galerkin solver that abstracts it so it could hypothetically be used for other inner layer models, were physics to be added to GGJ.