Repository navigation
EQUIL - BUGFIX - Bound grid_type original by psilow and psihigh - #335
Merged
Merged
Conversation
grid_type = "original" took every node of the input file and ignored psilow and psihigh. On inverse files the grid ran from the axis to the file edge, where the separatrix search in equil_out_sep_find never converges (RDCON and STRIDE hang), and the psilim reform could not move the edge. On direct files sq%xs was assigned mpsi nodes for its mpsi+1 (reallocating it), so the radial spline was corrupt. The grid is now psilow, the file's nodes strictly between psilow and psihigh, and psihigh (new grid_mod function clipspace). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ow and psihigh grid_type 'original' builds the radial grid as psilow, the input nodes strictly inside, psihigh. An i-file node at psilow + 1e-16 (OFT's axis_pack puts its first node at psi_N = 1e-5 = psilow, and round-off can land it on either side) survived as a ~1e-16-wide first interval; RDCON and STRIDE then never left the axis (ODE steps of 1e-16, then garbage psi), hanging on every recomputed DIII-D i-file tested. Points within 1e-10 of the range of an end are now dropped. Files without such a node give bitwise-identical output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Added a second commit: clipspace now also drops input nodes within round-off (1e-10 of the range) of psilow or psihigh. TokaMaker i-files put their first packed node at psi_N = 1e-5, and round-off can land it just above psilow = 1e-5. That left a ~1e-16-wide first interval on which RDCON and STRIDE never left the axis. Grids without such a node are unchanged. |
…tion limit 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.
This is good. I appended a minor docs update on this for reference
StuartBenjamin
pushed a commit
to StuartBenjamin/GPEC-1
that referenced
this pull request
Oct 23, 2026
PrincetonUniversity#327 PrincetonUniversity#328 PrincetonUniversity#329 PrincetonUniversity#335 merged upstream; + 63328e4 STRIDE naive packing within nIntervalsTot, 0d6b30f docs) into PSFC_dev
This was referenced Oct 23, 2026
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.
grid_type = "original"is meant to put the equilibrium on the input file's own ψ surfaces, but it took every one of them and ignoredpsilowandpsihigh:inverse_run,inverse_chease4_run): the grid ran from the axis to the last file surface. On TokaMaker i-files RDCON and STRIDE then never return, because the top/bottom search inequil_out_sep_finddoes not converge on that surface and has no iteration limit. Thesas_flagreform topsilimcould not move the edge either.direct_run):sq%xs=sq_in%xs(1:mpsi)assigns mpsi values to an array of mpsi+1, sosq%xsis reallocated with the wrong size and bounds. The shippedDIIID_ideal_examplewithgrid_type="original"stops with "Took too many steps to find flux surf.".This PR makes the original grid
psilow, then the file's surfaces strictly betweenpsilowandpsihigh, thenpsihigh: the same end points as every other grid type. A small newgrid_modfunction,clipspace, does this for both readers. The other grid types are unchanged.grid_type="original"DIIID_ideal_example(g-file 257×257), DCON and STRIDESTRIDE Re Δ′ (n = 1, mtheta 128) with this PR, as the change against ldp with mpsi 4096 on the 513×1025 i-file of the same equilibrium (DIII-D 174956 at 1490 ms):
The original grid now converges with file size on the interior surfaces. q = 6 sits just inside psilim, where the file's own surfaces are sparser than a packed ldp grid.
Running is not the same as being accurate. The original grid is only as fine as the file's grid, and a g-file's grid is uniform in ψ, so it is coarse at the edge. On
DIIID_ideal_example, DCON's least stable total energy with this PR is:rho, also coarse at the edge, approaches the ldp value only slowly as mpsi grows, so this is edge resolution rather than a bug in the new grid.
dcon/READMEand theinput/equil.incomment now say this and recommend ldp unless the input grid is packed toward the edge. The README also corrects "psilow is used only for ldp": every grid type except rho uses it.The scripts and inputs used are in the attached zip.
🤖 Generated with Claude Code