Skip to content

Fix plasma-side virtual-casing initialization and periodic mirroring - #234

Draft
krystophny wants to merge 2 commits into
PrincetonUniversity:masterfrom
itpplasma:fix/free-boundary-initialization
Draft

krystophny wants to merge 2 commits into
PrincetonUniversity:masterfrom
itpplasma:fix/free-boundary-initialization

Conversation

@krystophny

Copy link
Copy Markdown
Collaborator

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

…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

No deployments
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.

1 participant