ForceFreeStates.build_kinetic_metric_matrices (src/ForceFreeStates/Fourfit.jl:151-315) hardcodes n = intr.nlow at the inner-product loop (line 285) and allocates only mpert² storage. Fortran pentrc/dcon_interface.f:863-1020 (idcon_action_matrices) is intrinsically single-n (the toroidal mode is a module-scope nn, no outer-n loop, matrices sized mpert²).
PR #112 adds @assert intr.nlow == intr.nhigh to make this loud. Lifting the restriction would be a Julia-only extension beyond Fortran and would require:
- Allocating
(mpert·npert)² storage for each of smats/tmats/xmats/ymats/zmats.
- Wrapping the inner-product loop in
for n in intr.nlow:intr.nhigh.
- Updating
CalculatedKineticMatrices.compute_calculated_kinetic_matrices to consume the block-diagonal layout (it currently rebuilds the block diagonal manually).
Acceptance
npert > 1 runs no longer assert.
- DIIID multi-n regression case added under
regression-harness/cases/ showing finite et[1] for at least n=1,2,3.
- Reference: Logan PhD thesis (2015), Appendix C, Eqs. C.1-C.11.
ForceFreeStates.build_kinetic_metric_matrices(src/ForceFreeStates/Fourfit.jl:151-315) hardcodesn = intr.nlowat the inner-product loop (line 285) and allocates onlympert²storage. Fortranpentrc/dcon_interface.f:863-1020(idcon_action_matrices) is intrinsically single-n (the toroidal mode is a module-scopenn, no outer-n loop, matrices sizedmpert²).PR #112 adds
@assert intr.nlow == intr.nhighto make this loud. Lifting the restriction would be a Julia-only extension beyond Fortran and would require:(mpert·npert)²storage for each ofsmats/tmats/xmats/ymats/zmats.for n in intr.nlow:intr.nhigh.CalculatedKineticMatrices.compute_calculated_kinetic_matricesto consume the block-diagonal layout (it currently rebuilds the block diagonal manually).Acceptance
npert > 1runs no longer assert.regression-harness/cases/showing finite et[1] for at least n=1,2,3.