Pair each analytic vacuum coefficient with the mode the caller supplies it for - #31
Open
CharlesCNorton wants to merge 1 commit into
Open
Conversation
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.
analysum2accumulates the analytic (tangent-plane) add-back intobvecandgrpmn. Mode (m, n) takestlp/slpand mode (m, -n) takestlm/slm, butanalytsupplies those arguments the other way round, so each mode is assembled from the coefficient computed for its toroidal mirror. This swaps the pairing to match what the caller passes.The same change in VMEC++ is proximafusion/vmecpp#825, which carries the coefficient-level comparison against an independent evaluation of the subtracted kernels.
PARVMEC pairs them the way this change does. Its
analyt.fcallsanalysum2with the arguments crossed relative to the dummy names declared inanalysum2.f, which has the same effect as the swap here, so after this change the two implementations agree.The pairing is decided by an exact case. A line of dipoles on the axis of a helically deformed torus has zero vacuum field on the surface, so whatever the vacuum solver reconstructs there is its error. PARVMEC 10.0 at master_dev gives a residual of 7e-6 with its pairing and 4.9e-3 with the pairing declared in
analysum2, and 4e-5 against 4.9e-3 in an asymmetric variant. The error is independent ofntheta,nzeta,mpolandntor, since it is in the analytic term rather than in the quadrature, and it vanishes on an axisymmetric surface where the metric cross terms are zero.On
fb/input.cth_like_free_bdythe equilibrium moves:ctestpasses.