Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
78020ca
ForceFreeStates.Galerkin - FEATURE! - Prepare Galerkin results for in…
matt-pharr Nov 4, 2026
f2f0bef
ForceFreeStates.Matching - FEATURE! - Publish the matched plasma ener…
matt-pharr Nov 6, 2026
4d82426
Merge branch 'feature/analysis-plots-overhaul' into feature/galerkin-…
matt-pharr Nov 7, 2026
0e941cd
Analysis - FEATURE - Frame matched free-boundary energies and show th…
matt-pharr Nov 10, 2026
ad757dc
Merge branch 'feature/analysis-plots-overhaul' into feature/galerkin-…
matt-pharr Nov 10, 2026
f17055d
ForceFreeStates.Riccati - REFACTOR! - Build every Riccati output from…
matt-pharr Nov 13, 2026
ecac988
ForceFreeStates.Riccati - FEATURE! - Publish solution profiles from t…
matt-pharr Nov 13, 2026
341814b
ForceFreeStates - FEATURE! - Share one outer solution basis between R…
matt-pharr Nov 16, 2026
4a935cc
Merge branch refactor/riccati-single-pass into feature/galerkin-plasm…
matt-pharr Nov 16, 2026
d0f0456
ForceFreeStates - FEATURE! - Cross ideal singular surfaces in the asy…
matt-pharr Nov 16, 2026
8948627
ForceFreeStates - FEATURE! - Fill the stored solutions inside each cr…
matt-pharr Nov 16, 2026
b76c6c8
Merge branch refactor/riccati-single-pass into feature/galerkin-plasm…
matt-pharr Nov 16, 2026
07cf80d
ForceFreeStates - PERF - Schedule the Riccati chunk loops greedily an…
matt-pharr Nov 17, 2026
9125645
Merge branch refactor/riccati-single-pass into feature/galerkin-plasm…
matt-pharr Nov 17, 2026
8fc6c5c
ForceFreeStates - BUGFIX! - Default kinetic runs to a 1e-5 crossing d…
matt-pharr Nov 18, 2026
b6bfdf9
PerturbedEquilibrium - FEATURE! - Accept Riccati results in plasma_re…
matt-pharr Nov 18, 2026
02e8804
PerturbedEquilibrium - REFACTOR! - Rename the forcing-driven Δ′ to Δ_mn
matt-pharr Nov 18, 2026
adc5e59
PerturbedEquilibrium - FEATURE! - Add the asymptotic Δ_mn metrics bes…
matt-pharr Nov 18, 2026
a997da7
Merge branch refactor/riccati-single-pass into feature/galerkin-plasm…
matt-pharr Nov 18, 2026
aa9ce11
Merge branch 'feature/analysis-plots-overhaul' into refactor/riccati-…
matt-pharr Nov 19, 2026
6a6da27
Merge branch refactor/riccati-single-pass into feature/galerkin-plasm…
matt-pharr Nov 19, 2026
5f1f8d6
Merge branch 'feature/analysis-plots-overhaul' into refactor/riccati-…
matt-pharr Nov 19, 2026
b3a2ad1
Merge branch 'feature/analysis-plots-overhaul' into refactor/riccati-…
matt-pharr Nov 19, 2026
8e2c8db
Merge branch 'feature/analysis-plots-overhaul' into refactor/riccati-…
matt-pharr Nov 20, 2026
bbd1215
PerturbedEquilibrium - FEATURE! - Accept matched results with only th…
matt-pharr Nov 23, 2026
9a2f3f7
Merge branch 'feature/analysis-plots-overhaul' into refactor/riccati-…
matt-pharr Nov 23, 2026
139b4bc
Merge branch refactor/riccati-single-pass into feature/galerkin-plasm…
matt-pharr Nov 23, 2026
19662a4
Repo - BUGFIX - Pass error_field_response, not the removed rpec_flag,…
matt-pharr Nov 23, 2026
7f6cc84
Examples - FEATURE - Drive the Riccati and matched Galerkin DIII-D ex…
matt-pharr Nov 25, 2026
0c02af7
Analysis - FEATURE - Let the coupling plots choose their matrix and c…
matt-pharr Nov 26, 2026
2bf80d0
ForcingTerms - REFACTOR! - Rename RMPField to ForcingField
matt-pharr Nov 13, 2026
eeb5b56
ForcingTerms - REFACTOR! - Make each ForcingField source its own leaf…
matt-pharr Nov 13, 2026
5c90554
ForcingTerms - FEATURE - Add magnetic materials and the exact field o…
matt-pharr Nov 16, 2026
a1fefaf
Equilibrium - FEATURE - Evaluate the machine-frame equilibrium field …
matt-pharr Nov 16, 2026
f67f86e
ForcingTerms - API! - Default the toroidal coil grid to 32(|n| + 1) p…
matt-pharr Nov 16, 2026
970e225
ForcingTerms - API! - Sum every source in [ForcingTerms] and drop for…
matt-pharr Nov 17, 2026
1c6743a
ForcingTerms - FEATURE - Drive the perturbed equilibrium with saturat…
matt-pharr Nov 26, 2026
d539a38
ForcingTerms - PERF - Decompose the control-surface field without bui…
matt-pharr Nov 26, 2026
99f771b
PerturbedEquilibrium - FEATURE! - Record each forcing source's contro…
matt-pharr Nov 26, 2026
a0ea193
ErrorFields - PERF! - Take coil sensitivities from the field gradient…
matt-pharr Nov 27, 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: 0 additions & 1 deletion benchmarks/benchmark_against_fortran_run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ function write_gpec_toml_coil(
println(io, "save_interval = $(p.euler_stride)")
println(io)
println(io, "[ForcingTerms]")
println(io, "forcing_data_format = \"coil\"")
println(io, "mtheta_coil = $(p.mtheta_coil)")
println(io, "nzeta_coil = $(p.nzeta_coil)")
for (name, currents) in zip(p.coil_names, p.coil_currents)
Expand Down
1 change: 0 additions & 1 deletion benchmarks/benchmark_diiid_ideal_ntv_torque.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ singfac_min = 1e-4
[Riccati]
eulerlagrange_tolerance = 1e-7
save_interval = 3
renorm_threshold = 1e4
"""
)
end
Expand Down
117 changes: 0 additions & 117 deletions benchmarks/benchmark_riccati_der.jl

This file was deleted.

4 changes: 2 additions & 2 deletions docs/development/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Splines are provided by the external `FastInterpolations` package rather than by
- Reads kinetic profiles configured under `[KineticForces]`

11. **ErrorFields** (`src/ErrorFields/`) - Error-field sensitivity to coil misalignment
- `Sensitivity.jl` - central-difference linearization of every coil set's control-surface spectrum with respect to its rigid shifts and tilts, on one shared boundary grid
- `Sensitivity.jl` - exact linearization of every coil set's control-surface spectrum with respect to its rigid shifts and tilts, from the Biot–Savart field and its gradient on one shared boundary grid
- `sensitivity_table` projects that linearization onto any windowed dominant mode post hoc (in memory or from `gpec.h5`); consumes `PerturbedEquilibrium.ResonantCoupling` and `ForcingTerms.coil_forcing_modes`
- Configured under `[ErrorFields]`; writes `ErrorFields/CoilSensitivities/`

Expand Down Expand Up @@ -212,7 +212,7 @@ The complete GPEC analysis pipeline:
### Stability
- `SingType` - Singular surface data including:
- Rational surface location (ψ, ρ, q = m/n, dq/dψ)
- Δ' (tearing stability parameter) — **stub**; the valid Δ' is `ForceFreeStatesResult.delta_prime.matrix`
- Δ' (tearing stability parameter) — **stub**; the valid Δ' is `ForceFreeStatesResult.delta_prime` (`DeltaPrimeData`)
- Asymptotic solution bases at the inner-layer boundaries
- `ForceFreeStatesResult` - Published product of a solve: mode space, metric/matrix fits, singular
surfaces, and the per-integrator products (ξ solution and its basis, free-boundary energies,
Expand Down
8 changes: 4 additions & 4 deletions docs/development/hdf5-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Conventions for the structure and naming of the `gpec.h5` output file. Every wri

**The schema must be intuitive to a plasma physicist who is not a developer of this code.** The top level largely mirrors the TOML sections / major `src/` modules — which are themselves organized along physics lines — but **physics intuition wins whenever the two diverge**. Worked examples of that rule:

- All per-rational-surface stability results consolidate under `SingularSurfaces/`, regardless of which algorithm produced them: the GGJ coefficients sit beside the Δ′/PEST-3 matching results, and the Riccati BVP and the Galerkin outer-region solve write the *same* `Delta_prime_matrix`/`Delta_prime_raw`/`Delta_coil`/`pest3_*` paths rather than each owning a producer-named subgroup.
- All per-rational-surface stability results consolidate under `SingularSurfaces/`, regardless of which algorithm produced them: the GGJ coefficients sit beside the Δ′/PEST-3 matching results, and the Riccati BVP and the Galerkin outer-region solve write the *same* `Delta_prime_*`/`Delta_EF`/`pest3_*` paths rather than each owning a producer-named subgroup.
- `EulerLagrangeMatrices` over a bare `Matrices` — group names must say what the data *is*, not which array it came from. Same reasoning renamed `matrices_<method>/` → `KineticMatrices/`.

Physics-topic groups elevated to top level (rather than nested under their producer): `Info/`, `Input/`, `SingularSurfaces/`, `LocalStability/`, `SurfaceGeometries/`.
Expand Down Expand Up @@ -40,10 +40,10 @@ Top level (11 groups):
| `Info/` | Run metadata: `git_version`, mode-number ranges (`mpert`, `mlow`, …, `mn_index`), `psilim`, `qlim`, `Runtimes/` (per-stage wall-clock seconds) |
| `Input/` | Rerun snapshot: `gpec_toml_raw`, `RawInputs/{Equilibrium, ForcingTerms, Coils/<name>, Kinetic, Wall, ErrorFields}` |
| `Equilibrium/` | Scalars (`beta_N`, `q_axis`, `q_95`, `I_p`, …) plus `Profiles/` (1-D on `psi`: 2piF, mu0p, dVdpsi, q) and `Geometry/` (2-D on `psi`×`theta`: rcoords, offset, nu, jac) |
| `ForceFreeStates/` | `Solutions/ForwardIntegration/` (u-solutions), `Solutions/GalerkinIntegration/` (closed ξ profiles in the shared layout, the gal surface list, `gal_basis_output`-gated `Basis/`), `write_el_matrices`-gated `EulerLagrangeMatrices/{Ideal,Kinetic}`, `FreeBoundaryStability/`, `EdgeScan/` |
| `ForceFreeStates/` | `Solutions/ForwardIntegration/` (u-solutions), `Solutions/GalerkinIntegration/` (the gal surface list, `gal_basis_output`-gated `Basis/`), `Solutions/Match/` (closed ξ profiles of a `[Match]` in the shared layout, on the grid of the Galerkin or Riccati outer solutions), `write_el_matrices`-gated `EulerLagrangeMatrices/{Ideal,Kinetic}`, `FreeBoundaryStability/`, `EdgeScan/` |
| `LocalStability/` | Mercier `D_I`, resistive interchange `D_R`, `ballooning_Delta_prime` on `psi`; the ballooning α boundary on `ballooning_psi` |
| `SingularSurfaces/` | Per-rational-surface data: `rational_psi`/`rational_q`/`rational_m`/`rational_n`, GGJ coefficients, `Delta_prime_matrix`/`Delta_prime_raw`/`Delta_coil`/`pest3_A`/`pest3_B`/`pest3_Gamma` (Riccati or Galerkin alike), the inner-layer `Match/` results, `Kinetic/` |
| `PerturbedEquilibrium/` | `ForcingModes/`, `Response/`, `ResponseMatrices/`, `SingularCoupling/`, `Energies/`, `TorqueResponse/` (kinetic forward solves: ψ-resolved `T_xe`, `T_source`), control-surface spectra |
| `SingularSurfaces/` | Per-rational-surface data: `rational_psi`/`rational_q`/`rational_m`/`rational_n`, GGJ coefficients, `Delta_prime_raw_freeboundary`/`Delta_prime_raw_fixedboundary`/`Delta_EF`/`edge_response`, the free-boundary `Delta_prime_matrix`/`pest3_A`/`pest3_B`/`pest3_Gamma` and their `_fixedboundary` counterparts (Riccati or Galerkin alike), the inner-layer `Match/` results, `Kinetic/` |
| `PerturbedEquilibrium/` | `ForcingModes/`, `ForcingSources/` (each forcing source's b̃ and dominant-mode overlap, summing to the totals), `Response/`, `ResponseMatrices/`, `SingularCoupling/`, `Energies/`, `TorqueResponse/` (kinetic forward solves: ψ-resolved `T_xe`, `T_source`), control-surface spectra |
| `KineticForces/` | `<method>/` (torque/energy profiles, `dTdpsi_ell` resolved by bounce harmonic on the `ell` scale, `KineticMatrices/`); multi-ion runs add `PerSpecies/<species>/<method>/` with the same per-method layout, summing to the top-level total |
| `ErrorFields/` | `CoilSensitivities/` (per-coil-set control-surface spectra and their rigid shift/tilt derivatives, `DominantMode/` full-window projection); `MonteCarlo/` (intrinsic and corrected `\|δ\|` histograms over the sampled tolerances, per batch and averaged); `Risk/` (threshold density, `P(lock\|δ)`, locking probabilities, `ToleranceScan/`); `NTV/` (correction-coil overlap and NTV torque couplings per kAt) |
| `Tearing/` | `PerSurface/` (+ `DpMatrix/`), `Roots/`, `LayerWidths/`, `Diagnostics/{ValidRoots,Poles,FilteredRoots}` (+ `*Winding` with `root_classification = winding`), `Scan/Surface_<k>/`, `CriticalResonantField/` (+ `Scan/Surface_<k>/`) |
Expand Down
2 changes: 1 addition & 1 deletion docs/development/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ GPEC will eventually implement resistive MHD stability analysis based on:

- **Glasser (2018)**: "A robust solution for the resistive MHD toroidal Δ′ matrix in near real-time"
- Location: `docs/resources/2018-Glasser-A robust solution for the resistive MHD toroidal Delta-prime matrix in near real-time.pdf`
- Published: Physics of Plasmas **25**, 032501 (2018)
- Published: Physics of Plasmas **25**, 082502 (2018)
- Describes: Fast computation of Δ' matrix for resistive stability

- **Wang et al. (2020)**: "Modeling of resistive plasma response in toroidal geometry using an asymptotic matching approach"
Expand Down
2 changes: 1 addition & 1 deletion docs/development/regression-harness.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ regress --cases solovev_n1 --ref-range develop~10..develop
- `--jobs N` — run N cases at a time (see *Parallel lanes* above)
- `--isolate` — run each case in its own fresh subprocess instead of a warm worker

GPEC workers run with `-t auto` (all cores) so GPEC's threaded kernels are active; set `GPEC_REGRESS_THREADS=1` to force single-threaded runs. Tracked quantities are not bit-identical across thread counts. Most move only in the last few bits, inside their noise floors; the parallel Riccati integrator splits its domain by thread count, so its energies move by ~5e-9 and its step counts by ~2 between 1 and 16 threads, and the Riccati cases' floors are set above that spread. The count each run actually used is recorded in its environment fingerprint (shown in the report's `env:` lines), and the report flags two compared runs with different counts. Thread count is not part of the cache key; a `CHANGED` row in a comparison across thread counts that sits just above its floor is worth re-checking at a matched `GPEC_REGRESS_THREADS`.
GPEC workers run with `-t auto` (all cores) so GPEC's threaded kernels are active; set `GPEC_REGRESS_THREADS=1` to force single-threaded runs. Tracked quantities are not bit-identical across thread counts. Most move only in the last few bits, inside their noise floors; the Riccati integrator's chunking does not depend on the thread count. The count each run actually used is recorded in its environment fingerprint (shown in the report's `env:` lines), and the report flags two compared runs with different counts. Thread count is not part of the cache key; a `CHANGED` row in a comparison across thread counts that sits just above its floor is worth re-checking at a matched `GPEC_REGRESS_THREADS`.

On a machine you share with other people or with your own parallel sessions, `-t auto` is antisocial: set `GPEC_REGRESS_THREADS` to a bounded count, and `JULIA_NUM_PRECOMPILE_TASKS` alongside it, since `Pkg.instantiate()` otherwise fans out to `Sys.CPU_THREADS + 1` precompile workers at the start of every ref. If the machine has a batch scheduler, submit the run through it and pin both variables to the allocation, with `--jobs` × `GPEC_REGRESS_THREADS` equal to the CPUs requested.

Expand Down
Loading
Loading