You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stage: SIMPLE / canonical symplectic path (milestone M2) Source language: Fortran 2008 Manuals to read first:src/field/field_can_base.f90 (the field_can_t contract: A=(0,Ath,Aph), h=(0,hth,hph), Bmod, first/second derivatives); src/field/field_can_meiss.f90 (the construction this issue reuses per volume: angle transform lambda + gauge chi from radial ODE integration); src/field_can.f90 (field_can_from_id, init_field_can dispatch); derivation + computer-algebra verification in the companion repo (gitlab.tugraz.at/plasma/proj/spectre-orbits, ca/05_gc_canonical.wl, tex/). Depends on:#438
Goal
Symplectic guiding-center integration (integmode >= 1) works inside SPECTRE volumes via a per-volume Meiss construction. CORRECTED PREMISE (computer-algebra verified in spectre-orbits ca/05_gc_canonical.wl): SPECTRE's A_s = 0 gauge supplies only half of the canonical requirement; the covariant h_s does NOT vanish in SPECTRE coordinates (metric off-diagonals), so the phase-space 1-form keeps a rho_par B_s ds term. The Meiss angle transformation zeta_c with d_s lambda = -B_s/B_zeta plus gauge chi with d_s chi = (d_s lambda) A_zeta restores A'_s = 0 AND B'_s = 0; both identities and the flux-2-form consistency are machine-verified. What SPECTRE still buys over the generic Meiss path: analytic integrands (no source-field splining, exact derivatives from the Chebyshev/Zernike basis), and per-volume construction domains in which the field is smooth (a global chart would integrate the construction ODE through interface current sheets). Field-line tracing (#437) genuinely needs no construction.
Files to edit
src/field/field_can_meiss.f90: add a spectre_field_t arm to ah_cov_on_slice / init_canonical_field_components (currently closed to vmec_field_t/splined_field_t), and support a per-volume construction domain (r in [lvol-1, lvol] in the stacked chart) with one construction state per volume instead of the single global grid.
src/field_can.f90: new id SPECTRE dispatching to the per-volume Meiss data of the active volume; integ_to_ref/ref_to_integ identity within a volume.
src/simple_main.f90: admit the new id in the integmode > 0 guard.
test/tests/test_spectre_sympl_volume.py + test/field_can/ unit test: NEW.
DOC/coordinates-and-fields.md: extend section 6 with the SPECTRE per-volume Meiss entry (mandatory).
Behavior to implement
Per-volume Meiss construction at init: for each volume, radial ODE sweep for lambda and chi on a (r, theta, zeta) grid with integrands evaluated analytically from libneo's spectre primitives; spline the resulting canonical components per volume (existing 5-component batch-spline machinery).
Optional follow-up (document, do not implement): a no_K-style variant that drops rho_par h_s in SPECTRE coordinates directly, the same O(Larmor-radius) approximation as SIMPLE's Boozer use_B_r = .false.; exact per-volume Meiss is the reference path.
Acceptance scenarios (BDD)
Given the per-volume construction on the fixture equilibrium, then the transformed covariant components satisfy |A'_s| and |B'_s| below spline-interpolation tolerance on a verification grid (direct check of the construction, mirrors ca/05).
Given passing and trapped orbits in a single volume with integmode in {1, 3, 4}, then relative energy error is bounded and non-drifting over 1e5 steps.
Given an axisymmetric SPECTRE test file, then p_phi is conserved to near machine precision within a volume.
Given identical initial conditions, then symplectic and RK45 trajectories agree within tolerance-consistent bounds over a short trace.
Stage: SIMPLE / canonical symplectic path (milestone M2)
Source language: Fortran 2008
Manuals to read first:
src/field/field_can_base.f90(thefield_can_tcontract:A=(0,Ath,Aph),h=(0,hth,hph),Bmod, first/second derivatives);src/field/field_can_meiss.f90(the construction this issue reuses per volume: angle transform lambda + gauge chi from radial ODE integration);src/field_can.f90(field_can_from_id,init_field_candispatch); derivation + computer-algebra verification in the companion repo (gitlab.tugraz.at/plasma/proj/spectre-orbits,ca/05_gc_canonical.wl,tex/).Depends on: #438
Goal
Symplectic guiding-center integration (
integmode >= 1) works inside SPECTRE volumes via a per-volume Meiss construction. CORRECTED PREMISE (computer-algebra verified in spectre-orbitsca/05_gc_canonical.wl): SPECTRE'sA_s = 0gauge supplies only half of the canonical requirement; the covarianth_sdoes NOT vanish in SPECTRE coordinates (metric off-diagonals), so the phase-space 1-form keeps arho_par B_s dsterm. The Meiss angle transformationzeta_cwithd_s lambda = -B_s/B_zetaplus gaugechiwithd_s chi = (d_s lambda) A_zetarestoresA'_s = 0ANDB'_s = 0; both identities and the flux-2-form consistency are machine-verified. What SPECTRE still buys over the generic Meiss path: analytic integrands (no source-field splining, exact derivatives from the Chebyshev/Zernike basis), and per-volume construction domains in which the field is smooth (a global chart would integrate the construction ODE through interface current sheets). Field-line tracing (#437) genuinely needs no construction.Files to edit
src/field/field_can_meiss.f90: add aspectre_field_tarm toah_cov_on_slice/init_canonical_field_components(currently closed tovmec_field_t/splined_field_t), and support a per-volume construction domain (r in [lvol-1, lvol]in the stacked chart) with one construction state per volume instead of the single global grid.src/field_can.f90: new idSPECTREdispatching to the per-volume Meiss data of the active volume;integ_to_ref/ref_to_integidentity within a volume.src/simple_main.f90: admit the new id in theintegmode > 0guard.test/tests/test_spectre_sympl_volume.py+test/field_can/unit test: NEW.DOC/coordinates-and-fields.md: extend section 6 with the SPECTRE per-volume Meiss entry (mandatory).Behavior to implement
rho_g >= 1e-3; document.no_K-style variant that dropsrho_par h_sin SPECTRE coordinates directly, the same O(Larmor-radius) approximation as SIMPLE's Boozeruse_B_r = .false.; exact per-volume Meiss is the reference path.Acceptance scenarios (BDD)
|A'_s|and|B'_s|below spline-interpolation tolerance on a verification grid (direct check of the construction, mirrors ca/05).integmodein {1, 3, 4}, then relative energy error is bounded and non-drifting over 1e5 steps.p_phiis conserved to near machine precision within a volume.Success criteria
Non-goals
Verification
make test TEST=spectre_sympl_volume