GVEC QA Boozer chartmap validation#334
Open
krystophny wants to merge 21 commits into
Open
Conversation
3a42c9b to
fbd730d
Compare
08e0b6d to
4b1c23a
Compare
- Remove duplicate test_chartmap_scaling registration in CMakeLists.txt - Extract run_cmd() to boozer_chartmap_artifacts.py (was duplicated in test_e2e and test_figure8) - Make private plot helpers public in artifacts (close_curve, close_surface_toroidally, sample_indices, set_equal_3d_limits) and import them in test_figure8 instead of redefining locally - Extract _compare_and_summarize() from run_single_equilibrium to improve readability
- Add "Boozer Chartmap Mode" section to README documenting the GVEC workflow: convert with gvec_to_boozer_chartmap.py, configure with field_input/coord_input, run as usual - Add examples/simple_chartmap.in as a commented starting point for chartmap-mode runs - Reference DOC/coordinates-and-fields.md for full coordinate details
0433f16 to
8beab16
Compare
krystophny
added a commit
that referenced
this pull request
Jun 3, 2026
## Summary Fix the Boozer chartmap radial contract end to end. Changes: - `A_phi`, `B_theta`, `B_phi`, and `Bmod` are read on the chartmap `rho` grid. Radial derivatives are converted to `s = rho^2` by chain rule. - Chartmap files now carry and restore `rmajor`; both chartmap field consumers use `boozer_chartmap_io.read_boozer_chartmap`. - `Bmod` is read on the endpoint-included `theta_field`/`zeta_field` grid. - Chartmap startmode=1 now stores sampled starts in reference coordinates. The tracer returns integrator coordinates `(s, theta_B, phi_B)`; chartmap `zstart` stores `(rho, theta_B, phi_B)`, so `sbeg=0.5` now writes `rho=sqrt(0.5)`. - Chartmap `generate_start_only` now stops after writing corrected starts instead of tracing orbits. - Grid starts use the same conversion, and their linear index stride is fixed. - Duplicate chartmap diagnostics were removed. The synthetic `test_chartmap_aphi_abscissa` now covers reader metadata and the analytic `A_phi(rho)` chain-rule contract. - Chartmap tolerances were tightened to measured floors. The roundtrip `Bmod` floor is the current export resolution, about `7.90e-5`; the orbit floor is about `1.68e-9`. Closes #358 and fixes the chartmap `sbeg` issue tracked in #359. ## Stack Base: `main`. Merge order: 1. Merge this PR first. 2. Restack #334 after this PR. Do not merge #334 as it stands; its branch is based before several commits that are already on `main` and before this fix. Already on `main`: #329, #332, #333, #338, #340, #346, #348, #355, and the Boozer flux-sign doc commit. ## Verification ### Test fails before the start-sampling fix ``` $ OMP_NUM_THREADS=1 ctest --test-dir build -R '^test_chartmap_startmode1$' --output-on-failure -j1 AssertionError: chartmap startmode=1 wrote s instead of rho 0% tests passed, 1 tests failed out of 1 ``` ### Tests pass after the fix ``` $ cmake --build build --target simple.x -j2 [25/26] Linking Fortran executable simple.x ``` ``` $ OMP_NUM_THREADS=1 ctest --test-dir build -R '^test_chartmap_startmode1$' --output-on-failure -j1 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 3.96 sec ``` ``` $ OMP_NUM_THREADS=1 ctest --test-dir build -R '^test_chartmap_aphi_abscissa$|^test_boozer_chartmap$|^test_chartmap_scaling$|^test_boozer_chartmap_roundtrip$|^test_chartmap_startmode1$' --output-on-failure -j1 100% tests passed, 0 tests failed out of 5 Total Test time (real) = 8.43 sec ``` ``` $ OMP_NUM_THREADS=1 ctest --test-dir build -R '^test_chartmap_pipeline$|^test_chartmap_rz_consistency$|^test_coord_transform_roundtrip$' --output-on-failure -j1 100% tests passed, 0 tests failed out of 3 Total Test time (real) = 94.36 sec ``` ``` $ OMP_NUM_THREADS=1 ctest --test-dir build -R '^test_e2e_boozer_chartmap$' --output-on-failure -j1 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 102.43 sec ``` ``` $ check-writing-slop.py test/tests/test_chartmap_startmode1.py PASS: no writing-slop candidates at threshold medium ``` ### External W7X/GVEC reruns Run with `OMP_NUM_THREADS=1` using the rebased `fix/chartmap-aphi-rho-abscissa` build. These cases do not use `generate_start_only`, so they were not rerun after `cf3ff9e`. ``` W7X/vmec/simple-s1-p4k: final confined_fraction.dat line: 1.0000000000000000E-003 0.67993164062500000 1.4648437500000000E-003 4096 W7X/vmec2gvec/simple-f1-n50/s316-p1k: final confined_fraction.dat line: 9.9999999999999980E-004 0.64746093750000000 1.0742187500000000E-002 1024 start.dat radial min=max=0.56213877290220782 = sqrt(0.316) W7X/vmec2gvec/simple-f1-n50/s317-p1k: final confined_fraction.dat line: 9.9999999999999980E-004 0.64843750000000000 4.8828125000000000E-003 1024 start.dat radial min=max=0.5630275304103699 = sqrt(0.317) ```
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
GVEC QA branch for Boozer chartmap validation after #360. The branch is now restacked on
mainat171c998and keeps the remaining GVEC converter, QA, fixture, anddocumentation work.
Current contracts in this branch:
A_phiis tabulated on the file rho grid and chain-ruled toson readback.rmajor; the reader restores it beforeparameter initialization so VMEC and chartmap runs use the same
dtauminandntau.rmajorand compares the VMEC/chartmapmicrostep directly.
gvec.contracts: reader metadata,
A_phiabscissa, start-mode sampling, scaling, roundtrip,and selected e2e equilibria.
Stack
Merge order is now:
main.Already on
mainbefore this branch:sbegstart-sampling fixes (boozer chartmap: fix rho-grid fields and start sampling #360)Verification
Failing before data refresh:
Passing after pulling the external figure8 LFS files:
The long e2e test passed before the external LFS-pointer failure stopped the first
focused run:
The default build Python on this machine does not provide
gvec, sotest_boozer_chartmap_gvec_qais not registered in this local CTest configuration.