Skip to content

Equilibrium - BUGFIX - Support original and rho grids for inverse equilibria - #523

Merged
matt-pharr merged 1 commit into
developfrom
bugfix/inverse-original-rho-grids
Oct 13, 2026
Merged

matt-pharr merged 1 commit into
developfrom
bugfix/inverse-original-rho-grids

Conversation

@StuartBenjamin

Copy link
Copy Markdown
Collaborator

Release note

  • Audience: users
  • Numerical impact: none for runs that worked before (solovev_n1 unchanged); grid_type = "original" and "rho" errored before for inverse equilibria (harness @ b182bbf)
  • Migration: none

Inverse equilibria (CHEASE, LAR) now accept grid_type = "original" (the input file's own ψ nodes) and "rho" (uniform in √ψ).

Regression report

regress --cases solovev_n1 --refs bfc60610e,b182bbf68 (develop vs this head; julia 1.11.7, pinned manifest, 2 threads). No harness case uses an inverse equilibrium on these grids.

================================================================
Case: solovev_n1 — Solovev analytical equilibrium, n=1, ideal stability
================================================================

Regression Report: solovev_n1
=================================================================================
Ref 1: bfc60610e  @ bfc60610e (2026-10-09)
       env: julia 1.11.7, x86_64-linux-gnu, manifest fdfdedfa (pinned), 2 threads/2 BLAS, jit build
Ref 2: b182bbf68  @ b182bbf68 (2026-10-13)
       env: julia 1.11.7, x86_64-linux-gnu, manifest fdfdedfa (pinned), 2 threads/2 BLAS, jit build
---------------------------------------------------------------------------------
Quantity                      bfc60610e        b182bbf68        Diff       Status
---------------------------------------------------------------------------------
total energy Re(et[1])        3.429538e-01     3.429538e-01     0.0e+00    OK    
total energy Im(et[1])        -7.747105e-06    -7.747105e-06    0.0e+00    OK    
plasma energy Re(ep[1])       -1.005916e+01    -1.005916e+01    0.0e+00    OK    
vacuum energy Re(ev[1])       1.040211e+01     1.040211e+01     0.0e+00    OK    
vacuum matrix min eigenvalue  2.171292e+00     2.171292e+00     0.0e+00    OK    
plasma energy (all)           [32 elem]        [32 elem]        0.0e+00    OK    
vacuum energy (all)           [32 elem]        [32 elem]        0.0e+00    OK    
total energy (all)            [32 elem]        [32 elem]        0.0e+00    OK    
ODE steps (saved)             409              409              0.0e+00    OK    
ODE steps (total)             407              407              0.0e+00    OK    
q0                            1.900006e+00     1.900006e+00     0.0e+00    OK    
q95                           3.147422e+00     3.147422e+00     0.0e+00    OK    
beta_t                        4.621020e-02     4.621020e-02     0.0e+00    OK    
beta_n                        3.215791e+00     3.215791e+00     0.0e+00    OK    
# singular surfaces           2                2                0.0e+00    OK    
singular psi locations        [2 elem]         [2 elem]         0.0e+00    OK    
singular q values             [2 elem]         [2 elem]         0.0e+00    OK    
mpert                         32               32               0.0e+00    OK    
npert                         1                1                0.0e+00    OK    
q profile (checksum)          90ffc338a738...  90ffc338a738...  identical  OK    
pressure profile (checksum)   5040338aec07...  5040338aec07...  identical  OK    
ca_left (checksum)            6f1c35be5425...  6f1c35be5425...  identical  OK    
Runtime (s)                   208.6s           208.0s                      --    
=================================================================================
Summary: 22 unchanged

Notes for reviewers

  • original set mpsi but never built the ψ grid, so the run stopped with an undefined-variable error. It now uses the input's own ψ nodes, without the axis node if the file has one (a ψ = 0 surface has no geometry). psilow and mpsi are ignored; psihigh still sets psilim, as in Fortran. No minimum node spacing is applied.
  • rho was rejected as "Unsupported grid_type". It is uniform in √ψ from psilow to psihigh: ψᵢ = (√psilow + (√psihigh − √psilow)·i/mpsi)², i = 0…mpsi. Fortran's rho ignores psilow; here it honours psilow like the other grids.
  • Test "Inverse grid types (original, rho)" in test/runtests_equil.jl, on the CHEASE test file INP1_binary: the original grid equals the file's nodes off the axis, the rho grid runs from psilow to psihigh, and every spline is finite for both. runtests_equil.jl: 299/299 pass.
  • Replaces Equilibrium - BUGFIX - Support original and rho grids for inverse equilibria #521, without its axis-extrapolation code: psilow is always > 0, and the original grid now skips the axis node instead.
  • Equilibrium - FEATURE - Read inverse i-files (ldp_i) such as TokaMaker save_ifile output #511 edits nearby lines in equilibrium_solver; whichever lands second may need a small rebase.

🤖 Generated with Claude Code

…ilibria

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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.

This looks fine, I will merge it

@matt-pharr
matt-pharr merged commit 84a9a0e into develop Oct 13, 2026
13 checks passed
@matt-pharr
matt-pharr deleted the bugfix/inverse-original-rho-grids branch October 13, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something was wrong and now is not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants