Skip to content

STRIDE - BUGFIX - Split the axis interval into at least 8 pieces - #325

Merged
matt-pharr merged 2 commits into
developfrom
bugfix/stride-axis-interval-split
Oct 23, 2026
Merged

matt-pharr merged 2 commits into
developfrom
bugfix/stride-axis-interval-split

Conversation

@StuartBenjamin

Copy link
Copy Markdown
Collaborator

STRIDE's innermost Δ′ can be wrong by orders of magnitude when the interval from the axis to the first rational surface is not subdivided. ode_set_intervals hands out the spare intervals by estimated compute time, and that estimate rates the axis interval as cheap. So at the default nIntervalsTot = 33 it often stays whole, and it always does when nIntervalsTot is forced up to its minimum (n = 2 with 11 or more surfaces). This PR splits the axis interval into 8 pieces once every inner region has been split, and counts those pieces in the forced minimum.

Diagonal Δ′ of the innermost surface, on three DIII-D equilibria (RDCON, develop + #300, on the same deck in the last column):

case develop, 33 develop, 132 this PR, 33 this PR, 132 RDCON
n = 2, q = 1.5 at ψ_N 0.46 −111.3 (forced to 45; axis 1 piece) −0.733 −0.733 (forced to 52) −0.733 −0.745
n = 2, q = 1.5 at ψ_N 0.46 (another shot) 69.0 (axis 1 piece) −0.622 −0.622 −0.622 −0.657
n = 1, q = 3 at ψ_N 7e-4 −1.09e5 (axis 1 piece) −634.7 −634.7 −634.7 −635.3

With the axis interval in 4 pieces the first case gives −1.29; from 8 pieces on, every case agrees with its 132-interval value to 4 digits. Run time is unchanged (20 s, 12 s and 7 s at 2 threads).

Examples:

  • DIIID_ideal, DIIID_resistive, a10_ideal, solovev_resistive and regression_solovev_resistive give bit-identical stride_output_n1.nc.
  • solovev_ideal and regression_solovev_ideal move ≤ 4e-6 in Δ′ (the W eigenvectors by up to 2e-3).
  • a5_tearing_example stops with "Integration direction not reversed" on develop and on this branch alike.

🤖 Generated with Claude Code

ode_set_intervals spreads the spare intervals by estimated compute time, which rates the
interval from the axis to the first singular surface as cheap: at the default
nIntervalsTot = 33 it often stays whole (always when nIntervalsTot is forced up to its
minimum), and then the innermost Delta' is wrong by up to 1e3 (DIII-D n = 2: -111 or 794
against -0.733 converged; n = 1: -1.09e5 against -635). The axis interval is now split
into nAxisMin = 8 pieces once every inner region is split, and nIntervalsMin counts them.
Converged at 8 pieces in every case tried; DIIID ideal/resistive, a10 and both resistive
Solov'ev examples are bit-identical; the ideal Solov'ev ones move <= 4e-6 in Delta'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StuartBenjamin added a commit to StuartBenjamin/GPEC-1 that referenced this pull request Oct 18, 2026
@StuartBenjamin
StuartBenjamin marked this pull request as draft October 19, 2026 07:57
@logan-nc logan-nc mentioned this pull request Oct 21, 2026
27 tasks done
@StuartBenjamin
StuartBenjamin marked this pull request as ready for review October 23, 2026 02:12

@matt-pharr matt-pharr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Generalized to naive intervals also.

@matt-pharr
matt-pharr merged commit 1f6cfb2 into develop Oct 23, 2026
4 checks passed
StuartBenjamin pushed a commit to StuartBenjamin/GPEC-1 that referenced this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants