[VMEC,SurfaceRZFourier] fix inconsistency regarding mpol#437
[VMEC,SurfaceRZFourier] fix inconsistency regarding mpol#437jons-pf wants to merge 2 commits intohiddenSymmetries:masterfrom
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.
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.
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-1withmpolbeing specified in the VMEC input.SurfaceRZFouriercalls 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.