boozer_sub: VMEC<->Boozer angle transforms#311
Open
krystophny wants to merge 2 commits into
Open
Conversation
Port the angle-transform machinery from the SIMPLE converter into libneo's boozer_sub: delthe_delphi_BV, vmec_to_boozer, and the Newton inverse boozer_to_vmec. compute_boozer_data now fills delt_delp_V_grid (theta_B-theta_V and phi_B-phi_V on the VMEC-angle grid) unconditionally and delt_delp_B_grid on the Boozer-angle grid behind use_del_tp_B. build_boozer_delt_delp_batch_splines constructs the descriptors. Existing splint outputs and perqua rows are unchanged. Add test_boozer_angle_roundtrip pinning round-trip invertibility of the forward and inverse transforms.
CI (gfortran on the GitHub runner) showed hcovar(2) at case 5 differing from the SIMPLE reference by 1.07e-11 on a ~1e-5 value (rel 1.06e-6), just over the 1e-6/1e-11 thresholds, while it passes locally. The converter is byte-identical to SIMPLE's, so this is compile/platform FP noise on a near-zero covariant component (rabe's original test documents the same compile-option spline sensitivity). Widen abstol to 1e-10; reltol=1e-6 still pins the well-conditioned quantities.
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
Second PR in the hub-and-spoke converter consolidation (stacked on #310). Ports SIMPLE's VMEC<->Boozer angle-transform machinery into libneo's
boozer_sub, so the converter can map between VMEC and Boozer angles in both directions. The chartmap export spoke (next PR) needsboozer_to_vmec.Scope (additive)
delt_delp_V_grid/delt_delp_B_gridarrays +delt_delp_V/Bbatch-spline descriptors and ready flags (libneosavestyle, not SIMPLE's GPU/allocatable path).delthe_delphi_BV,vmec_to_boozer,boozer_to_vmec(Newton, niter=100, epserr=1e-14),build_boozer_delt_delp_batch_splines(called fromget_boozer_coordinates_impl, freed inreset_boozer_batch_splines).compute_boozer_datafills the V grid unconditionally (needed by the forward/backward maps) and the Boozer-angle B grid only whenuse_del_tp_B(default.false.). Existing perqua rows, splint outputs and numeric behavior are unchanged.vmec_to_boozer,boozer_to_vmec,delthe_delphi_BV.vmec_field; no SIMPLEfield/vmec_field_eval/GPUboozer_stateintroduced.Verification
Independently rebuilt from the committed branch and run with the LandremanPaul2021 QA wout:
test_boozer_converter_vs_simple) stays green: behavior is byte-unchanged.test_boozer_angle_roundtrippins invertibility (a previously-untested gap):vmec_to_boozerthenboozer_to_vmecrecovers(theta, varphi)to < 1e-10 (modulo periodicity), and the reverse, at s in {0.2, 0.5, 0.8} for several angle pairs.