v0.16.0
New Features
- New basis vector and metric elements derivatives in PEST coordinates and quantities useful for a global MHD stability solver.
- Adds
desc.external.TERPSICHOREobjective for computing linear ideal MHD stability growth rates. This objective subclasses fromExternalObjectiveand requires access to the TERPSICHORE code, which is not included with DESC or its dependencies. - Adds
docs/dev_guids/external_objectives.rstas a tutorial for how to use external objectives, with TERPSICHORE as an example using parallel processing. - Adds keyword argument
normalizeto plot_1d, plot_3d.normalizeis a string to use for normalization. - Adds new linear objective
ShareParameterswhich can enforce that the chosen parameters of two or more objects of the same type remain identical during an optimization. Potentially useful for flexible stellarator optimization, where one has two coilsets with the same geometry but differing currents, and attempts to optimize for two different stellarator equilibria. - Changes related to
field_line_integrate, see #1839:field_line_integratenow returnsdiffrax.diffeqsolve.statsanddiffrax.diffeqsolve.resultif the flagreturn_auxis set to True.- Renames
maxstepsargument offield_line_integratetomax_steps. Now the argument has a consistent meaning with thediffraxpackage and specifies the maximum number of steps allowed for whole integration. Previously, it was used as maximum number of iterations between integration steps. field_line_integratefunction doesn't accept additional keyword-arguments related todiffrax, if it is necessary, they must be given throughoptionsdictionary.poincare_plotandplot_field_linesfunctions can now plot partial results if the integration failed. Previously, user had to passthrow=Falseor change the integration parameters. Users can ignore the warnings that are caused by hitting the bounds (i.e.Terminating differential equation solve because an event occurred.).chunk_sizeargument is now used for chunking the number of field lines. For the chunking of Biot-Savart integration for the magnetic field, users can usebs_chunk_sizeinstead.
Bug Fixes
- Fixes straight field line equilibrium conversion, see #1880
desc.compat.rescalewill now returnScaledProfileinstances for most of its profiles, to fix a bug where improper scaling could occur for certain profile types.- Now always use
sym=Falsein the default grid forplot_fsato ensure correct averages - Fixes bug that could lead extra compilation of jit-compiled functions that include
field_line_integrate. - Fixes inaccurate normalizations scales that could be computed for certain equilibria which had m=1 n=0 R and m=-1 n=0 Z components much smaller than their actual average minor radius, see #1954
- Fix bug in
PlasmaCoilSetMinDistancethat occured using aFourierRZToroidalSurfaceobject without passing in an the evaluation grid, see #2013 - Equilibrium profile assignments are now guaranteed to be consistent with the equilibrium resolution—automatically increasing lower-resolution profiles to match the equilibrium (while keeping higher-resolution profiles untouched)—meaning users who relied on lower-resolution profiles to implicitly restrict optimization must now explicitly use the
FixParametersconstraint. - Allow
desc.vmec.VMECIO.loadto load wout files that lacklrfp__logical__, like those outputted by VMEC++. This change assumes that those output files don't have poloidal flux label. - Fixes a bug that had prevented passing the
legendkwarg todesc.plotting.plot_surfaces.
Backend
- When using any of the
"proximal-"optimization methods, the equilbrium is now always solved before beginning optimization to the specified tolerance (as determined, for example, byoptions={"solve_options":{"ftol"...}}passed to thedesc.optimize.Optimizer.optimizecall). This ensures the assumptions of the proximal projection method are enforced starting from the first step of the optimization. desc.continuation.solve_continuation_automaticnow falls back to performing shape perturbations first and then pressure if the default pressure-then-shaping path fails, increasing robustness in arriving at the final equilibrium. To go directly to the path of applying shaping then pressure, pass the flagshaping_first=True.desc.equilibrium.Equilibrium.set_initial_guessnow sets lambda to zero for most use cases, and the docstring has been updated to be more explicit on what is done in each case.- Minimum JAX version bumped up to
0.5.0
Performance Improvements
- Coordinate mapping uses partial summation, see #1826
- Non-uniform FFTs (NUFFTS) are now used by default for computing bounce integrals, see #1834. NUFFT functionality is added through
jax-finufftpackage. If the GPU installation fails, users can fall back to the older (much slower) implementation by settingnufft_eps=0in the computation of the related quantities.
New Contributors
- @singh-jaydeep made their first contribution in #1905
Full Changelog: v0.15.0...v0.16.0