Repository navigation
ForceFreeStates - BUGFIX! - Snap the periodic theta endpoint before integrating GGJ geometry - #439
Conversation
…ntegrating GGJ geometry
|
This pull request is missing an assignee. If you are not ready to name them, mark this pull request as a draft. |
matt-pharr
left a comment
There was a problem hiding this comment.
@adrianaghiozzi Looks reasonable, but the comments are not really necessary, are they? The git blame will still point to this pr with reasoning. At most if you really think this needs comments, one curt line suffices
|
@matt-pharr Verbose Claude comments strike again lol I just shortened them in cefa010 |
|
Gonna just ping @logan-nc as I'm sure Matt has been busy getting settled in in France! This is a simple bug fix that Matt already reviewed and should be ready to merge. It's a bug that impacts a few of the workflows I use frequently for Next Step Fusion so it would be great to get it merged whenever someone has a chance :) |
|
looks good. I approve |
Release note
resist_geometry(ResistEval.jl) andresist_eval(Resist.jl) build the GGJtheta-integrand independently at each theta node, including both periodic
endpoints, then integrate with
cubic_interp(...; bc=PeriodicBC()). The twoendpoint evaluations can differ by machine epsilon, which a stricter
PeriodicBC(endpoint=:inclusive)validator now rejects outright, abortingforce-free-state prep on some equilibria (mine hit it via a DIII-D case
driven from TokToxStability).
What
Snap
ff[end, :] .= ff[1, :]right before eachcubic_interpcall, in bothForceFreeStates/Surfaces/ResistEval.jland the siblingForceFreeStates/Surfaces/Resist.jl(same GGJ-integrand pattern, same latentbug -- not yet observed in the wild but a spot check shows it will trip the
same way on the right input).
This mirrors the fix already in
Equilibrium.jl's GS-residual integrator:Context
endpoint closure at the data-construction site, not
check=false) wasapplied everywhere in PR FastInterpolations bump and fix #243 except
ForceFreeStates/Surfaces/.periodicity issue (KineticForces: preserve periodic vpar spline and enumerate bounce roots exactly #341, KineticForces - BUGFIX! - Fit the parallel-velocity spline periodically #390) -- that's a different spline (
tspl/vparin
Torque.jl/BounceAveraging.jl), not the GGJ geometry integrand here.Regression report
Also ran the existing
test/runtests_resist_eval.jlsuite: 63/63 passed.Notes for reviewers
No behavior change expected or observed -- this only prevents a false-positive
validator abort on machine-epsilon endpoint drift, matching the fix pattern
already established for #240.