Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
a7c3090
RERUN - NEW FEATURE - Make gpec.h5 a self-contained rerun snapshot (#…
logan-nc Apr 10, 2026
0b01abc
Modernizing
jmlmir369 Apr 29, 2026
6bd0fea
s-alpha diagram working
jmlmir369 Apr 30, 2026
777d6ba
aixs name fixed
jmlmir369 Apr 30, 2026
79366eb
full version(small solution, ca1)
jmlmir369 Apr 30, 2026
6d28892
erasing small solution logics
jmlmir369 Apr 30, 2026
ed047bc
Restore accidentally deleted example notebook
jmlmir369 Apr 30, 2026
7ceb6ea
ForceFreeStates - NEW - Implement galerkin solver
matt-pharr Jun 9, 2026
24eea1e
ForceFreeStates - NEW - Add galerkin benchmarks
matt-pharr Jun 9, 2026
fa0389b
ForceFreeStates - NEW - Add resistive inner-layer parameters and upda…
matt-pharr Jun 9, 2026
57a29f5
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into feat…
matt-pharr Jun 9, 2026
f6cdcad
DOCS - NEW FEATURE - Add sign conventions reference page (#265)
logan-nc Jun 10, 2026
24cb0bf
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into ball…
logan-nc Jun 10, 2026
7b4c08b
ForceFreeStates - CLEANUP - Remove stray .codex and Bal s-alpha notebook
logan-nc Jun 10, 2026
83a325b
ForceFreeStates - CONFIG - Unify local_stability_flag, revert psilow,…
logan-nc Jun 10, 2026
6a3b640
ForceFreeStates - BUG FIX - Restore resistive interchange D_R; disamb…
logan-nc Jun 10, 2026
b7a5f16
ForceFreeStates - IMPROVEMENT - Port s-alpha/Delta'/D_I plots into an…
logan-nc Jun 10, 2026
b619ea6
ForceFreeStates - DOCS - Add user-level local stability (Mercier/ball…
logan-nc Jun 10, 2026
65c4c96
DOCS - NEW FEATURE - Add field-amplitude and units conventions to the…
logan-nc Jun 11, 2026
55d64ac
DOCS - MINOR - Cleaned up units discussion
logan-nc Jun 11, 2026
39e7452
ForceFreeStates - BUGFIX - wire in gal_tol accidentally left hardcoded
matt-pharr Jun 11, 2026
ca7612e
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into feat…
logan-nc Jun 11, 2026
d66758b
ForcingTerms - NEW FEATURE - Add HDF5 + analytic coil interfaces (iss…
logan-nc Jun 11, 2026
0ba42d2
ForcingTerms - DOCS - Fix Documenter link pitfalls in coil HDF5 docs
logan-nc Jun 11, 2026
02b0f0b
PERTURBED EQUILIBRIUM - NEW FEATURE - Conform response & coupling mat…
logan-nc Jun 11, 2026
5ae65f9
RERUN - IMPROVEMENT - Unify input dispatch and address PR review
logan-nc Jun 11, 2026
b8e9502
Analysis - NEW FEATURE - 3D plasma-surface field viz for coils (plot_…
logan-nc Jun 11, 2026
b58e19c
FFS - WIP - Initial attempt to add BALOO style critical pressure plots
logan-nc Jun 11, 2026
cfb7bbf
Update to BALOO Stability Plotting
nelsonand Jun 11, 2026
c656d37
Some cleanup
nelsonand Jun 11, 2026
776be71
Plot preference
nelsonand Jun 11, 2026
0e35d1d
RERUN - CLEANUP - Remove deprecated equil.toml fallback from input di…
logan-nc Jun 11, 2026
cf90fed
Analysis - BUG FIX - Reconstruct coil b_n_x in machine φ (not SFL ζ) …
logan-nc Jun 12, 2026
378cb4c
PERTURBED EQUILIBRIUM - CLEANUP - Standardize field terminology to Ph…
logan-nc Jun 12, 2026
fc4ced8
Analysis - DOCS - Note plot_surface_3d field is band-limited to the s…
logan-nc Jun 12, 2026
e936416
PERTURBED EQUILIBRIUM - CLEANUP - Rename ptof → rootareafield_to_flux…
logan-nc Jun 12, 2026
19df3f5
ForcingTerms - NEW FEATURE - Window-pane standoff placement with corn…
logan-nc Jun 12, 2026
b664e4f
PERTURBED EQUILIBRIUM - REFACTOR - Operate in field space (b, b̃, b̄)…
logan-nc Jun 12, 2026
9425804
DOCS - BUGFIX - Split Galerkin API onto its own page to fix Documente…
matt-pharr Jun 12, 2026
2f0af11
Merge branch 'develop' into feature/rdcon-galerkin
matt-pharr Jun 12, 2026
0299331
Some plotting updates
nelsonand Jun 12, 2026
58c93a6
Clean up root finder and add q'
nelsonand Jun 12, 2026
4c8e90c
KineticForces - BUG FIX - Thread nutype/f0type into calculated path; …
logan-nc Jun 14, 2026
0ca930e
KineticForces - VALIDATION - Physics-validate Solovev calculated et[1…
logan-nc Jun 14, 2026
9db9167
KineticForces - BUG FIX - Collisionless energy integral in real x-space
logan-nc Jun 14, 2026
5e6981b
KineticForces - BUG FIX - Regular-part limit for collisionless resona…
logan-nc Jun 14, 2026
405acb8
EXAMPLES - CLEANUP - Standardize TOML annotations, bundle a10 inputs,…
logan-nc Jun 15, 2026
92f0ec1
EXAMPLES - CLEANUP - Address PR #285 review: unify TOML annotations
logan-nc Jun 15, 2026
2a64007
DOCS - MINOR - Replaces Pharr field with field
logan-nc Jun 16, 2026
7fccd43
GPEC - DEPRECATION - long overdue removal of banded matrices in Force…
jhalpern30 Jun 16, 2026
ce2de30
GPEC - MINOR - removing a file I accidentally added
jhalpern30 Jun 16, 2026
8fe2870
TEST - MINOR - small bugfix
jhalpern30 Jun 16, 2026
ff575aa
Potential fix for pull request finding
jhalpern30 Jun 16, 2026
a98c29f
Apply remaining changes
Copilot Jun 16, 2026
e3be020
GPEC - MINOR - cleaning up unbanded FourierCoefficients interface
jhalpern30 Jun 16, 2026
410622a
ForceFreeStates - REFACTOR - Fold rpec edge BC into gal_set_boundary!…
matt-pharr Jun 16, 2026
ebc5a75
ForceFreeStates - NEW - gal_edge_onesided: one-sided end-interval pac…
matt-pharr Jun 16, 2026
f67f875
Small speed up change for marginal stability
nelsonand Jun 16, 2026
25b4db1
ForceFreeStates Galerkin - NEW - save xi/xi'
matt-pharr Jun 16, 2026
d9c571d
ForceFreeStates Galerkin - NEW - RPEC inner layer matching with GGJ
matt-pharr Jun 16, 2026
20dc41e
ForceFreeStates Galerkin - NEW - DRIVEN/RPEC matched solution into Pe…
matt-pharr Jun 17, 2026
fca440a
ForceFreeStates Galerkin - TEST - Regression coverage for RPEC matchi…
matt-pharr Jun 17, 2026
4114886
ForceFreeStates Galerkin - DOCS - fortran-physics-reviewer memory: ga…
matt-pharr Jun 17, 2026
54c7065
Merge branch 'develop' into feature/rdcon-galerkin
matt-pharr Jun 17, 2026
11ae3bb
ForceFreeStates - CLEANUP - fix some line numbers / annotations
matt-pharr Jun 17, 2026
b2ef665
ForceFreeStates Galerkin - CLEANUP - drop fortran line-ranges, wire g…
matt-pharr Jun 17, 2026
b7848d1
Merge branch 'develop' into ballooning
logan-nc Jun 17, 2026
a2ec01a
DOCS - MINOR - Cleans up jacobian toml annotations
logan-nc Jun 17, 2026
deaec92
Merge branch 'docs/standardize-toml-annotations' of github.com:OpenFU…
logan-nc Jun 17, 2026
f4b2241
ForceFreeStates - CLEANUP - Avoid duplicate Mercier DI in DR path
jmlmir369 Jun 18, 2026
6dd6d85
GPEC - BUG FIX - Address PR #286 review findings (legacy delta_mband,…
logan-nc Jun 19, 2026
2f640c5
Merge pull request #286 from OpenFUSIONToolkit/no_banded
github-actions[bot] Jun 19, 2026
e7bcf29
EXAMPLES - CLEANUP - Standardize psilow/psihigh wording and consisten…
logan-nc Jun 19, 2026
0d7c02c
KineticForces - REFACTOR - Unify energy integral onto one x-space PV+…
logan-nc Jun 19, 2026
f35f798
ForceFreeStates - REFACTOR - Rename Bal.jl to Ballooning.jl
logan-nc Jun 19, 2026
ffcfcf2
DOCS - BUG FIX - Raise Documenter HTML size_threshold for stability.md
logan-nc Jun 19, 2026
8b2df72
REGRESSION - NEW FEATURE - Track locstab D_I/D_R/ballooning Delta-pri…
logan-nc Jun 19, 2026
26a4076
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into docs…
logan-nc Jun 19, 2026
4156c81
DOCS - MINOR - merge cleanup of tomls
logan-nc Jun 19, 2026
b9ab40e
Merge branch 'develop' into ballooning
logan-nc Jun 19, 2026
e8f656b
Merge pull request #234 from OpenFUSIONToolkit/ballooning
github-actions[bot] Jun 19, 2026
5ccdb03
DOCS - BUG FIX - Add ballooning docs missed by PR #234
logan-nc Jun 19, 2026
5f6346c
DOCS - MINOR - Merge develop; adopt local_stability_flag in annotated…
logan-nc Jun 19, 2026
8bf5d01
TEST - IMPROVEMENT - Kinetic regression on mode-converged deck; fullr…
logan-nc Jun 19, 2026
41ec82a
Merge pull request #285 from OpenFUSIONToolkit/docs/standardize-toml-…
logan-nc Jun 19, 2026
fcb24e5
Merge branch 'develop' into docs/ballooning-docs-from-pr234
logan-nc Jun 19, 2026
3361913
Merge pull request #290 from OpenFUSIONToolkit/docs/ballooning-docs-f…
jmlmir369 Jun 19, 2026
82e1c83
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into bugf…
logan-nc Jun 20, 2026
750765c
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into test…
logan-nc Jun 20, 2026
e8fdfed
EQUIL - BUG FIX - Initialize sol_run 4th profile column; size auto-mp…
logan-nc Jun 20, 2026
a378e2c
EQUIL - BUG FIX - Integrate equilibrium 0D flux integrals out to the …
logan-nc Jun 20, 2026
2b559dd
Merge branch 'develop' into bugfix/equilibrium-pool-reentrancy
logan-nc Jun 20, 2026
18ad1d9
Merge branch 'develop' into bugfix/equil-0d-inductance-integration
logan-nc Jun 20, 2026
5bc55a1
Merge remote-tracking branch 'origin/test/kinetic-pv-regression-valid…
logan-nc Jun 20, 2026
76487b0
Merge pull request #293 from OpenFUSIONToolkit/bugfix/equilibrium-poo…
github-actions[bot] Jun 20, 2026
501ae39
Merge branch 'develop' into bugfix/equil-0d-inductance-integration
logan-nc Jun 20, 2026
006ae37
Merge pull request #292 from OpenFUSIONToolkit/bugfix/equil-0d-induct…
github-actions[bot] Jun 20, 2026
4ac235e
KineticForces - IMPROVEMENT - Pressure-consistent Solovev kinetic pro…
logan-nc Jun 20, 2026
b78248c
ForcingTerms - IMPROVEMENT - Address PR review: raise pf_hoop nsec fl…
logan-nc Jun 21, 2026
8becd06
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into feat…
logan-nc Jun 21, 2026
1ce108b
ForceFreeStates Galerkin - CLEANUP - Review remediation: comments, DR…
logan-nc Jun 21, 2026
3e915d0
KineticForces - IMPROVEMENT - Extend energy-integral X_ENERGY_MAX to …
logan-nc Jun 21, 2026
8f6f68d
Merge pull request #282 from OpenFUSIONToolkit/bugfix/kinetic-collisi…
logan-nc Jun 21, 2026
09cb854
Merge remote-tracking branch 'origin/feature/rerun-from-h5' into feat…
logan-nc Jun 21, 2026
eb677e0
KineticForces - IMPROVEMENT - Address PR #280 review: benchmark/comme…
logan-nc Jun 21, 2026
7a1db2a
Merge branch 'develop' into test/kinetic-pv-regression-validation
logan-nc Jun 21, 2026
82587b3
Merge pull request #278 from OpenFUSIONToolkit/feature/coil-h5-and-an…
logan-nc Jun 21, 2026
962191a
Merge pull request #280 from OpenFUSIONToolkit/test/kinetic-pv-regres…
github-actions[bot] Jun 21, 2026
78e6d4e
DOCS - MINOR - Human cleanup of sign conventions docs
logan-nc Jun 21, 2026
80fa904
Merge branch 'develop' into docs/sign-conventions
logan-nc Jun 21, 2026
5287d0d
Merge pull request #267 from OpenFUSIONToolkit/docs/sign-conventions
github-actions[bot] Jun 21, 2026
93b987f
PERTURBED EQUILIBRIUM - MERGE - Merge develop into conform-powernorm-…
logan-nc Jun 21, 2026
8249bbc
DOCS - MINOR - Add Park (2008) spectral-asymmetry reference for the r…
logan-nc Jun 21, 2026
9af92e3
DOCS - MINOR - Add Park (2008) spectral-asymmetry reference to CLAUDE.md
logan-nc Jun 21, 2026
31aca7e
DOCS - BUG FIX - Fix typos in documentation prose and a code example
logan-nc Jun 21, 2026
65a9b3e
EXAMPLE - NEW FEATURE - DIIID kinetic profiles + NTV demo; ldp/mpsi=2…
d-burg Jun 21, 2026
0efb70b
REGRESSION - Track NTV torque in diiid_n1 case
d-burg Jun 21, 2026
cd3969a
TEST - Re-pin DIIID parallel-integration δW/Δ' for ldp grid
d-burg Jun 21, 2026
8d74561
Merge pull request #277 from OpenFUSIONToolkit/feature/conform-powern…
github-actions[bot] Jun 21, 2026
ce12c74
EXAMPLE - Drop verbose KineticForces section comment
d-burg Jun 21, 2026
5b77fc8
EQUIL - BUG FIX - Newton separatrix finder for limited equilibria (#294)
logan-nc Jun 22, 2026
09e8356
PERTURBED EQUILIBRIUM - BUG FIX - Use Λ† in reluctance to match Fortr…
logan-nc Jun 22, 2026
01eb2cd
RERUN - REFACTOR - Typed equilibrium ingest, all-kind rerun, embedded…
logan-nc Jun 21, 2026
c80d94f
Merge pull request #297 from OpenFUSIONToolkit/bugfix/reluctance-plas…
github-actions[bot] Jun 22, 2026
0a7af46
RERUN - REFACTOR - Consolidate analytic-equilibrium dispatch into one…
logan-nc Jun 22, 2026
8f0a7cc
EXAMPLE - Retarget DIIID equilibrium to Ip=1.15 MA; psihigh=0.995 (ca…
d-burg Jun 22, 2026
1803be9
TEST - Re-pin DIIID parallel-integration for Ip=1.15 equilibrium
d-burg Jun 22, 2026
29ce91c
GPEC - MINOR - removing unnecessary Claude comments
jhalpern30 Jun 23, 2026
7d1df5a
ForcingTerms - REFACTOR - Require imaginary amplitude in all forcing …
logan-nc Jun 23, 2026
cfe3d29
RERUN - CLEANUP - Drop deprecated analytic side-car TOML support
logan-nc Jun 23, 2026
5096eaa
VACUUM - MINOR - commiting general revisions from the spectral branch…
jhalpern30 Jun 23, 2026
1aee197
VACUUM - MINOR - removing green_only
jhalpern30 Jun 23, 2026
2b9b66f
CLEANUP - MINOR - Remove no-op trailing semicolons from split assignm…
logan-nc Jun 23, 2026
17dae7f
Merge branch 'develop' into bugfix/direct-separatrix-newton
matt-pharr Jun 23, 2026
91bf3ed
GPEC - MINOR - removing unneeded semi-colons
jhalpern30 Jun 23, 2026
2ecf7a5
Merge branch 'minor/vacuum_revisions' of github.com:OpenFUSIONToolkit…
jhalpern30 Jun 23, 2026
9f77bb4
VACUUM - MINOR - better info statement for patch_rad logic
jhalpern30 Jun 23, 2026
476aaad
GPEC - MINOR - swapping out banded inputs for mer_flag in deprecated …
jhalpern30 Jun 23, 2026
d2d0866
Merge pull request #299 from OpenFUSIONToolkit/minor/vacuum_revisions
github-actions[bot] Jun 23, 2026
ae94146
EQUIL - TEST - Add fixed-boundary EFIT separatrix-find regression cas…
matt-pharr Jun 23, 2026
18e4976
Merge branch 'develop' into bugfix/direct-separatrix-newton
matt-pharr Jun 23, 2026
6bc1f3f
Merge pull request #296 from OpenFUSIONToolkit/bugfix/direct-separatr…
matt-pharr Jun 23, 2026
a159390
Merge branch 'develop' of github.com:OpenFUSIONToolkit/GPEC into feat…
logan-nc Jun 24, 2026
fe5e736
BENCHMARKS - MINOR - Fixed bug revealed in merge's removal of forcing…
logan-nc Jun 24, 2026
b368b5b
RERUN - BUG FIX - Embed [SOL_INPUT] in nuzero kinetic regression fixture
logan-nc Jun 24, 2026
61f6c75
RERUN - BUG FIX - Update rerun test to renamed resonant_area_weighted…
logan-nc Jun 24, 2026
cfb7693
Merge pull request #217 from OpenFUSIONToolkit/feature/rerun-from-h5
github-actions[bot] Jun 24, 2026
ac6f2fa
EQUIL - NEW FEATURE - HDF5 kinetic-profile format with ASCII back-compat
d-burg Jun 24, 2026
5876b34
EQUIL - IMPROVEMENT - Update DIII-D-like example: edge-matched equili…
d-burg Jun 24, 2026
42a0796
KineticForces - CLEANUP - Remove per-evaluation debug prints from NTV…
d-burg Jun 24, 2026
641c2d1
TEST - CLEANUP - Reword parallel-integration et[1] comment
d-burg Jun 25, 2026
b25b72c
INNERLAYER - CLEANUP - add references to paper equations, add warning…
matt-pharr Jun 23, 2026
32428db
GALERKIN - NEW - save xi_psi and bpen from inner layer to hdf5
matt-pharr Jun 25, 2026
fe2ff10
Merge remote-tracking branch 'origin/develop' into feature/rdcon-gale…
matt-pharr Jun 25, 2026
2c861ef
InnerLayer - BUG FIX - Correct Glasser-Wang 2020 Eq. 55 Coefficients
matt-pharr Jun 25, 2026
959f328
GALERKIN - OPTIMIZATION - Implement column-restricted asymptotic eval…
matt-pharr Jun 25, 2026
c69465f
GALERKIN - OPTIMIZATION - Preallocate output arrays in _solution_prof…
matt-pharr Jun 25, 2026
ba413e0
FORCEFREESTATES - OPTIMIZATION - Improve performance of ballooning OD…
matt-pharr Jun 25, 2026
f992aff
FORCEFREESTATES - OPTIMIZATION - Reduce memory allocations in balloon…
matt-pharr Jun 26, 2026
29bc0ca
GALERKIN - REVIEW - Document second pass review findings and resolve …
matt-pharr Jun 26, 2026
7d8df73
GALERKIN - REFACTOR - Update function signatures and add allocation-f…
matt-pharr Jun 26, 2026
c1b2604
GALERKIN - CLEANUP - Strip stale references from examples, fix docs, …
matt-pharr Jun 26, 2026
4b01c75
FORCEFREESTATES - OPTIMIZATION - Implement parallel processing for ba…
matt-pharr Jun 26, 2026
151395d
FORCEFREESTATES - OPTIMIZATION - Implement parallel for ballooning al…
matt-pharr Jun 26, 2026
7c3b8ea
GALERKIN - REFACTOR - Update import comments and remove export of exp…
matt-pharr Jun 27, 2026
a68a053
automating thmax0
jmlmir369 Jun 27, 2026
cbdb03d
Merge pull request #307 from OpenFUSIONToolkit/performance/ballooning…
matt-pharr Jun 27, 2026
c94542e
Merge branch 'develop' into feature/rdcon-galerkin
matt-pharr Jun 27, 2026
bfb152e
Merge pull request #266 from OpenFUSIONToolkit/feature/rdcon-galerkin
matt-pharr Jun 30, 2026
6292783
EQUIL - IMPROVEMENT - Scope custom-Jacobian knobs to jac_custom_power_*
logan-nc Jul 2, 2026
f87a739
Merge pull request #311 from OpenFUSIONToolkit/feature/jac-custom-pow…
logan-nc Jul 3, 2026
34fafca
Merge remote-tracking branch 'origin/develop' into feature/diiid-kine…
matt-pharr Jul 6, 2026
e9337a0
EQUIL - MINOR - Update kinetic profile file parsing docstring to incl…
matt-pharr Jul 6, 2026
8eb3f63
KineticForces - MINOR - fix some whitespace
matt-pharr Jul 6, 2026
94e2ea3
Merge pull request #295 from OpenFUSIONToolkit/feature/diiid-kinetic-…
matt-pharr Jul 6, 2026
3a3d50d
KineticForces - OPTIMIZATION - Implement static typing for PitchGARPa…
matt-pharr Jul 8, 2026
de76662
KineticForces - OPTIMIZATION - Refactor resonant integrand to reduce …
matt-pharr Jul 8, 2026
d2c4584
KineticForces - OPTIMIZATION - Introduce BounceScratch struct for per…
matt-pharr Jul 8, 2026
17a441a
KineticForces - DOCS - return comment above newly explicit function
matt-pharr Jul 8, 2026
6f49409
KineticForces - REFACTOR - Consolidate Solovev equilibrium parameters…
matt-pharr Jul 8, 2026
0007e62
KineticForces - MINOR - Initialize wmats_lmda with NaN to catch unini…
matt-pharr Jul 8, 2026
38b5f42
KineticForces - MINOR - Address PR review: derive nfine from scratch …
logan-nc Jul 8, 2026
5044073
Merge pull request #322 from OpenFUSIONToolkit/PENTRC_statictyping_pr…
matt-pharr Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/agent-memory/fortran-physics-reviewer/MEMORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- [Known Physics Issues in PerturbedEquilibrium](known_issues_perteq.md) — xss_mn not implemented, xi_modes placeholders
- [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
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 (mpharr): 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.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.codex
*.cov
*.mod
*.dylib
Expand All @@ -7,11 +8,14 @@
*.i
*.out
*.h5
# kinetic-profile inputs are tracked despite the blanket *.h5 (output) ignore
!examples/**/*kinetic*.h5
.vscode
*.DS_Store
*.pdf
!docs/resources/*.pdf
*.png
!docs/src/assets/**/*.png
*.jld2
.gitattributes
Manifest.toml
Expand Down
51 changes: 50 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ The PerturbedEquilibrium module implements GPEC-style perturbed equilibrium calc
- Published: Physical Review Letters **99**, 195003 (2007)
- Describes: Plasma response to resonant magnetic perturbations (RMP)

- **Park et al. (2008)**: "Spectral asymmetry due to magnetic coordinates"
- Location: `docs/resources/2008-Park-Spectral_asymmetry_due_to_magnetic_coordinates.pdf`
- Published: Physics of Plasmas **15**, 064501 (2008)
- Describes: Coordinate-dependence of the perturbed-field Fourier spectrum, motivating area-normalization of the resonant harmonic to obtain the coordinate-invariant resonant field

- **Park et al. (2009)**: "Importance of plasma response to nonaxisymmetric perturbations in tokamaks"
- Location: `docs/resources/2009-Park-Importance_of_plasma_response_to_nonaxisymmetric_perturbations_in_tokamaks-compressed.pdf`
- Published: Physics of Plasmas **16**, 056115 (2009)
Expand Down Expand Up @@ -373,7 +378,7 @@ GPEC consists of **seven main modules** organized in `src/`:
- `Fourfit.jl` - Fourier fitting routines
- `FixedBoundaryStability.jl` - Fixed boundary analysis
- `Free.jl` - Free boundary stability
- `Mercier.jl` - Mercier stability criterion
- `Ballooning.jl` - Local stability scan: Mercier D_I, resistive interchange D_R, and high-n ballooning Δ' (s–α). Replaces the former standalone `Mercier.jl`.
- Status: Stable, core DCON functionality implemented

#### Perturbed Equilibrium Modules
Expand Down Expand Up @@ -617,6 +622,13 @@ Every consultation is bounded — see **Subagent Consultations** under Important
- **Documentation coverage** - When adding a new module or submodule with public docstrings, add a corresponding `@autodocs` block in `docs/src/`. Documenter CI will fail with a `missing_docs` error if any exported docstring is not covered. The analysis submodule docs live in `docs/src/analysis.md`.
- **Docstrings are rendered as Markdown** - Documenter parses docstrings as CommonMark, so `[text](...)` patterns become hyperlinks and will fail CI with `invalid local link/image` if the target doesn't exist. Common pitfall: unit annotations like `[degrees] (or [m] if ...)` parse as `[degrees](or [m] if ...)` — a broken link. Use plain words (`in degrees`) or backticks (`` `[m]` ``) for unit labels inside docstrings. Same rule for bracketed array-shape hints (`[ncoil]`) followed by parentheses. When in doubt, preview with `julia --project=docs docs/make.jl` before pushing.
- **Keep code comments concise** - A comment should be one line where possible. Do not write multi-line block comments explaining the current session's investigation, what was tried, what was wrong before, or why a specific file/path behaves differently. State what the code does and why at a general level. Example of too much detail: a 6-line block explaining that efit_by_inversion uses psilow>0 while CHEASE starts at 0, that the old code was removed, and that spline spikes result. Preferred: `# Replicate Fortran inverse.f: overwrite deta at axis (r²=0) by extrapolating from innermost surfaces.`
- **No PR/issue references in source** - Do not cite specific GitHub PR or issue numbers (e.g. `#171`, `#202`) in source or test comments/docstrings. During dynamic development these references quickly go stale and pollute the code. Just concisely state the objective or what the code does; the git history and PR threads track the provenance.
- **Document struct fields in the docstring, not inline** - When adding a field to a struct, put its description in the struct's `## Fields` docstring rather than (or in addition to) a trailing inline comment, and document any non-obvious contract (e.g. which keys a `Dict`/ingest carries per variant). Do not annotate outer constructors with positional-argument counts ("passes 11 positional args") — those rot when a field is added; describe the intent instead.

### Minimal-change discipline
- **Reuse native ops and existing utilities before writing new ones.** FastInterpolations splines integrate and differentiate natively (`integrate`, `cumulative_integrate`, `deriv1`); the Equilibrium module already has flux-surface integration/average patterns. Do not reimplement spline integration, quadrature, or differentiation — grep for the existing idiom first.
- **Size the change to the problem.** A small numerical correction (e.g. a ~1% fix) should be a handful of lines, not new general-purpose machinery. Resist faithfully porting Fortran scaffolding (custom integrators, power-law spline bases) when a native call plus a one-line correction gives the same numbers — verify equivalence instead of assuming the elaborate version is needed.
- **Don't commit throwaway artifacts for minor fixes.** No in-repo benchmark scripts/outputs or agent-memory churn for a small change — these accumulate and outsize `src`. Verify with a scratch script (e.g. under `/tmp`) and the regression harness; the regression harness is the durable record of numerical behavior.

### Output Files
- **Default output**: `gpec.h5` (previously `euler.h5` in older versions)
Expand Down Expand Up @@ -671,6 +683,43 @@ Additional file hygiene (enforced by pre-commit hooks):
- Files must end with exactly one newline
- LF line endings only (no CRLF)

### TOML Annotation Conventions

Config-style TOML files (`examples/*/gpec.toml`, `examples/*/sol.toml`, the
`test/test_data/*` fixtures, and `regression-harness/cases/*.toml`) follow one shared
annotation style so they stay consistent and self-documenting for users who copy and
modify them. **Do not invent a new convention** — match what the existing example files do.

1. **File header (2–10 lines).** Begin each config-style TOML with a plain `#` comment block
stating the example's purpose/context and calling out key settings (wall choice, forcing,
n-range, ideal vs kinetic). No ASCII-art separators or decorative dividers.
2. **Inline annotation on every variable line.** Every `key = value` gets a trailing
`# description`. Source the wording from the matching config struct's docstring
(`EquilibriumConfig`, `WallShapeSettings`, `ForceFreeStatesControl`, `ForcingTermsControl`,
`PerturbedEquilibriumControl`, `SolovevConfig`, `TJAnalyticConfig`, `KineticForcesControl`)
and keep it to one terse line. **Use the same description for the same variable across all
files** — `examples/DIIID-like_ideal_example/gpec.toml` is the canonical reference for the
common sections.
3. **Section comments only when informative.** No comment is required above a section. Keep a
block comment only when it carries real information (e.g. the Solovev `[Wall]` note on why a
conformal wall is needed). Never add decorative section dividers.
4. **No Fortran references — annotations must be self-contained and Julia-centric.** The Julia
code is the production workhorse; a new user must not need to know the legacy Fortran GPEC
code to read an example. Headers explain the *scenario and its unique aspect*; inline comments
explain the *variable*. Do **not** cite Fortran namelist files (`dcon.in`/`equil.in`/`pentrc.in`),
Fortran flag names (`kin_flag`, `sas_flag`, `electron_flag`, …), or legacy code names
(`DCON`/`STRIDE`/`PENTRC`) as things the reader must know. Non-Fortran external-model citations
(e.g. the analytic TJ model behind `tj_analytic`) are acceptable provenance. (This applies to
the user-facing `examples/*` and `test/test_data/*` TOMLs; `regression-harness/cases/*` may
retain algorithm names as developer metadata.)
5. **Only active, meaningful variables in examples.** Do not set deprecated or "not yet
implemented" variables just to mirror defaults — they add clutter and imply false relevance
(e.g. the `truncate_at_dW_peak` edge-peak truncation, `thmax0`). Omit them so examples show
only knobs that do something on that run.
6. **`Project.toml`-family files are exempt.** `Project.toml`, `docs/Project.toml`,
`regression-harness/Project.toml`, and `.JuliaFormatter.toml` are machine-managed; do not
inline-annotate dependency UUIDs or `[compat]` entries.

### Performance
- Pure Julia implementations are available for all major components and offer comparable or better performance than Fortran
- Benchmarks available in `benchmark/` directory for Fourier transforms and vacuum calculations
Expand Down
Loading
Loading