You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
InnerLayer - Order InnerLayerResponse and SLAYER as (Δ₊, Δ₋) = (interchange, tearing) #538
@d-burg, proposal for SLAYER and the shared InnerLayerResponse, following the GGJ parity cleanup in #536.
Background
#536 settles one parity convention for the GGJ inner layer, taken from the literature:
Parity is that of the displacement ξ (inner Ξ): even is |x|^α, odd is sgn(x)|x|^α (Pletzer, Bondeson & Dewar, J. Comput. Phys. 115, 530 (1994), Eqs. 32–33; Glasser, Wang & Park, Phys. Plasmas 23, 112506 (2016), Eq. 34). The sign follows the parity: + is even, − is odd.
Tearing is odd, Δ₋. Its flux Ψ is even and reconnects; this is the channel of the tearing dispersion relation and the FKR Δ′ (PBD Eqs. 87–89).
Interchange is even, Δ₊ (PBD's A′ block).
Positional pairs are ordered (Δ₊, Δ₋) = (interchange, tearing), as in PBD Eqs. 77 and 83 and GWP Eq. 38. The matching system (deltar, cin rows, Delta_r in gpec.h5) and the Fortran deltac output already use this order.
After #536, every GGJ backend (:ray, :galerkin, :shooting) uses (Δ₊, Δ₋) for every positional pair and its internal parity index, and builds InnerLayerResponse by keyword.
What is still inconsistent
InnerLayerResponse itself stores its fields as (tearing, interchange), the opposite of the positional order everywhere else. So the positional constructor InnerLayerResponse(a, b) means (Δ₋, Δ₊). Places that use it positionally:
src/InnerLayer/SLAYER/Riccati.jl: InnerLayerResponse(Δ, zero(ComplexF64)) and the NaN sentinel.
The mock inner models in test/runtests_dispersion_{residual,scan,coupled,coupled_full,amr}.jl.
Field access by name (.tearing, .interchange) in Tearing is unaffected.
Proposal
Reorder InnerLayerResponse to (interchange, tearing), so the struct follows the same (Δ₊, Δ₋) order as every other pair in InnerLayer. Alternatively, keep the field order but drop the positional constructor and require keywords; that removes the ambiguity without depending on field order.
Build SLAYER's responses by keyword: InnerLayerResponse(; tearing=Δ).
Update the positional constructions in the dispersion tests to match.
No numbers move. It's a construction-order change plus documentation. Does either option conflict with anything planned for SLAYER or the dispersion code?
Activity