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
ForceFreeStates — multi-n support in build_kinetic_metric_matrices #246
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.
Checked against develop (db90e82) before deciding whether to open a PR tonight. build_kinetic_metric_matrices is still single-n: Fourfit.jl:134-135 sets n = nlow and the five matrices are mpert² per surface; the assert from #112 is gone, so a multi-n deck with kinetic_factor > 0 silently builds every kinetic matrix at nlow (callers: CalculatedKineticMatrices.jl:90, KineticForcesStructs.jl:388). Not opening the PR now: #569 rewrites CalculatedKineticMatrices (the compute_kinetic_matrices_at_psi! signature and the block-diagonal consumer this would have to change), and the acceptance criterion needs a new DIII-D multi-n kinetic harness case, which is hours of compute I am keeping off the shared machine this week. Plan: after #569 lands, first commit restores a loud error for nlow != nhigh on the kinetic path, second lifts it with the (mpert·npert)² layout and the harness case.
Activity
logan-nc commentedon Oct 27, 2026
Checked against develop (db90e82) before deciding whether to open a PR tonight.
build_kinetic_metric_matricesis still single-n:Fourfit.jl:134-135setsn = nlowand the five matrices arempert²per surface; the assert from #112 is gone, so a multi-n deck withkinetic_factor > 0silently builds every kinetic matrix atnlow(callers:CalculatedKineticMatrices.jl:90,KineticForcesStructs.jl:388). Not opening the PR now: #569 rewritesCalculatedKineticMatrices(thecompute_kinetic_matrices_at_psi!signature and the block-diagonal consumer this would have to change), and the acceptance criterion needs a new DIII-D multi-n kinetic harness case, which is hours of compute I am keeping off the shared machine this week. Plan: after #569 lands, first commit restores a loud error fornlow != nhighon the kinetic path, second lifts it with the(mpert·npert)²layout and the harness case.