Fix JOREK right-end basis orientation#393
Open
krystophny wants to merge 1 commit into
Open
Conversation
krystophny
force-pushed
the
fix/jorek-right-end-basis
branch
from
July 17, 2026 11:26
e663de5 to
861622a
Compare
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
3 u^2 (1-u)and its derivativeJOREK
units, and field conventions
The previous right-end basis was
-3 u^2 (1-u). JOREK restart files alreadystore negative scale factors at the right endpoint. Applying both signs
reversed the physical tangent there and folded otherwise regular element maps.
Downstream relation
GORILLA PR 72 builds its
poloidal plane from this geometry evaluator. With the old basis, refinement
near the lower X-point appeared to require a special overlap-removal cavity.
With this fix, the ordinary factor-2 plane covers the full sampled domain with
no holes or overlaps. GORILLA should therefore update its pinned libneo commit
and its golden fixtures after this PR, without adding the cavity workaround.
Verification
Test fails on main
The failing fixture uses the signed endpoint scales from a JOREK restart. It
reports mismatches in the basis, affine map, Jacobian, shared-edge tangent,
and inverse location with the old basis.
Test passes after fix
Representative restart screen
The geometry Jacobian was sampled on a 9 by 9 grid in each of 12 connected
elements around an X-point. Before the fix every element changed sign, with
24 to 30 negative samples per element. After the fix all 972 samples are
positive; the minimum determinant is
1.9552628002463977e-4.The downstream four-phase field screen contains 769,792 samples. At factor 2
it now reports zero holes, zero overlaps, zero recovered samples, and a maximum
relative field error of
1.556711e-3.