Skip to content

Add GVEC QA Boozer chartmap validation#334

Open
krystophny wants to merge 16 commits intomainfrom
feature/boozer-chartmap-gvec-qa
Open

Add GVEC QA Boozer chartmap validation#334
krystophny wants to merge 16 commits intomainfrom
feature/boozer-chartmap-gvec-qa

Conversation

@krystophny
Copy link
Copy Markdown
Member

@krystophny krystophny commented Mar 28, 2026

Summary

Add GVEC QA comparison path on top of the real-Cartesian Boozer chartmap contract, with cleaned-up test infrastructure and GVEC documentation.

Production code (14 lines in src/boozer_converter.F90):

  • Apply vmec_B_scale and vmec_RZ_scale to chartmap field data after loading from NetCDF

Test infrastructure:

  • GVEC-to-Boozer-chartmap conversion for the shared QA case
  • Strict roundtrip comparison against external GVEC chartmap
  • End-to-end QA benchmarking (QA, QH, NCSX equilibria)
  • Figure-8 stellarator golden record test
  • Chartmap scaling unit test
  • De-duplicated test helpers (run_cmd, plot utilities) into shared artifacts module
  • Fixed double test_chartmap_scaling registration in CMakeLists.txt

Documentation:

  • GVEC Boozer chartmap workflow section in README
  • Example simple_chartmap.in configuration for chartmap mode
  • Reference to tools/gvec_to_boozer_chartmap.py conversion tool
  • Polished examples and README quickstart (cherry-picked from Polish examples and README quickstart #342)

Verification

All tests pass (52/52)

$ make CONFIG=Fast && make test
100% tests passed, 0 tests failed out of 52

Label Time Summary:
chartmap         =   0.10 sec*proc (1 test)
golden_record    =   6.32 sec*proc (1 test)
integration      = 312.46 sec*proc (18 tests)
performance      =   1.12 sec*proc (2 tests)
plot             = 315.41 sec*proc (7 tests)
python           = 532.90 sec*proc (9 tests)
slow             = 773.22 sec*proc (9 tests)
system           =  28.67 sec*proc (3 tests)
unit             =  44.49 sec*proc (12 tests)

Total Test time (real) = 912.88 sec

Test plan

  • make test-fast passes (41/41 tests)
  • make test passes (52/52 tests including slow)
  • De-duplicated test helpers maintain identical behavior
  • Python syntax validation on all modified test files
  • README GVEC section documents complete workflow
  • Example simple_chartmap.in matches test-verified configuration

Base automatically changed from feature/boozer-chartmap-realcart to main March 28, 2026 17:38
@krystophny krystophny force-pushed the feature/boozer-chartmap-gvec-qa branch from 3a42c9b to fbd730d Compare March 28, 2026 18:07
@krystophny krystophny force-pushed the feature/boozer-chartmap-gvec-qa branch from 08e0b6d to 4b1c23a Compare April 14, 2026 20:56
@krystophny krystophny enabled auto-merge (squash) April 14, 2026 21:41
@krystophny krystophny force-pushed the feature/boozer-chartmap-gvec-qa branch from ef9944e to 55b136f Compare April 16, 2026 11:56
@krystophny krystophny changed the title test: validate GVEC QA Boozer chartmaps Add GVEC QA Boozer chartmap validation Apr 16, 2026
## Summary

Add the full GVEC and real-Cartesian Boozer chartmap layer on top of the
VMEC validation stack.

This PR now absorbs the old top PR 327. The real-Cartesian contract
belongs here, because this is the first layer where the generalized
non-cylindrical Boozer toroidal parameter actually matters end to end.

This layer adds:

- GVEC state -> Boozer chartmap NetCDF conversion
- real-Cartesian `x,y,z` export for the Boozer grid instead of the
earlier pseudo-Cartesian embedding
- `zeta_convention='boozer'` fixtures and refreshed QA/figure-8
chartmaps on that contract
- QA common-case VMEC/GVEC comparison on the shared chartmap path
- figure-8 QUASR/GVEC golden validation and reviewer plots
- benchmark/artifact helpers used by the end-to-end GVEC coverage
- CI installation of `gvec` for the slow GVEC-backed Python tests

## Stack

- base: `feature/boozer-chartmap-qa`
- head: `feature/boozer-chartmap-gvec`

## Validation scope in this PR

- shared QA case across:
  1. direct VMEC Boozer
  2. VMEC-exported Boozer chartmap
  3. GVEC-exported Boozer chartmap
- figure-8 QUASR -> GVEC -> Boozer chartmap -> SIMPLE golden validation

## Review

Primary GVEC/QUASR review: @Rykath
SIMPLE-maintainer follow-up: @krystophny
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant