Allow operation with non-stellarator-symmetric vmec files#13
Merged
Conversation
Member
|
@landreman this looks great, thanks very much! |
krystophny
added a commit
that referenced
this pull request
Apr 16, 2026
Closes #339. ## Summary - allow Boozer chartmap runs to use the normal particle sampler with `startmode = 1` - add a generated-fixture regression that runs `simple.x` end to end in chartmap mode - verify deterministic chartmap sampling writes fresh `start.dat` content instead of reusing a stale file ## Verification ### Test fails on main ```bash $ cmake -S . -B build -G Ninja $ cmake --build build -j$(nproc) --target simple.x generate_test_boozer_chartmap $ rm -rf /tmp/chartmap-startmode1-mre $ mkdir -p /tmp/chartmap-startmode1-mre $ ln -s "$PWD/build/test/tests/test_boozer_chartmap.nc" /tmp/chartmap-startmode1-mre/test_boozer_chartmap.nc $ cat > /tmp/chartmap-startmode1-mre/simple.in <<'EOCFG' &config trace_time = 1d-6 ntimstep = 2 ntestpart = 1 field_input = 'test_boozer_chartmap.nc' coord_input = 'test_boozer_chartmap.nc' isw_field_type = 2 startmode = 1 integmode = 1 relerr = 1d-10 / EOCFG $ (cd /tmp/chartmap-startmode1-mre && "$PWD/build/simple.x") INFO: Boozer chartmap field loading completed INFO: Canonical field initialization completed ERROR STOP Boozer chartmap requires startmode=2 (load particles from start.dat) ``` ### Test passes after fix ```bash $ ctest --test-dir /tmp/simple-chartmap-startmode-one/build -R '^(generate_test_boozer_chartmap_data|test_boozer_chartmap|test_chartmap_startmode1)$' --output-on-failure Test project /tmp/simple-chartmap-startmode-one/build Start 10: generate_test_boozer_chartmap_data 1/3 Test #10: generate_test_boozer_chartmap_data ... Passed 0.13 sec Start 11: test_boozer_chartmap 2/3 Test #11: test_boozer_chartmap ................. Passed 0.40 sec Start 12: test_chartmap_startmode1 3/3 Test #12: test_chartmap_startmode1 ............. Passed 10.21 sec 100% tests passed, 0 tests failed out of 3 ``` ```bash $ ctest --test-dir /tmp/simple-chartmap-startmode-one/build -R '^(test_chartmap_metadata|test_boozer_chartmap_roundtrip|test_refcoords_file_detection|test_field_equivalence_chartmap|test_chartmap_pipeline|test_chartmap_rz_consistency)$' --output-on-failure Test project /tmp/simple-chartmap-startmode-one/build Start 9: test_chartmap_metadata 1/6 Test #9: test_chartmap_metadata ............ Passed 0.15 sec Start 13: test_boozer_chartmap_roundtrip 2/6 Test #13: test_boozer_chartmap_roundtrip .... Passed 12.81 sec Start 25: test_refcoords_file_detection 3/6 Test #25: test_refcoords_file_detection ..... Passed 0.88 sec Start 26: test_field_equivalence_chartmap 4/6 Test #26: test_field_equivalence_chartmap ... Passed 94.54 sec Start 27: test_chartmap_pipeline 5/6 Test #27: test_chartmap_pipeline ............ Passed 24.58 sec Start 28: test_chartmap_rz_consistency 6/6 Test #28: test_chartmap_rz_consistency ...... Passed 20.65 sec 100% tests passed, 0 tests failed out of 6 ```
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.
In this pull request I've attempted to modify SIMPLE so non-stellarator-symmetric vmec wout files can be used. For stellarator-symmetric wout files, the changes in this pull request do not change the results in
confined_fraction.dat. It would be good to do other tests to confirm that the orbits are correct in detail forlasym=.true.