Repository navigation
Commit a28d02e
authored
Keep the default near-axis regularization radius on rho-native charts (#616)
## Cause
Since b4778e4 the defaults of `orbit_timestep_axis` (`axis_floor` 1e-8,
`near_axis_limit` 0.01) are read in the native radial unit of the chart.
For flux-native charts this is a regularization disc of Cartesian radius
1e-4 and a near-axis zone of radius 0.1, but on rho-native REFCOORDS
charts the same numbers shrank to 1e-8 and 0.01. An orbit crossing the
axis at Cartesian radius of about 1e-6 then meets the raw
polar-to-Cartesian pullback outside the regularized disc, and the RK45
integration exhausts its step budget (`ierr = 2`, libneo odeint max
steps).
## Fix
The defaults are now defined in normalized toroidal flux s (1e-8, 0.01)
and converted to the native coordinate (rho = sqrt(s)) when
`axis_radial_coordinate` reports a rho chart, so both chart types keep
the same Cartesian disc. Explicit `axis_floor` / `near_axis_limit`
arguments stay in native units. The radial-coordinate query moves before
the argument validation, nothing else changes.
## Test
`check_default_axis_disc` in `test_magfie_refcoords_splines` (NCSX rho
chart): six orbits starting at rho 1e-8 and 1e-6 with three pitches, one
step through the axis with default arguments, compared with the same
orbit in 40 short steps with explicit native limits (1e-4, 0.1). Without
the fix all six default-argument steps return `ierr = 2`; with it they
agree to about 1e-13.
Verified on macOS (Release, gfortran 16):
`test_magfie_refcoords_splines`, `test_axis_regular_rhs` and `ctest -R
'refcoords|axis|chartmap|orbit'` pass except four Python tests that need
numpy/netCDF4 missing on that host. The golden record has not been run.
Chris&AI1 parent b09d279 commit a28d02e
2 files changed
Lines changed: 60 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
904 | 910 | | |
905 | 911 | | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
906 | 916 | | |
907 | 917 | | |
908 | 918 | | |
| |||
912 | 922 | | |
913 | 923 | | |
914 | 924 | | |
915 | | - | |
916 | | - | |
917 | 925 | | |
918 | 926 | | |
919 | 927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
234 | 284 | | |
235 | 285 | | |
236 | 286 | | |
| |||
0 commit comments