Skip to content

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

Merged
krystophny merged 1 commit into
masterfrom
fix/free-boundary-initialization
Oct 23, 2026
Merged

krystophny merged 1 commit into
masterfrom
fix/free-boundary-initialization

Conversation

@krystophny

@krystophny krystophny commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

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.

Verified final integration f59825d: Slurm 3361820 completed a native CMake build and both analytic CTests, and two consecutive configure operations left every source file unchanged. Slurm 3361834 passed the full two-case resident Gremlin gate, generation 88041b8524e47c290baf1a33bd7a15bc04946fa4f9ee1d0e8c0ee2a2ed522ca9 (local gate green and fully verified). The existing four native reference comparisons also pass at unchanged tolerances for the identical computational Fortran source. The companion generated-source path fix is tracked separately in upstream PR PrincetonUniversity#235. No production equilibrium acceptance is inferred.

Chris&AI

@krystophny
krystophny marked this pull request as ready for review October 23, 2026 20:44
@krystophny
krystophny merged commit d390088 into master Oct 23, 2026
krystophny added a commit that referenced this pull request Oct 25, 2026
…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.
krystophny added a commit that referenced this pull request Oct 26, 2026
…ield (#3)

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