Carry the Jacobian sign in the Mercier volume derivative - #795
Open
CharlesCNorton wants to merge 3 commits into
Open
Carry the Jacobian sign in the Mercier volume derivative#795CharlesCNorton wants to merge 3 commits into
CharlesCNorton wants to merge 3 commits into
Conversation
Contributor
Author
|
Checked independently against the |
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.
ComputeMercierStabilityforms the volume derivative of the first table as the plain half-grid average ofvp_real.mercier.f90:191forms it asand then writes
shear(i)/sqsas SHEAR,sqsitself as VP,ip(i)/sqsas ITOR' andpresp(i)/sqsas PRES'. The Jacobian sign is therefore carried by all four columns, not only by WELL, which VMEC++ already scales by it at the same site.With the usual negative Jacobian, which is every bundled case, those four columns come out negated. Measured against the
mercier.<case>file educational_VMEC writes, the ratio is -1 to the five significant figures the file carries, on every case, while WELL, IOTA, S, PHI, PRES and ITOR agree:Comparing every column of both Mercier tables against that file across the bundled cases, nine go from four differing columns to all fifteen agreeing:
solovev,solovev_no_axis,solovev_analytical,cth_like_fixed_bdy,cth_like_fixed_bdy_iota,cth_like_fixed_bdy_nzeta_37,cth_like_fixed_bdy_spline_pressure,cth_like_free_bdyandli383_low_res. What still differs elsewhere is unrelated to this change:cmacarries no current, so its ITOR and ITOR' are round-off around 1e-10; the asymmetric cases differ by thetmultnormalisation; andup_down_asymmetric_tokamaksits in a different poloidal gauge.The second table is unaffected, since
Dshear,Dcurr,DwellandDgeodare built from the intermediates rather than from this quantity.CheckMercierStabilitycould not see this. It reproduces the same unsigned average in the test and asserts the first table against it, so the test and the implementation agree with each other and both differ from the reference. The test now appliessign_of_jacobianwhere it already reads it for the WELL comparison.Nothing outside the output stage reads these fields.
//vmecpp_large_cpp_tests/vmec/output_quantities:output_quantities_testpasses 84 tests, including the six cases ofMercierStabilityTest.