Repository navigation
Fix plasma-side virtual-casing initialization and periodic mirroring - #234
Draft
krystophny wants to merge 2 commits into
Draft
krystophny wants to merge 2 commits into
krystophny wants to merge 2 commits into
Conversation
…ield For Nz=1, bnorml evaluates only theta indices 0..(Nt+1)/2 and relies on the stellarator-symmetry mirror to fill the rest of the row. Fork PR #1 (d390088) replaced the mirror by mirror_normal_field, whose toroidal loop is empty for Nz=1, so the upper half of the row kept stale values. This changed the free-boundary regression cases G3V08L3Fr and G3V08L3FrGrid (Ntor=0), e.g. Rij average difference 0.40 at tol 1e-10. mirror_normal_field now fills theta index jj > (Nt+1)/2 with -field(Nt-jj) for Nz=1. Unlike the upstream branch, it does not negate the computed theta=pi sample. The symmetry unit test now poisons exactly the samples bnorml does not evaluate, which fails without this change. Oracle independent of the references: a build that evaluates every grid point by brute force (Nzwithsym=Nz, no Nz=1 skip, no mirroring) reproduces the existing G3V08L3Fr and G3V08L3FrGrid references within 1e-10, as does this fix, so the references stay unchanged. All 8 CI reference cases pass with -std=legacy.
This branch has not been deployed
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.
The first free-boundary virtual-casing evaluation mixed the plasma-side vector potential with the vacuum radial map. The asymmetric path also read vacuum coefficients, while stellarator-symmetry completion advanced the theta=0 sample into the wrong toroidal row.
The change consistently uses the plasma-side coefficients and radial metric during initialization, then completes the odd normal field using periodic indices. Subsequent vacuum-side evaluations retain their existing path.
What to review: the surface-current initialization, periodic mirror, and two synthetic analytic CTest fixtures. No experimental input or campaign output is included.
Verified: both native analytic CTests pass. The four existing G1V03L0Fi, G1V03L3Fi, G2V32L1Fi and G3V08L3Fi reference comparisons pass their unchanged tolerances (1e-12, or 1e-10 for G3V08L3Fi). The compiled snapshot matches all 58 tracked source/test files at cc78304, with the two native generated sources recorded separately. These checks establish the repaired code paths, without claiming physical convergence of a production equilibrium.
Chris&AI