feat: add SIMPLE Boozer chartmap core path#329
Merged
krystophny merged 9 commits intomainfrom Mar 28, 2026
Merged
Conversation
Member
Author
|
Routing this one to @krystophny for SIMPLE core/runtime review. This is the non-GVEC base layer of the stack. |
…nput Add boozer_chartmap_field_t that reads an extended chartmap NetCDF file serving as both reference coordinates (geometry) and Boozer field input for the symplectic integrator, with no VMEC or GVEC library dependencies. The extended chartmap adds A_phi(rho), B_theta(rho), B_phi(rho), Bmod(rho,theta,phi), and torflux to the standard chartmap format. Detection is via a boozer_field=1 global attribute. For the symplectic path, load_boozer_from_chartmap populates the existing module-level batch splines in boozer_converter.F90 from file data, so splint_boozer_coord and eval_field_booz work unchanged. WIP: test still failing on libneo chartmap validation.
- evaluate() now takes x(1)=rho (matching chartmap coordinate system) instead of x(1)=s, with internal rho-to-s conversion for A_phi spline - Add direct-evaluation fast path in field_splined.f90 for boozer_chartmap_field_t, avoiding unnecessary Cartesian roundtrip - Store num_field_periods as a scalar NetCDF variable (not attribute) to match libneo chartmap validator expectations - Fix test to use rho coordinates
The Boozer integrator uses s as the radial coordinate, but chartmap reference coordinates use rho = sqrt(s). The identity transform was wrong — particles at rho=0.55 (s=0.3) were being integrated at s=0.55, causing spurious losses. Add integ_to_ref_boozer_chartmap (s -> rho) and ref_to_integ_boozer_chartmap (rho -> s) transforms. E2E test now shows exact match in total confined fraction between VMEC-Boozer and chartmap-only paths.
The passing/trapped classification needs bmin and bmax from field line tracing (init_starting_surf). In chartmap mode this was skipped, leaving bmin=bmax=0 and producing garbage classification. Fix: call init_magfie(BOOZER) first to set up magfie_boozer (which works with the chartmap splines), then call init_starting_surf normally. E2E test now shows exact match in total, passing, AND trapped fractions.
319f478 to
bd69ace
Compare
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.
Summary
Add the core SIMPLE-side Boozer chartmap file path so
simple.xcan consume file-backed Boozer fields and coordinates without VMEC at runtime.This stack layer covers the core abstractions only:
rho <-> shandling on the Boozer chartmap pathWhy this split
This is the lowest SIMPLE layer in the stack. It does not bring in GVEC-specific generation or the heavier end-to-end benchmarks yet.
Stack
mainfeature/boozer-chartmap-coreReview
Primary SIMPLE-maintainer review: @krystophny