Skip to content

Allow operation with non-stellarator-symmetric vmec files#13

Merged
krystophny merged 2 commits into
itpplasma:masterfrom
landreman:lasym
Nov 16, 2021
Merged

Allow operation with non-stellarator-symmetric vmec files#13
krystophny merged 2 commits into
itpplasma:masterfrom
landreman:lasym

Conversation

@landreman
Copy link
Copy Markdown
Contributor

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 for lasym=.true.

@krystophny
Copy link
Copy Markdown
Member

@landreman this looks great, thanks very much!

@krystophny krystophny merged commit 3fd4655 into itpplasma:master Nov 16, 2021
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
```
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.

2 participants