Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3361 commits
Select commit Hold shift + click to select a range
a319ed2
ForceFreeStates - MINOR - Merge develop into the resonant crossing fix
matt-pharr Oct 28, 2026
a0305d1
Merge branch 'develop' into feature/toroidal-delta-crit-geometry
matt-pharr Oct 28, 2026
753986f
Tearing - BUGFIX - Take the first resolved fold from Q0 as the penetr…
d-burg Oct 28, 2026
55cf372
Repo - DOCS - Scope the BIEST notice to the derived files and carry i…
logan-nc Oct 28, 2026
da69261
Merge remote-tracking branch 'origin/develop' into feature/b_crit_cal…
d-burg Oct 28, 2026
0ec7ae7
Merge branch 'develop' into docs/biest-attribution
jhalpern30 Oct 28, 2026
f968890
InnerLayer.SLAYER - DOCS - Describe chi_tor as the toroidal momentum …
d-burg Oct 28, 2026
7817f0e
Repo - DOCS - Attribute the 3D vacuum singular correction to BIEST (#…
jhalpern30 Oct 28, 2026
d965973
Tearing - DOCS - Describe the threshold as the first resolved fold fr…
d-burg Oct 28, 2026
3115e92
Merge remote-tracking branch 'origin/develop' into bugfix/reversed-sh…
d-burg Oct 28, 2026
7dc94d3
Merge remote-tracking branch 'origin/develop' into bugfix/equilibrium…
d-burg Oct 28, 2026
526141d
Merge remote-tracking branch 'origin/develop' into bugfix/ggj-ray-fol…
d-burg Oct 28, 2026
2950631
Merge remote-tracking branch 'origin/develop' into feature/optional-e…
d-burg Oct 28, 2026
db86ea2
Merge remote-tracking branch 'origin/develop' into bugfix/ffs-crossin…
d-burg Oct 28, 2026
2dc99e1
InnerLayer.GGJ - BUGFIX - Keep develop's harness floors, warn once on…
d-burg Oct 28, 2026
8d2eca4
ForceFreeStates - TEST - Check the kinetic Euler-Lagrange matrices on…
d-burg Oct 28, 2026
9aaa50d
Equilibrium - BUGFIX - Reject a minimum of psi as the axis, restart N…
d-burg Oct 28, 2026
c6536ef
Repo - API! - Unify stage result saving under save_to_hdf5
matt-pharr Oct 28, 2026
538dcf5
ForceFreeStates - BUGFIX - Seed psilim from the edge inward and check…
d-burg Oct 28, 2026
36cbc5e
Equilibrium - BUGFIX - Cap rational-surface brackets at half the gap …
d-burg Oct 28, 2026
a97fe4a
Equilibrium - FEATURE - Add a hollow current profile to the large-asp…
d-burg Oct 28, 2026
e52e47d
Tearing - BUGFIX! - Require resolved interior maxima for critical fields
matt-pharr Oct 28, 2026
3a6435d
Repo - MINOR - Merge develop into critical resonant field branch
matt-pharr Oct 28, 2026
4f9e4d6
ForceFreeStates - API! - Rename EulerLagrangeProblem to ForceBalanceP…
matt-pharr Oct 28, 2026
ca75806
Regression - TEST - Add a large-aspect-ratio reversed-shear n=1 case …
d-burg Oct 28, 2026
f7f3cf0
Merge branch 'develop' into test/enable-formatter-ci-gate
matt-pharr Oct 28, 2026
58d12b3
Merge branch 'develop' into feature/kinetic-profiles-on-equilibrium
matt-pharr Oct 28, 2026
1fc2349
InnerLayer.SLAYER - DOCS - 🌱 Describe chi_tor as the toroidal momentu…
matt-pharr Oct 28, 2026
7f5f17a
Merge branch 'develop' into test/streamline-suite
matt-pharr Oct 28, 2026
5eff23c
Tearing - FEATURE - Add critical resonant field calculations to the t…
matt-pharr Oct 28, 2026
de7d87d
ForceFreeStates - API! - Move integration numerics onto algorithm obj…
matt-pharr Oct 28, 2026
b0b44f0
Merge remote-tracking branch 'origin/develop' into refactor/v2-consol…
matt-pharr Oct 28, 2026
38107e0
Merge remote-tracking branch 'origin/develop' into bugfix/ffs-crossin…
d-burg Oct 29, 2026
3a899ff
Regression - TEST - Give the axis q of the reversed-shear fixture as …
d-burg Oct 29, 2026
f43b5be
ForceFreeStates - BUGFIX! - ⚠️ Remove the resonant solution at ideal …
d-burg Oct 29, 2026
4974373
Merge remote-tracking branch 'origin/develop' into bugfix/reversed-sh…
d-burg Oct 29, 2026
c72188c
Merge remote-tracking branch 'origin/develop' into feature/toroidal-d…
d-burg Oct 29, 2026
f719fb2
Merge remote-tracking branch 'origin/develop' into bugfix/equilibrium…
d-burg Oct 29, 2026
8a56fd6
Merge remote-tracking branch 'origin/develop' into refactor/slayer-fl…
d-burg Oct 29, 2026
cd80162
InnerLayer.SLAYER - BUGFIX - Warn that theta_sample has no effect und…
d-burg Oct 29, 2026
92e8103
Tearing - BUGFIX! - Polish roots with a real 2x2 Jacobian so the anti…
d-burg Oct 23, 2026
aac35ab
Tearing - TEST - Bound the polish's one-iteration evaluation count an…
d-burg Oct 28, 2026
8b5dd91
Tearing - FEATURE - Classify tearing roots by winding number
d-burg Oct 26, 2026
c705703
Tearing - REFACTOR - Plug winding classification into the shared root…
d-burg Oct 29, 2026
b06477d
Tearing - TEST - Widen only the winding recheck circle, and expect th…
d-burg Oct 29, 2026
18d88c9
Regression - TEST - Add a diiid_slayer_n1 variant with winding-number…
d-burg Oct 29, 2026
aea8d69
Tearing - FEATURE - Extract GGJ growth rates from the full matching d…
d-burg Oct 26, 2026
3dc5f80
Tearing - BUGFIX - Check coupled GGJ growth rates against a direct so…
d-burg Oct 29, 2026
0671b86
LocalStability - API! - Separate problem settings from ballooning num…
matt-pharr Oct 29, 2026
a4e32cb
Merge remote-tracking branch 'origin/bugfix/slayer-polish-antianalyti…
matt-pharr Oct 29, 2026
36d54d2
Tearing - DOCS - Clarify sampled winding-count limitations
matt-pharr Oct 29, 2026
4ecda73
Repo - MINOR - Merge develop into the singular-cutoff branch
matt-pharr Oct 29, 2026
cd815a1
Tearing - MINOR - Merge winding classification updates into GGJ growt…
matt-pharr Oct 29, 2026
8a6ae1b
Tearing - BUGFIX! - Keep GGJ root analysis in the positive-growth domain
matt-pharr Oct 29, 2026
a54a788
Merge branch 'develop' into feature/kinetic-profiles-on-equilibrium
matt-pharr Oct 29, 2026
e192749
Tearing - FEATURE - Extract GGJ growth rates from the full matching d…
matt-pharr Oct 29, 2026
e975f9d
PerturbedEquilibrium - BUGFIX! - Converge the singular coupling with …
matt-pharr Oct 29, 2026
bdc16de
Merge branch 'develop' into bugfix/equilibrium-axis-search-robustness
matt-pharr Oct 29, 2026
6fa08b8
Merge branch 'develop' into bugfix/reversed-shear-double-rational
matt-pharr Oct 29, 2026
6d1b10e
Merge branch 'develop' into feature/optional-el-matrix-output
matt-pharr Oct 29, 2026
01832c0
Merge branch 'develop' into bugfix/ggj-ray-followups
matt-pharr Oct 29, 2026
6526b05
InnerLayer.GGJ - BUGFIX - Accept profile-only options in the :ray sol…
matt-pharr Oct 29, 2026
219b871
HDF5Schema - API! - ⚠️ Make the Euler-Lagrange matrix output optional…
matt-pharr Oct 29, 2026
cb5c8fb
Merge branch 'develop' into test/streamline-suite
matt-pharr Oct 29, 2026
c63561d
Merge remote-tracking branch 'origin/develop' into refactor/v2-consol…
matt-pharr Oct 29, 2026
9733111
Merge remote-tracking branch 'origin/test/streamline-suite' into refa…
matt-pharr Oct 29, 2026
5b2258e
Repo - PERF - Shorten test wall time and close periodic kinetic sampl…
matt-pharr Oct 29, 2026
7bee5a6
Merge branch 'develop' into feature/kinetic-profiles-on-equilibrium
logan-nc Oct 29, 2026
559d96d
Rerun - BUGFIX - Attach the stored deck's kinetic profiles to the res…
logan-nc Oct 29, 2026
255586d
Repo - BUGFIX - Stop decks that still name the kinetic-profile file u…
logan-nc Oct 29, 2026
345d1d1
Tearing - API! - Fold Runner into Tearing and solve GGJ growth rates …
matt-pharr Oct 29, 2026
dfce527
Merge remote-tracking branch 'origin/develop' into refactor/slayer-fl…
logan-nc Oct 29, 2026
0049f1e
InnerLayer.SLAYER - DOCS - Describe theta as midplane-only and name t…
logan-nc Oct 29, 2026
4f7f665
Tearing - BUGFIX - Doppler-shift each GGJ surface into its own E×B fr…
d-burg Oct 29, 2026
fae9142
Equilibrium - API! - Hold the plasma's species, transport defaults an…
matt-pharr Oct 29, 2026
58cadc4
Tearing - API! - Put the SLAYER layer closures on SLAYERModel and cap…
matt-pharr Oct 29, 2026
1a694bc
Merge branch 'develop' into refactor/v2-consolidation
matt-pharr Oct 29, 2026
6f9fe66
Merge branch 'develop' into test/enable-formatter-ci-gate
matt-pharr Oct 29, 2026
cb523a1
Repo - API! - Move the output file and verbosity into one [Run] secti…
matt-pharr Oct 29, 2026
fb53c73
Repo - API! - Resolve deck paths against the deck directory and drop …
matt-pharr Oct 29, 2026
924109e
ForceFreeStates - API! - Select the kinetic source by type with a kin…
matt-pharr Oct 29, 2026
b6a2889
InnerLayer.SLAYER - FEATURE! - 🚨 Derive the toroidal critical-Δ geome…
d-burg Oct 29, 2026
fa7eced
InnerLayer.SLAYER - FEATURE! - Optional chi_perp_Dc sets the critical…
d-burg Oct 29, 2026
10ec452
Repo - API! - Read kinetic profiles once into the equilibrium and der…
logan-nc Oct 29, 2026
7056464
Merge branch 'develop' into bugfix/ggj-per-surface-doppler
logan-nc Oct 29, 2026
249f268
Merge remote-tracking branch 'origin/develop' into refactor/slayer-fl…
logan-nc Oct 29, 2026
a0232cc
Repo - API! - Read every deck section through one parser into the new…
matt-pharr Oct 29, 2026
2fbf7b3
Merge branch 'develop' into refactor/v2-consolidation
matt-pharr Oct 29, 2026
e200765
ForceFreeStates - BUGFIX - Start every integrator at one qlow bound f…
logan-nc Oct 29, 2026
29fdcaf
Equilibrium - MINOR - Summarize capped grid brackets in one warning a…
logan-nc Oct 29, 2026
b0f1b06
Merge remote-tracking branch 'origin/develop' into bugfix/reversed-sh…
logan-nc Oct 29, 2026
bcec399
Merge branch 'develop' into refactor/slayer-flux-radial-label
logan-nc Oct 29, 2026
1b53d96
Merge branch 'develop' into refactor/v2-consolidation
matt-pharr Oct 29, 2026
030c676
Merge branch 'develop' into bugfix/equilibrium-axis-search-robustness
logan-nc Oct 29, 2026
daaea02
Equilibrium - API! - Select an analytic equilibrium by its own deck s…
matt-pharr Oct 29, 2026
6ca1b6f
ForceFreeStates - BUGFIX! - ⚠️ Keep both crossings of a rational surf…
logan-nc Oct 29, 2026
6375f88
KineticForces - API! - Evaluate the kinetic torque with kinetic_torqu…
matt-pharr Oct 29, 2026
7d19edf
ErrorFields - API! - Assess error fields with error_fields on a plasm…
matt-pharr Oct 30, 2026
1c71c9b
InnerLayer.SLAYER - API! - Default the layer radial label to the toro…
logan-nc Oct 30, 2026
72fab41
Equilibrium - REFACTOR - Run the magnetic-axis attempts through one l…
logan-nc Oct 30, 2026
c62678e
Tearing - MINOR - Drop the silent GGJ rotation fallback and consolida…
logan-nc Oct 30, 2026
e35920a
Equilibrium - BUGFIX! - ⚠️ Recover the magnetic axis when psi is not …
logan-nc Oct 30, 2026
4f33fcf
Tearing - BUGFIX - Doppler-shift each GGJ surface into its own E×B fr…
logan-nc Oct 30, 2026
cce6999
ForceFreeStates - BUGFIX! - Scan each toroidal-mode block of the kine…
logan-nc Oct 30, 2026
26bf3e4
ForceFreeStates/KineticForces - FEATURE! - Build the kinetic geometri…
logan-nc Oct 30, 2026
392169c
Regression - TEST - Track DIII-D-like n = 1, 2 kinetic stability with…
logan-nc Oct 30, 2026
e25d6b8
Merge develop into feature/slayer-dcrit-chi
d-burg Oct 30, 2026
9aa4d43
Merge remote-tracking branch 'origin/develop' into refactor/rzphi-geo…
logan-nc Oct 30, 2026
c5a6a9c
Equilibrium - REFACTOR - Route every rzphi |∇ψ| through one metric fo…
logan-nc Oct 30, 2026
c05b2ba
Equilibrium - BUGFIX - Build the two-pass ψ grid from kinetic profile…
d-burg Oct 30, 2026
b6af97f
InnerLayer.SLAYER - TEST - Drop the chi_perp_Dc test cases the remain…
d-burg Oct 30, 2026
711a994
Repo - API! - Run every deck stage through the public API so main is…
matt-pharr Oct 30, 2026
726194c
Merge branch 'develop' into refactor/v2-consolidation
matt-pharr Oct 30, 2026
643a78d
Tearing - API! - Doppler-shift each GGJ layer into its surface's E×B …
matt-pharr Oct 30, 2026
b8f50de
ForceFreeStates - API! - Default MatchProblem's layer inputs from the…
matt-pharr Oct 30, 2026
b92ec6b
Repo - API! - Serialize a parsed deck back to the deck that states it…
matt-pharr Oct 30, 2026
08a6975
Equilibrium - REFACTOR - Derive every rzphi |∇ψ| from one shared metr…
matt-pharr Oct 30, 2026
d5b0ef1
Repo - API! - Record each result's inputs as deck sections when it is…
matt-pharr Oct 30, 2026
4b08faf
InnerLayer - MINOR - Name exactly the missing layer inputs when there…
matt-pharr Oct 30, 2026
cd5bcd3
Merge branch 'develop' into feature/kinetic-multi-n
jhalpern30 Oct 30, 2026
2caf1d0
Merge branch 'develop' into bugfix/two-pass-grid-without-omega-e
jhalpern30 Oct 30, 2026
464f530
ForceFreeStates - API! - Evaluate the kinetic matrices once with kine…
matt-pharr Oct 30, 2026
fc9d9bb
Equilibrium - BUGFIX - Stop NTV runs up front on profiles without ome…
d-burg Oct 30, 2026
7245236
ForceFreeStates/KineticForces - FEATURE! - Support multi-n kinetic st…
matt-pharr Oct 30, 2026
6c42f03
InnerLayer - API! - Pass every inner-layer model the growth rate s = …
matt-pharr Oct 30, 2026
728a7e7
InnerLayer.SLAYER - FEATURE! - Optional chi_perp_Dc sets the critical…
matt-pharr Oct 30, 2026
faf9d48
Merge develop into refactor/v2-consolidation (#600, #615)
matt-pharr Oct 30, 2026
9a7f35c
Merge develop into refactor/v2-consolidation
matt-pharr Oct 30, 2026
36adc5b
PerturbedEquilibrium - API! - Leave unreconstructed Response fields o…
matt-pharr Oct 30, 2026
62540fe
Tearing - BUGFIX - Stop the false chi_e fallback warning under chi_pe…
d-burg Oct 30, 2026
b63a649
ForceFreeStates - API! - Delete dead singular-surface helpers, never-…
matt-pharr Oct 30, 2026
fbf66a5
Tearing - DOCS - Rewrite the chi_perp_Dc motivation as a modeling choice
d-burg Oct 30, 2026
d9a119e
Tearing - DOCS - State that the electron chi_perp in the critical Δ i…
d-burg Oct 30, 2026
0223e90
Tearing - DOCS - Name the electron reading in the chi_perp_Dc motivation
d-burg Oct 30, 2026
8e13504
Repo - REFACTOR - Remove duplicated kernels left after the consolidation
matt-pharr Oct 30, 2026
54c2bbb
Repo - MINOR - Delete never-read struct fields left after the consoli…
matt-pharr Oct 30, 2026
dd1409f
Repo - TEST - Build test and benchmark setups through the solve front…
matt-pharr Oct 30, 2026
ddf311c
InnerLayer - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
df40617
GPEC - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
e9d0f1a
Equilibrium - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
19b3e7d
ErrorFields - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
ae61308
ForceFreeStates - DOCS - Trim docstrings and comments to what a calle…
matt-pharr Oct 30, 2026
925827f
InnerLayer - DOCS - Trim docstrings and comments to what a caller nee…
matt-pharr Oct 30, 2026
a43f312
KineticForces - DOCS - Trim docstrings and comments to what a caller …
matt-pharr Oct 30, 2026
e08f63d
LocalStability - DOCS - Trim docstrings and comments to what a caller…
matt-pharr Oct 30, 2026
e0bf59e
PerturbedEquilibrium - DOCS - Trim docstrings and comments to what a …
matt-pharr Oct 30, 2026
30ddaf6
Tearing - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
7288096
Utilities - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
6bef536
Vacuum - DOCS - Trim docstrings and comments to what a caller needs
matt-pharr Oct 30, 2026
9a22183
DOCS - Update RMPField reference and add FixedKineticMatrices to auto…
matt-pharr Oct 30, 2026
ec07adb
Docs - DOCS - Require deck and API parity for every capability, with …
matt-pharr Oct 30, 2026
9ecffad
Repo - BUGFIX! - Fix oversights the V review sweep found in the deck …
matt-pharr Oct 30, 2026
69325f4
Docs - DOCS - Correct the docs and comments the V review sweep found …
matt-pharr Oct 30, 2026
b521d76
Test - TEST - Cover the deck checks, Z_eff closure and stage runtimes…
matt-pharr Oct 30, 2026
089291d
Merge branch 'develop' into test/enable-formatter-ci-gate
matt-pharr Oct 31, 2026
8dda8ca
Test - TEST - Check deck kinetic-source errors at parse time and fold…
logan-nc Oct 31, 2026
abc12d8
Repo - API! - Address the review: parse-time deck checks, one layer m…
matt-pharr Oct 31, 2026
0499114
PerturbedEquilibrium - BUGFIX! - Reject a perturbed equilibrium solve…
matt-pharr Oct 30, 2026
972653c
Examples - TEST - Move the perturbed equilibrium decks onto a no-wall…
d-burg Oct 31, 2026
e375075
Test - TEST - Run the perturbed equilibrium tests on the no-wall TJ f…
d-burg Oct 31, 2026
5f7d413
Merge remote-tracking branch 'origin/develop' into bugfix/two-pass-gr…
d-burg Oct 31, 2026
f388c79
Regression - TEST - Point the harness cases at decks that run
d-burg Nov 1, 2026
486ac80
Regression - TEST - Point the GGJ tearing case at gpec.h5, since its …
matt-pharr Nov 1, 2026
e51f4b0
Repo - API! - Consolidate the v2 deck sections, driver and HDF5 write…
matt-pharr Nov 1, 2026
e1954db
KineticForces - BUGFIX! - Hold the precession integrand from itself p…
logan-nc Nov 1, 2026
d455676
KineticForces - BUGFIX - Stop on a non-finite ψ torque instead of ret…
logan-nc Nov 1, 2026
f00d20f
KineticForces - API! - Remove the placeholder RLAR and CLAR torque me…
logan-nc Nov 1, 2026
4f2ad22
Equilibrium - API! - Reject a negative newq0 and drop the q0 sign flip
logan-nc Nov 1, 2026
e812b0e
Equilibrium - BUGFIX! - Floor kinetic temperatures and the Coulomb lo…
logan-nc Nov 1, 2026
0c03818
Equilibrium - BUGFIX! - Resample tabulated kinetic profiles with mono…
logan-nc Nov 1, 2026
93255e1
ForceFreeStates - BUGFIX! - Force the reduction at kinetic singular c…
logan-nc Nov 1, 2026
b899351
ForceFreeStates - TEST - Check that a singular call right after a red…
logan-nc Nov 1, 2026
4be6417
ForceFreeStates - BUGFIX - Stop with a clear error when no rational s…
logan-nc Nov 1, 2026
345f682
Merge branch 'develop' into bugfix/pe-reject-wall
logan-nc Nov 1, 2026
31ec80b
Test - TEST - Check that a perturbed equilibrium with a wall stops at…
logan-nc Nov 1, 2026
4bba6e7
Merge develop into bugfix/two-pass-grid-without-omega-e, porting the …
logan-nc Nov 1, 2026
25380a8
PerturbedEquilibrium - BUGFIX! - Reject a perturbed equilibrium solve…
logan-nc Nov 1, 2026
6c0a31a
Merge develop into bugfix/chi-perp-dc-followups, porting the chi_perp…
logan-nc Nov 1, 2026
e184c75
Docs - DOCS - Point the bounce and precession frequency convention at…
logan-nc Nov 1, 2026
be37092
Tearing - BUGFIX - Skip the file's chi_e in the SLAYER view when chi_…
logan-nc Nov 1, 2026
fb93b15
Equilibrium - BUGFIX - Build the two-pass ψ grid from kinetic profile…
logan-nc Nov 1, 2026
961484b
Tearing - BUGFIX - Stop the false chi_e fallback warning under chi_pe…
logan-nc Nov 2, 2026
5abf20f
Equilibrium - BUGFIX - Check kinetic densities and temperatures after…
logan-nc Nov 2, 2026
29bdbaa
ForceFreeStates - BUGFIX - Check qlim against q_min on every truncati…
logan-nc Nov 2, 2026
a12d936
Equilibrium - FEATURE - Accept supplied Coulomb logarithm and collisi…
logan-nc Nov 1, 2026
3883dba
Docs - DOCS - State the laboratory direction of positive omega_E from…
logan-nc Nov 1, 2026
a84e973
Equilibrium - BUGFIX - Reject a ragged kinetic table and document how…
logan-nc Nov 2, 2026
c03c61f
Merge develop into bugfix/fortran-parity-ffs
logan-nc Nov 2, 2026
681cf64
Merge develop into bugfix/fortran-parity-kin
logan-nc Nov 2, 2026
17f4e0f
Merge branch 'bugfix/fortran-parity-kin' into feature/kinetic-supplie…
logan-nc Nov 2, 2026
6cca8d7
Merge develop into test/enable-formatter-ci-gate
logan-nc Nov 2, 2026
9e57323
Repo - MINOR - Format the repository with the pinned pre-commit hooks
logan-nc Nov 2, 2026
1883bee
Repo - MINOR - Skip the formatting sweep in git blame
logan-nc Nov 2, 2026
09e2564
Repo - MINOR - Format the branch with the pinned pre-commit hooks
logan-nc Nov 2, 2026
57f0d1c
Merge commit '1883beeb0' into bugfix/fortran-parity-kin
logan-nc Nov 2, 2026
b181766
Repo - MINOR - Format the branch with the pinned pre-commit hooks
logan-nc Nov 2, 2026
618e48d
Merge commit '1883beeb0' into bugfix/fortran-parity-ffs
logan-nc Nov 2, 2026
a16b428
Repo - MINOR - Format the branch with the pinned pre-commit hooks
logan-nc Nov 2, 2026
c9d5c62
Merge branch 'bugfix/fortran-parity-kin' into feature/kinetic-supplie…
logan-nc Nov 2, 2026
fce38ab
Test - TEST - Write the supplied-lnLambda resistivity check as one he…
logan-nc Nov 2, 2026
ee76864
CI - MINOR - Describe the check as enabled with the sweep and also ru…
logan-nc Nov 2, 2026
f7fe63c
Docs - DOCS - Pin JuliaFormatter 1.0.62 in the setup guide and descri…
logan-nc Nov 2, 2026
25033d4
KineticForces - BUGFIX - Warn when a pitch or energy integral stops s…
logan-nc Nov 2, 2026
d42c17b
ErrorFields - BUGFIX - Keep one quiet logger for the NTV rotation sca…
logan-nc Nov 2, 2026
0787c5e
Docs - DOCS - Show how to decompose any of the five coupling matrices…
logan-nc Nov 2, 2026
da92912
Docs - DOCS - Note how the coupling SVD ranks modes in a multi-n run …
logan-nc Nov 2, 2026
5503af4
Repo - MINOR - Format the repository and run the pre-commit check on …
logan-nc Nov 2, 2026
b783770
Merge develop into bugfix/fortran-parity-kin
logan-nc Nov 2, 2026
2515fca
Merge develop into bugfix/fortran-parity-ffs
logan-nc Nov 2, 2026
27502e4
Merge branch 'bugfix/fortran-parity-kin' into feature/kinetic-supplie…
logan-nc Nov 2, 2026
e33bdde
Docs - DOCS - Rebuild the workflow map, condense setup and order the …
logan-nc Nov 2, 2026
c392324
Docs - DOCS - Rewrite the stability, local stability, Galerkin and pe…
logan-nc Nov 2, 2026
c04fd25
Docs - DOCS - Rewrite the remaining module pages around their physics…
logan-nc Nov 2, 2026
257d2c6
Docs - DOCS - Condense the reference pages, align the citation anchor…
logan-nc Nov 2, 2026
56ccd4b
Docs - DOCS - Repair the perturbed equilibrium equations, state the r…
logan-nc Nov 2, 2026
ba02e12
Docs - DOCS - Drop the paraphrased titles from two error-field citations
logan-nc Nov 2, 2026
0404a90
Test - TEST - Give the hand-built SLAYER profile view the lnLambda fi…
logan-nc Nov 2, 2026
ff52c48
ForceFreeStates - BUGFIX! - Force the reduction at kinetic singular c…
matt-pharr Nov 2, 2026
9a25490
FFS - PERF - Fix oversubscription of threads by way of multithreaded …
matt-pharr Nov 2, 2026
83396e0
KineticForces - DOCS - Note that supplied collision rates bypass the …
matt-pharr Nov 2, 2026
131c83d
Repo - BUGFIX! - Fix numerical edge cases in q extrema, rational surf…
matt-pharr Nov 2, 2026
2d12b79
REPO - MINOR - Bump version to 2.0.0
matt-pharr Nov 2, 2026
f5b64a9
InnerLayer - BUGFIX - Keep the resistivity closure's own Coulomb loga…
matt-pharr Nov 2, 2026
3ede869
Equilibrium - FEATURE - Select the ASCII kinetic layout with kinetic_…
matt-pharr Nov 2, 2026
0ed3506
Regression - TEST - Track the NTV torque with supplied collision rates
matt-pharr Nov 2, 2026
6e27967
Merge develop into bugfix/fortran-parity-kin
matt-pharr Nov 2, 2026
000a62f
Merge branch 'bugfix/fortran-parity-kin' into feature/kinetic-supplie…
matt-pharr Nov 2, 2026
3ac5be2
Repo - BUGFIX! - Make reruns self-contained, flag vanished harness ou…
matt-pharr Nov 2, 2026
675ea6f
Equilibrium - BUGFIX! - Rescale F from its axis value under newq0 on …
matt-pharr Nov 2, 2026
e38b2c9
KineticForces - BUGFIX! - Sort bounce points ascending so the deepest…
matt-pharr Nov 2, 2026
50a7c8e
Equilibrium - BUGFIX - Reject non-positive kinetic scaling factors an…
matt-pharr Nov 2, 2026
e0bb4f7
Deck - TEST - Check that the removed torque-method keys stop the parse
matt-pharr Nov 2, 2026
2667d12
Merge branch 'bugfix/fortran-parity-kin' into feature/kinetic-supplie…
matt-pharr Nov 2, 2026
2e54c1e
Equilibrium/KineticForces - BUGFIX! - Port the Fortran 1.6.0 kinetic …
matt-pharr Nov 2, 2026
329ee59
Equilibrium - FEATURE - Accept supplied Coulomb logarithm and collisi…
matt-pharr Nov 2, 2026
8dcd34f
Merge develop into bugfix/review-robustness
logan-nc Nov 2, 2026
5176131
ErrorFields - TEST - Pin the scale-0 tolerance interpolation and docu…
logan-nc Nov 2, 2026
5742e1a
Repo - BUGFIX! - Fix numerical edge cases in q extrema, rational surf…
matt-pharr Nov 2, 2026
4a5edc0
Merge branch 'develop' into bugfix/review-robustness
matt-pharr Nov 2, 2026
917aa40
Repo - BUGFIX! - Make reruns self-contained and flag vanished harness…
matt-pharr Nov 2, 2026
c2403fc
Merge branch 'main' into develop
matt-pharr Nov 2, 2026
f0756eb
Repo - BUGFIX - Name the GPEC version that wrote a gpec.h5 and the wa…
logan-nc Nov 2, 2026
bb14d21
Docs - DOCS - Fix factual inconsistencies remaining in docs, remove i…
matt-pharr Nov 2, 2026
e02fbe4
Repo - BUGFIX - Name the GPEC version that wrote a gpec.h5 and the wa…
matt-pharr Nov 2, 2026
c5e1287
Merge develop into docs/v2-docs-pass
matt-pharr Nov 2, 2026
332d400
Docs - DOCS - Fix the Linux launcher, the matched-response claims and…
logan-nc Nov 2, 2026
9238b86
REPO - test - make the pr conventions test ignore PRs into main
matt-pharr Nov 2, 2026
31d63eb
Repo - MINOR - Remove the Galerkin perturbed-equilibrium example unti…
logan-nc Nov 2, 2026
a4ab73b
Docs - DOCS - Drop the not-yet-supported notes about driving a respon…
logan-nc Nov 2, 2026
d1259bd
Docs - DOCS - Rewrite the user documentation around the pipeline, its…
matt-pharr Nov 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ always_for_in = true
for_in_replacement = "in"
annotate_untyped_fields_with_any = false
whitespace_in_kwargs = false
always_use_return = true
always_use_return = false
format_docstrings = true
remove_extra_newlines = false
trailing_comma = false
join_lines_based_on_source = true
separate_kwargs_with_semicolon = true
whitespace_ops_in_indices = false
whitespace_ops_in_indices = false
8 changes: 8 additions & 0 deletions .claude/agent-memory/fortran-physics-reviewer/MEMORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Agent Memory Index

- [Fortran-Julia Correspondence Map](fortran_correspondence_map.md) — Maps Fortran GPEC source files to Julia JPEC modules
- [Known Physics Issues in PerturbedEquilibrium](known_issues_perteq.md) — xi_modes placeholders, the xi_n Jacobian shortcut
- [KineticForces (NTV) Audit Checklist](kinetic_ntv_map.md) — pentrc->KineticForces map, Logan 2015 matrices, what to verify
- [InnerLayer (Resistive) Audit Checklist](resistive_layer_map.md) — rmatch->InnerLayer map, GGJ Wasow basis / Δ′, what to verify
- [Galerkin Δ′ Assembly Map](galerkin_assembly_map.md) — gal.f<->GalerkinAssembly.jl; resonant sign chain verified; PASS
- [reg_spot vs singfac_min audit](reg_spot_regularization.md) — reg_spot field-recon smoothing CORRECT; distinct from singfac_min ODE gate
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: annotation_style
description: How to cite Fortran code in annotations — use papers and submodule names, not line numbers
type: feedback
---

Do NOT cite Fortran source line numbers in code annotations (e.g., "gpeq.f:100"). The Fortran codebase is actively developed and line numbers change. Instead, cite:
- Paper equations (e.g., "Park et al. 2007, Eq. 8")
- Fortran subroutine/function names (e.g., "matches Fortran `gpeq_contra`")

**Why:** Fortran GPEC is still under active development; line-number references rot quickly.

**How to apply:** When the fortran-physics-reviewer suggests line-number annotations, convert them to subroutine-name or paper-equation references before writing to code.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Fortran-Julia File Correspondence Map
description: Mapping between Fortran GPEC source files and Julia JPEC modules for physics review
type: reference
---

Fortran paths are relative to the root of the Fortran GPEC clone; Julia paths are
relative to this repository.

## Coil/ForcingTerms
- `coil/coil.F` (coil_read) -> `src/ForcingTerms/CoilGeometry.jl` (apply_transforms)
- `coil/field.F` (field_bs_psi) -> `src/ForcingTerms/BiotSavart.jl` + `src/ForcingTerms/CoilFourier.jl`

## PerturbedEquilibrium
- `gpec/gpeq.f` (gpeq_sol, gpeq_contra, gpeq_surface, gpeq_normal) -> `src/PerturbedEquilibrium/FieldReconstruction.jl` + `src/PerturbedEquilibrium/ResponseMatrices.jl`
- `gpec/gpresp.f` (gpresp_pinduct, gpresp_sinduct, gpresp_permeab) -> `src/PerturbedEquilibrium/ResponseMatrices.jl`
- `gpec/gpout.f` (gpout_singcoup, gpout_xbnormal) -> `src/PerturbedEquilibrium/SingularCoupling.jl` + `src/PerturbedEquilibrium/FieldReconstruction.jl`
- `gpec/gpvacuum.f` (gpvacuum_flxsurf) -> `src/Vacuum/Vacuum.jl` (compute_Iv branch of _compute_vacuum_response_2d!) + `src/PerturbedEquilibrium/ResponseMatrices.jl` (calc_surface_inductance)

## KineticForces (NTV, Fortran `pentrc/`) — see kinetic_ntv_map.md for the audit checklist
- `pentrc/torque.F90` -> `src/KineticForces/Torque.jl` (tpsi! single-surface torque)
- `pentrc/pitch.f90` -> `src/KineticForces/PitchIntegration.jl` (pitch-angle lambda integration, bounce-averaged operator assembly)
- `pentrc/energy.f90` -> `src/KineticForces/EnergyIntegration.jl` (energy-space quadrature integrand)
- `pentrc/pentrc.F90` (orchestration) -> `src/KineticForces/{KineticForces.jl,Compute.jl}`
- `pentrc/inputs.f90` + `params.f90` -> `src/KineticForces/KineticForcesStructs.jl`
- `pentrc/dcon_interface.f` -> `src/KineticForces/CalculatedKineticMatrices.jl` (bridge to ForceFreeStates kinetic stability) + `src/ForceFreeStates/{Kinetic.jl,FixedKineticMatrices.jl}`
- bounce averaging of the 6 perturbed-action matrices -> `src/KineticForces/BounceAveraging.jl`

## InnerLayer (resistive matched-asymptotics, Fortran `rmatch/`) — see resistive_layer_map.md for the audit checklist
- `rmatch/deltac.f` (Galerkin solver) -> `src/InnerLayer/GGJ/Galerkin.jl`
- `rmatch/deltar.f` (shooting solver) -> `src/InnerLayer/GGJ/Shooting.jl`
- `rmatch/inps.f` + `inpso.f` (Wasow asymptotic basis: T,J,P,B,Q,C,D,Y,Z,U matrices) -> `src/InnerLayer/GGJ/InnerAsymptotics.jl`
- `rmatch/{inner.f,match.f,msing.f,gamma.f}` -> `src/InnerLayer/GGJ/` (parameters, matching data, special functions)
- SLAYER drift-MHD two-fluid solver: `src/InnerLayer/SLAYER/` is a placeholder pending implementation

## Key Fortran Conventions
- `sq%f(1)` = F (toroidal field function = R*B_tor), `sq%f(4)` = q (safety factor)
- `sq%f1(4)` = dq/dpsi
- `chi1 = twopi*psio` (poloidal flux normalization)
- `singfac = mfac - nn*q` (resonance factor)
- `ifac = (0,1)` (imaginary unit)
- `wegt=0`: no weighting; `wegt=1`: J*|grad psi| weighting (default for bmn)
- Vacuum Green's functions use reversed theta in Fortran (rtheta = mthsurf - itheta)
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: galerkin-assembly-map
description: RDCON singular Galerkin Δ′ solver — gal.f ↔ GalerkinAssembly.jl element-level weak-form correspondence and audit notes
metadata:
type: project
---

# RDCON Galerkin Δ′ assembly: gal.f ↔ GalerkinAssembly.jl

File: `src/ForceFreeStates/Galerkin/GalerkinAssembly.jl` ↔ `GPEC_fortran/rdcon/gal.f`.
On branch `feature/rdcon-galerkin`. Reviewed 2026-06-16.

## Correspondence (verified, not just docstring-trusted)
- gal_hermite (222-262) ↔ gal_hermite: pb/qb EXACT.
- gal_get_fkg (1013-1071) ↔ gal_get_fkg: F=Fbar·sf[i]·sf[j], K=K·sf[i], G=G. singfac=mlow-nn*q+(0..mpert-1) = DIRECT (m-nq), not reciprocal. Correct.
- gal_gauss_quad (1079-1138) ↔ gal_gauss_quad!: F·qq + K·qp + conj(K[jpert,ipert])·pq + G·pp. swap pb(2)/pb(3) (0-based) = Julia pb[3]/pb[4]. Correct.
- gal_extension (1146-1322) ↔ gal_extension!: emat/ediag/rhs/erhs all match incl surface terms 1277-1300 and w1/w2.
- gal_resonant! ↔ gal_lsode_int(780-900)+gal_lsode_der(908-954)+gal_make_arrays signs(1366-1369). QuadGK replaces LSODE.
- gal_assemble_mat (694-772) ↔ gal_assemble_mat!: LU offset=kl+ku+1, chol offset=1, conj(e) Hermitian placement. Correct.
- gal_assemble_rhs (642-686) ↔ gal_assemble_rhs!: isol++ at ext2-left / res-right. Correct.
- gal_set_boundary (1554-1620) ↔ gal_set_boundary!: axis idx, edge 3-way (rpec/vac/fixed). DOF index 3(0-based)=Julia 4.

## Resonant sign chain (the trap — verified correct)
Fortran: LSODE integrates x0→x_lsode giving raw u; then line 882 `IF right: u=-u`; then make_arrays:
erhs=-u_res(1), ediag=+u_res(2), rhs=-u_hermite1, emat=+u_hermite2.
Net with s=+1(left)/-1(right): erhs=-s·res1, ediag=s·res2, rhs=-s·hbig, emat=s·hsmall.
Julia sgn_u = s (=-1 right/+1 left): erhs=-sgn_u·raw1, ediag=sgn_u·raw2, rhs=-sgn_u·hbig, emat=sgn_u·hsmall. MATCHES.
QuadGK limits x0→x_lsode preserve LSODE orientation so raw == pre-negation u. Correct.
du_res conj-weight uses the SMALL solution (isol(2)) in both. Correct.

## Only open item (MINOR, out-of-file)
sing_get_ua_gal/dua_gal two-sided z<0 → sig=-1 series at -z with derivative ×(-1) is a REIMPLEMENTATION
of sing.f's internal singular-surface handling, not a line port. The ×(-1) chain is internally consistent
but worth a dedicated check against sing.f sing_get_ua/dua if Δ′ ever disagrees with Fortran. Lives outside
GalerkinAssembly.jl.

## RPEC matching (GalerkinMatch.jl <-> rmatch/match.f match_rpec) — reviewed 2026-06-20
- match block (mat idx1..idx4, -delta1/delta2 signs) + rmat=-TRANSPOSE(delta coil block) + cout/cin split: EXACT port. PASS.
- matched outer soln Σcout(isol)·sols + sols(:,:,csol): EXACT (match_output_solution L32-41).
- resist.f E/F/H/M/G/K/taua/taur/v1: EXACT (Resist.jl). eta/rho caller-supplied = deliberate documented deviation.
- gal quadrature: jacobi_alloc "gll" = Gauss-Lobatto = Julia gausslobatto. nq1 lower=|nn·q1|, upper=|q1|: match.

## SUSPECT (should-fix) — RPEC forced eigenvalue γ
GalerkinMatch.jl:66 uses γ = 2π·im·n·gal_rotation. Fortran match_rpec passes `initguess` (namelist,
default 0.0) DIRECTLY to deltac_run — NOT i·n·rotation. The `guess+ifac*ntor*rotation` Doppler form
lives only in match_delta (Newton eigenvalue search), NOT the RPEC path. Two issues:
(1) extra 2π: Fortran eig=ifac*ntor*rotation has NO 2π (rotation is ω[rad/s], eig is 1/time, q0=x0/taua).
(2) RPEC path in Fortran uses initguess (the user forced eigenvalue), not a per-surface i·n·rotation shift.
Confirm intended convention vs Fortran before trusting resistive Δ(Q); ideal_flag path (γ unused) is unaffected.
RESOLUTION 2026-06-20: author confirms the Hz convention is DELIBERATE (gal_rotation is f[Hz], so γ=2πi·n·f);
the overstated comments were corrected. Δ(Q) now guarded by test/runtests_innerlayer.jl (Julia self-pin on
glasser_wang_2020_eq55). Remaining follow-up: upgrade that guard to a Fortran deltac_run / paper
cross-check to fully close the convention question.

## Verdict: PASS WITH REQUIRED ANNOTATIONS for outer solve; RPEC γ convention is SHOULD-FIX (verify vs match.f).


# Second pass


## PR #266 "Galerkin Integrator" full review (2026-06-25) — PASS
Exhaustive line-by-line vs gal.f / match.f / deltac.f / resist.f / sing.f. All physics-bearing code faithful.
- RESOLVED (was SUSPECT): forced eig γ=2πi·n·rotation IS correct. match.f match_rpec line:
`rpec_eigenvalues(ising)=2*pi*rotation(ising)*REAL(ntor,r8)*ifac` — the 2π IS in Fortran. Julia matches exactly.
My earlier "no 2π in Fortran" note was wrong (confused match_delta Newton path with match_rpec). Closed.
- Verified EXACT: gal_get_fkg (F=QF̄Q,K=QK̄,G=Ḡ,singfac=m-nq), gauss_quad weak form (F qq+K qp+K† pq+G pp),
gal_extension, gal_resonant (mpert-fastest hermite layout; Fortran's apparent (0:np,mpert,2) reshape is a
no-op relabel — der writes mpert-fastest, caller reads mpert-fastest), assemble_mat/rhs, set_boundary,
gal_get_solution (restore_uh/us/ul), PEST-3 A/B/Γ/Δ ± combos, Δ′ extraction, match_rpec matrix signs,
resist_eval E/F/G/H/K/M/taua/taur, mercier_di=E+F+H-1/4, rescale=sfac^(2p1/3)·v1^(2p1) + delta(1)↔(2) swap
(swap applied in BOTH solve_inner and solve_inner_profile), sing_matvec, sing_get_dua, ξ_s=-A⁻¹(Bξ'+Cξ).
- Documented deviations (all fine): η/ρ caller-supplied (no Spitzer); gal_gamma default 5/3 = resist.f;
QuadGK replaces LSODE; sing_get_dua omits Fortran `sig` (moved to sing_get_dua_gal left-side ×(-1)).
- InnerAsymptotics.jl + Shooting.jl diffs = PURE JuliaFormatter whitespace, zero numeric change.
- Reference.jl G=8.950e1,H=1.292e-2,K=2.332e2 = corrected GW2020 Eq.55 (prior transcription bug fixed).

## OPEN ITEM (latent, n≥2 only): gal_make_grid resonant-cell width asymmetry
gal.f gal_make_grid genuinely uses nq1=ABS(nn*sing(ising)%q1) on the LOWER bound but nq1=ABS(sing(ising+1)%q1)
(NO nn) on the UPPER bound. Julia GalerkinGrid.jl faithfully reproduces. Natural layer scale is 1/(n q1) on BOTH
sides (singfac'≈-n q1), so the upper/left side of each interior surface gets cells ~n× too wide for n≥2.
No effect at n=1 (RDCON resistive target). galerkin_solve allows single n≥2 (blocks only multi-n npert>1), so it
IS reachable. Recommend: keep faithful but warn, or fix both sides to nn*q1 (deviation, more correct) gated by
validation. Suspected upstream Fortran oversight, not a Julia port error.
90 changes: 90 additions & 0 deletions .claude/agent-memory/fortran-physics-reviewer/kinetic_ntv_map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
name: KineticForces (NTV) Audit Checklist
description: Curated map and physics-audit checklist for the KineticForces module (NTV, formerly PENTRC); what to read and what to verify
type: reference
---

The KineticForces module computes neoclassical toroidal viscosity (NTV) torque and the
kinetic energy/matrices from trapped-particle nonambipolar transport. Fortran counterpart is
the Fortran `pentrc/` sources (file mapping in fortran_correspondence_map.md).

## Governing theory
- Logan & Park (2013) PoP 20, 122507: diamagnetic frequency (Eq. 7), energy integrand (Eq. 8), torque normalization Im(T) = 2n·δW_k (Eq. 19).
- Logan (2015) PhD Thesis, Ch. 7: the six kinetic matrices A_k, B_k, C_k, D_k, E_k, H_k (Eqs 7.30–7.35) as energy-space integrals of perturbed action operators W_X, W_Y, W_Z; resonance splitting/suppression F_h = (Q−P†)F̄(Q−P)+… (Eq. 7.46). App. C: DCON matrix form of the perturbed action. App. D: numerical treatment of integrable singularities in bounce averages.
- Park et al. (2009) PRL 102, 065002: trapped-particle nonambipolar transport foundation.

## Key Julia files and roles
- `Torque.jl` — `tpsi!()`: single-surface torque; poloidal grid sampling; diamagnetic frequencies (Eq. 7).
- `EnergyIntegration.jl` — energy-space quadrature integrand (Eq. 8); Maxwellian vs JKP distribution options.
- `PitchIntegration.jl` — pitch-angle (λ) integration; bounce-averaged operator assembly.
- `BounceAveraging.jl` — bounce-averaging of the perturbed-action matrices (Eqs 7.30–7.35); packs 3 Hermitian + 3 full blocks.
- `Compute.jl` — `compute_torque_all_methods!()` orchestration over all ψ surfaces.
- `CalculatedKineticMatrices.jl` — bridge to ForceFreeStates kinetic stability (`Kinetic.jl`, `FixedKineticMatrices.jl`).
- `KineticForcesStructs.jl` — `KineticForcesControl` (TOML params) and `KineticForcesInternal` (state, hints, mode indexing).
- `Output.jl` — HDF5 writer.

## What to verify in a review
- **Matrix structure**: A symmetric; the Hermitian blocks actually Hermitian; the 3-Hermitian + 3-full packing in BounceAveraging matches Logan 2015 Eqs 7.30–7.35.
- **Resonance handling**: Sokhotski–Plemelj pole shift / singular-denominator gating near rational surfaces (App. D). Check the singular-eps threshold is applied where the denominator vanishes, not globally.
- **Quadrature tolerances**: outer ψ (atol_psi/rtol_psi) and inner pitch/energy (atol_xlmda/rtol_xlmda) are passed through, not hard-coded to lazy defaults.
- **Distribution/collision options**: energy integrand (Eq. 8) honors the configured collision operator (harmonic/Krook/zero) and distribution (Maxwellian/JKP/CGL) — not silently fixed to one.
- **Normalization**: torque Im(T)=2n·δW_k (Eq. 19) and diamagnetic-frequency sign/factor conventions match Fortran `torque.F90`.
- **Mode indexing**: m, n ranges and block packing over n stay consistent with ForceFreeStates.
- **Method variants**: FGAR/TGAR/PGAR/RLAR/CLAR/FCGL/TMM/WMM each present, not stubbed to a single fallback.

## Multi-ion (D-T) NTV — composition/collisionality (2026-07)
Both Fortran PENTRC (`inputs.f90:236-243`, `read_kin`) and Julia (`KineticProfiles.jl:261-278`)
support ONE main ion (zi,mi) + ONE impurity (zimp,mimp) per run. Correct multi-main-ion NTV is
an EXTENSION beyond Fortran, but consistent with Logan-Park 2013's pitch-angle (Lorentz) model.
- Zeff = Σ_s Z_s² n_s / n_e; quasineutrality n_e = Σ_s Z_s n_s (all ions incl. impurity).
- Bug in current D-T split (run D, then T, each with ni=Ni/2): the `ni` column sets BOTH species
density AND Zeff via z = zimp-(n_i/n_e)zi(zimp-zi). With ni=Ni/2 it treats the missing half as
high-Z impurity → Zeff≈3.7 instead of true ≈1–1.4. Corrupts zpitch → nue,nui.
- Correct collisionality: ν_a ∝ Z_a² lnΛ · Σ_b n_b Z_b² /(√m_a T_a^{3/2}) = ∝ Z_a² lnΛ·(n_e·Zeff_true).
The zpitch(Zeff) polynomial is a main-ion+impurity closure (momentum-restoring correction); the
MINIMAL fix is to feed the TRUE (full-composition) Zeff into the existing zpitch/ν formulas.
- Additivity: τ = Σ_s τ_s. Lorentz operator is additive over field species; species couple only
through shared δB, shared ω_E, shared Zeff/ν. Additive at this theory's order.
- What changes single→multi: Zeff, zpitch, nue, nui (→nueff). UNCHANGED for equal-shape D-T:
wdian/wdiat (log-derivative, density factor cancels), wtran/wbhat/wdhat/wgyro (already per-species),
and the resonant-density prefactor (Ni/2 per species is correct).
- ASIDE (separate fidelity bug, same code block): Fortran `inputs.f90:238` uses natural log for lnΛ;
Julia `KineticProfiles.jl:270` uses log10 — diverges away from the n=1e20,T=1keV reference point.

## Multi-ion NTV — full-composition species set (2026-07 audit, PASS-with-caveats)
Reviewed `resolve_ntv_species` (KineticProfiles.jl ~214-266) + `compute_calculated_kinetic_matrices`
(CalculatedKineticMatrices.jl ~96-151). Verdict: physics is sound.
- ν_s field-density RECONCILIATION (supersedes the earlier "should be n_e·Zeff" note above):
code uses `ν_s = (zpitch/3.5e17)·z_s²·n_main·lnΛ/(√m_s·T_i^1.5)`, i.e. field density = zpitch·n_main
(n_main = Σ MAIN-ion densities, no impurity, unweighted). This is CORRECT and MORE faithful to
single-ion PENTRC than n_e·Zeff: PENTRC's design is zpitch·n_i, NOT Σ_b n_b Z_b². The two are NOT
numerically equal (Zeff=1.5, C6, n_i/n_e=0.9 → zpitch·n_i = 1.225·n_e vs n_e·Zeff = 1.5·n_e, ~18%
apart); that gap IS the intended momentum-restoring design difference that zpitch(Zeff) carries.
n_main vs n_e·Zeff is a deliberate PENTRC-fidelity choice, exact in the z=1 main-ion domain.
- z_s² test-particle factor: CORRECT and correctly placed (deflection freq ∝ test charge²). Single-ion
had no z² only because zi=1. Reduces EXACTLY to single-ion nui for one z=1,fraction=1 ion (verified).
- Impurity as its own test species: field density zpitch·n_main is NOT undercounting — the impurity's
z_imp² contribution is already folded into Zeff inside zpitch. CAVEAT: zpitch is strictly a main-ion
momentum-restoring closure; reusing it for the impurity/electron ν is an approximation beyond the
single-ion theory. Acceptable (impurity δW ∝ n_imp is small); worth a one-line annotation.
- Electron descriptor passes `ns[1]` (first ion's density) as its `ni_spline` — HARMLESS: the kernel
`_setup_surface_state` (Torque.jl:659-664) reads `ne_spline` (full shared n_e) when electron=true,
never ni_spline. Electron n_s = full n_e (correct). Cosmetic smell only.
- Self-consistent δW summation (CalculatedKineticMatrices.jl:112-148): kw_flat/kt_flat are PURELY the
kinetic matrices (Logan 7.30-7.35), every term ∝ species phase-space density n_s·f0_s — NO species-
independent baseline. Fluid F,K,G added ONCE downstream in _compute_fkg_matrices!, outside the
species loop. So `+=` over species is clean additivity; NOTHING in kw is wrongly ×species-count.
→ TC-24 n=3 δW +0.066(D) → −0.10(D+T+C+e) sign flip is PLAUSIBLE physics near marginal stability,
NOT a double-count. Dominant driver: the newly-ON electron channel (full n_e, opposite precession).
DECISIVE cheap diagnostic to confirm: run D(½)+T(½) with electron=OFF, impurity absent — should
return ≈ +0.066 (single-ion D). If D+T alone ≈ +0.066, the whole shift is electron+impurity = physical.

## Single-ion nui vs multi-species z_s² (#339, 2026-07 decision)
Fortran PENTRC `inputs.f90:240-241` single-ion nui = (zpitch/3.5e17)·n_i·lnΛ/(√mi·T_i^1.5) has
NO explicit zi² (implicitly assumes zi=1, main ion hydrogenic). Julia `load_kinetic_profiles`
(~L416) is a faithful exact port. Multi-species `_nu` (~L253) adds explicit test-particle z_s²
(the physically correct pitch-angle/Lorentz form; zpitch is the field-side momentum-restoring
factor of Zeff, independent of test charge — no double count). RECOMMENDATION: option (a) ADD
zi² to single-ion nui. It is numerically identical for the default zi=1 (regression byte-identical),
makes single-ion the true 1-species special case of `_nu`, and only "deviates" from Fortran in the
exotic zi≠1 case where Fortran is physically wrong anyway. Annotate as a documented improvement.
Loading
Loading