-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VMEC,SurfaceRZFourier] fix inconsistency regarding mpol #437
base: master
Are you sure you want to change the base?
Conversation
Hi, to add to @jons-pf 's comment, some examples of inconsistencies. When the indata file contains RBC/ZBS Fourier coefficients for
|
# VMEC only considers poloidal modes up to `m=(mpol-1)`, | ||
# but `SurfaceRZFourier` includes `m=mpol`. | ||
# Here, `xm` comes from VMEC and `mpol` goes into `SurfaceRZFourier`. | ||
mpol = int(np.max(xm)) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this -1 should be here. mpol here is SurfaceRZFourier's mpol, so it should equal the maximum m.
for m in range(mpol_capped + 1): | ||
# The highest mode number that VMEC can use is `m=100` | ||
# if the max resolution is `mpol=101`. | ||
for m in range(mpol_capped): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem correct to remove the +1 here. mpol_capped is essentially mpol of a SurfaceRZFourier object (via boundary_RZFourier = self.boundary.to_RZFourier()
and mpol_capped = np.min([boundary_RZFourier.mpol, 101])
. So the m=mpol mode should be included rather than excluded. If you want to change the 101 to 100 on line 523/528, that would be fine.
Just to give a signal of life here - I have not forgotten about this issue, but sadly have not found time yet to continue digging into this. |
VMEC only ever uses poloidal modes up to
m=mpol-1
withmpol
being specified in the VMEC input.SurfaceRZFourier
calls their poloidal Fourier resolution alsompol
, but includes poloidal modes including up tom=mpol
. This leads to inconsistencies when converting between VMEC input/output files andSurfaceRZFourier
. This PR addresses this inconsistency.