Repository navigation
Equilibrium - BUGFIX! - End the original inverse grid at psilow and psihigh - #535
Merged
Merged
Conversation
…ihigh grid_type = "original" ran from the first off-axis file node to the last file surface, ignoring psilow and psihigh. On an edge-packed i-file the domain then reached ψ_N 0.9999 instead of psihigh, so the dmlim edge moved (psilim 0.996 -> 1.000 on a DIII-D i-file) and every Δ′ changed. The grid is now psilow, the file's nodes strictly between psilow and psihigh, and psihigh, as in Fortran GPEC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matt-pharr
approved these changes
Oct 23, 2026
matt-pharr
left a comment
Collaborator
There was a problem hiding this comment.
Minimal fix. Thumbs up 👍
matt-pharr
enabled auto-merge
October 23, 2026 19:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release note
grid_type = "original", which no harness case uses; no tracked quantity moves (harness @ de6da4b)grid_type = "original"now honorpsilowandpsihigh; to reproduce the old grid, set them to the input file's first off-axis and last ψ surfacesInverse equilibria run with
grid_type = "original"now start the ψ grid atpsilowand end it atpsihigh, as the other grid types do. Before, both limits were ignored and the grid ran to the input file's last surface, which on files that reach ψ_N ≈ 1 moved the edge q and every Δ′.Regression report
develop bca7ce7 vs this PR de6da4b, all 19 cases on ITER SDCC: 17 unchanged,
gal_resistive_peN/A on both refs, anddiiid_slayer_n1flags SLAYER γ_Hz at the 2/1 surface (222.358 → 222.161 Hz; 3/1 and 4/1 identical). That is run-to-run scatter, not this change: the case uses the defaultgrid_type = "auto", which this PR does not touch; SLAYER's AMR growth-rate extraction depends on the global random-number state, which the open #572 removes; and develop at 9a51446 gave 222.161 Hz in an earlier run.Notes for reviewers
grid_type = "original"on an inverse equilibrium used the file's surfaces from the first one off the axis to the last one, sopsilowandpsihighwere ignored. The code comment said psihigh still set psilim, but it does not:qmaxand the dmlim edge come from the grid's last node. On a TokaMaker i-file, whose last surface sits at ψ_N 0.9999, the domain grew to the file edge and every Δ′ changed.The grid is now
psilow, then the file's surfaces strictly betweenpsilowandpsihigh, thenpsihigh, as on the other grid types. This matches the Fortran fix in PrincetonUniversity/GPEC#335. The unit test now checks those nodes, and it fails on develop.DIII-D TokaMaker i-file (129×257), n = 1, Riccati, mtheta 256, Re Δ′ (run on a branch that reads the file's ψ bounds; the original-grid code there is the same as develop's):
On the finer 513×1025 i-file, the original grid with this PR is within 1.3 % of ldp with mpsi 4096 at q = 2–5 (q = 6, just inside psilim: −22 %), and within 0.7 % of Fortran STRIDE on the same grid at q = 2–5.
The scripts used are in the attached zip.
🤖 Generated with Claude Code