Repository navigation
Use consistent, regularized radial derivatives for lbsubs.
breaking: behavior now deviates from Fortran vmec, and requires different regularized interpolation in user code. the resulting currents are more trustworthy. details in docs/reports/lbsubs/.
For current-dependent calculations, use exported currents instead of differentiating covariant B. For example, at an interior full-grid surface j in a stellarator-symmetric equilibrium (w = output.wout):
h = 1 / (w.ns - 1)
c = np.cos(w.xm_nyq * theta - w.xn_nyq * zeta)
sqrtg = (0.5 * (w.gmnc[:, j] + w.gmnc[:, j + 1])) @ c
- # Before: plain finite differences (incompatible with updated lbsubs=True).
- dBu = (w.bsubumnc[:, j + 1] - w.bsubumnc[:, j]) / h
- Jzeta = ((dBu - w.xm_nyq * w.bsubsmns[:, j]) @ c) / (mu_0 * sqrtg)
+ # After: exported sqrt(g) J^zeta already includes 1/mu_0.
+ Jzeta = (w.currvmnc[:, j] @ c) / sqrtgFor asymmetric equilibria, also include the sine series from currvmns and gmns.
What's Changed
- Show grid metadata and progress bars in vmecpp mgrid by @jurasic-pf in #988
- Make lbsubs currents consistent and support asymmetry by @jurasic-pf in #995 #996
- Add wout post-processing tutorial by @jurasic-pf in #998
- Reuse one adjoint factorization for every cotangent by @CharlesCNorton in #1007
Full Changelog: v0.9.1...v0.9.2