Skip to content

Releases: PlasmaControl/DESC

v0.16.0

16 Nov 04:34
a846c9b

Choose a tag to compare

New Features

  • New basis vector and metric elements derivatives in PEST coordinates and quantities useful for a global MHD stability solver.
  • Adds desc.external.TERPSICHORE objective for computing linear ideal MHD stability growth rates. This objective subclasses from ExternalObjective and requires access to the TERPSICHORE code, which is not included with DESC or its dependencies.
  • Adds docs/dev_guids/external_objectives.rst as a tutorial for how to use external objectives, with TERPSICHORE as an example using parallel processing.
  • Adds keyword argument normalize to plot_1d, plot_3d. normalize is a string to use for normalization.
  • Adds new linear objective ShareParameters which 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_integrate now returns diffrax.diffeqsolve.stats and diffrax.diffeqsolve.result if the flag return_aux is set to True.
    • Renames maxsteps argument of field_line_integrate to max_steps. Now the argument has a consistent meaning with the diffrax package 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_integrate function doesn't accept additional keyword-arguments related to diffrax, if it is necessary, they must be given through options dictionary.
    • poincare_plot and plot_field_lines functions can now plot partial results if the integration failed. Previously, user had to pass throw=False or 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_size argument is now used for chunking the number of field lines. For the chunking of Biot-Savart integration for the magnetic field, users can use bs_chunk_size instead.

Bug Fixes

  • Fixes straight field line equilibrium conversion, see #1880
  • desc.compat.rescale will now return ScaledProfile instances for most of its profiles, to fix a bug where improper scaling could occur for certain profile types.
  • Now always use sym=False in the default grid for plot_fsa to 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 PlasmaCoilSetMinDistance that occured using a FourierRZToroidalSurface object 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 FixParameters constraint.
  • Allow desc.vmec.VMECIO.load to load wout files that lack lrfp__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 legend kwarg to desc.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, by options={"solve_options":{"ftol"...}} passed to the desc.optimize.Optimizer.optimize call). This ensures the assumptions of the proximal projection method are enforced starting from the first step of the optimization.
  • desc.continuation.solve_continuation_automatic now 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 flag shaping_first=True.
  • desc.equilibrium.Equilibrium.set_initial_guess now 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-finufft package. If the GPU installation fails, users can fall back to the older (much slower) implementation by setting nufft_eps=0 in the computation of the related quantities.

New Contributors

Full Changelog: v0.15.0...v0.16.0

v0.15.0

21 Aug 23:06
c155aac

Choose a tag to compare

New Features

  • Adds new desc.geometry.FourierXYCurve and desc.coils.FourierXYCoil classes, which are a form of planar curve and coil class which describe the curve in terms of cartesian x and y in the plane (as opposed to using polar radius like FourierPlanarCurve and FourierPlanarCoil), which can make describing certain shapes (such as ellipses) easier. See #1504 for more information.
  • Adds desc.objectives.PlasmaCoilSetMaxDistance objective, which allows setting a maximum distance the coils are allowed to be from the equilibrium, useful, for example, when trying to balance the need for space for a blanket while also ensuring the cryostat is not too large. See #1722
  • Add meshgrid_flatten utility for flattening 3d data to a 1d array in the correct order, essentially the opposite of meshgrid_reshape.
  • Adds ability to get top k eigenfunctions the corresponding eigenvalues from the ideal ballooning solver.
  • Adds desc.plotting.plot_field_lines function which can take in an input desc.magnetic_fields.MagneticField object and plot a field line trajectory starting from some initial point in cylindrical coordinates.
  • Addsgamma_c compute quantity which is the integrand of Gamma_c. User can also plot gamma_c using the desc.plotting.plot_gammac function. (Note this function uses more memory than expected due to a performance regression in an upstream library. This is resolved in the next release).

Performance Improvements

  • Use integration on the boundary (as opposed to volume integration) for more quantities where this is applicable (through use of Stoke's theorem), see #1094
  • Minor memory improvements from a slight refactoring of desc.equilibrium.Equilibrium.from_near_axis method
  • Improve performance of desc.magnetic_fields.field_line_integrate for fields with large stored attributes (such as desc.magnetic_fields.SplineMagneticField (#1830)
  • Performance improvements for desc.objectives.BallooningStability objective (#1763, #1826)
  • Performance improvements for objectives which rely on coordinate mapping #1826

Minor Changes

  • Adds source_grid kwarg to from_field for SplineMagneticField , to allow for specifying the grid used to discretize the magnetic field the splined field is being created from.
  • Change default constraints for eq.optimize to just be ForceBalance, so now no other constraints are included by default, see #1725
  • Allows safenormalize to work on multiple vectors.
  • Updates to docs

Bug Fixes

  • ensures surfaces only compute things that make sense for their parametrizations, see #1724
  • fixes bugs in VMEC I/O
    • bug in desc.vmec.write_vmec_input for spline profiles (see #1740)
    • fixes error when reading VMEC input files with PMASS_TYPE defined which could result in converted DESC input files lacking a pressure profile
  • Ensures the stochastic optimizer sgd prints an iteration even if the first step satisfies the termination criterion
  • Fix nan in reverse mode gradient caused by rotation_matrix
  • Fix some outstanding bugs with desc.io.write_ascii function
  • Fixes bug in desc.geometry.FourierRZCurve from_values when a numpy array. See #1828
  • Ensures user supplied linear constraint x_scale passed to desc.optimize.Optimizer.optimize is not overwritten by the default dynamically updated x_scale

Deprecations

  • desc.io.write_ascii method for equilibrium I/O is deprecated and not recommended for use. Users are recommended instead to use the hdf5 files as the primary method of I/O with DESC objects.
  • Deprecates norm_F and norm_name kwargs from desc.plotting functions (plot_fsa, plot_section, plot_2d) in favor of the new compute quantity |F|_normalized, which is the magnitude of the force error normalized by the volume-averaged magnetic pressure gradient.
  • renames linecolor to color in the desc.plotting module functions

Breaking Changes

  • Significant changes to how DESC handles static attributes during JIT compilation. Going forward if any class/object has attributes that should be treated as static by jax.jit, these should be declared at the class level like _static_attrs = ["foo", "bar"]. Generally, non-arraylike attributes such as functions, strings etc should be marked static, as well as any attributes used for control flow. Previously this was done automatically, but in a way that caused a lot of performance bugs and unnecessary recompilation. These changes have been implemented for all classes in the desc repository, but if you have custom objectives or other local objects that subclass from desc you may need to add this yourself. JAX error messages usually do a good job of alerting you to things that need to be static, and feel free to open an issue with desc if you have any questions.

New Contributors

Full Changelog: v0.14.2...v0.15.0

v0.14.2

15 May 16:14
bdb4f3d

Choose a tag to compare

New Features

  • Updates Equilibrium initial guess to use geometric center as the axis. This will allow non-convex cross-sections to be initialized without having to solve to achieve nested surfaces.
  • Adds new regularization options to desc.objectives.SurfaceCurrentRegularization.
  • Adds a new utility function desc.compat.contract_equilibrium which takes in an Equilibrium object and an argument inner_rho, and returns a new Equilibrium with original Equilibrium's inner_rho flux surface as its boundary.
    Optionally can also contract the profiles of the original Equilibrium so that the new Equilibrium's profiles match the original's in real space.
  • Adds second-order NAE constraints, accessible by passing order=2 to desc.objectives.get_NAE_constraints.
  • result dictionary returned by Optimizer.optimize or eq.optimize now includes sub-dictionary "Objective values" containing summary info of objective values before and after optimization, the same info that is printed to the terminal by default.
  • Adds error for incorrect grids in desc.objectives.BootstrapRedlConsistency and when computing current Redl and <J*B> Redl compute quantities
  • Allows Redl compute quantities to use SplineProfile and updates Redl bootstrap current consistency tutorial to include a SplineProfile optimization
  • Adds automatically generated header file showing date the input file was created with desc.vmec.VMECIO.write_vmec_input
  • Adds source_grid argument to desc.magnetic_fields._MagneticField.save_mgrid function to allow user to control the discretization of the magnetic field object being used to construct the mgrid output.
  • Allows x_scale to be passed to factorize_linear_constraints in Optimizer.optimize through the new "linear_constraint_options".

Performance Improvements

  • ProximalProjection uses jvp's for the derivative of the ForceBalance part instead of manually taking the matrix products. This reduces the jacobian time on CPU.
  • Improves memory management to reduce the base memory used during optimization while using lsq-exact, lsq-auglag and fmin-auglag optimizers as well as their proximal- versions.

Bug Fixes

  • Fixes issue in desc.geometry.curve.FourierPlanarCurve.from_values where the orientation of the fitted curve can be the reverse of the original curve, which can be problematic for coils (the current is not negated, so the resulting fitted coil would have field opposite of the initial).
  • Fixes bug where ObjectiveFunction was incorrectly using deriv_mode="batched" and the heuristic-set jac_chunk_size when jac_chunk_size is given to a sub-objective, where it should have instead defaulted to deriv_mode="blocked". See #1687
  • Fixes bug where ProximalProjection was using wrong jac_chunk_size internally and using more memory than one would expect given the jac_chunk_size. This fix gives separate blocked and batched methods to ProximalProjection.

New Contributors

Full Changelog: v0.14.1...v0.14.2

v0.14.1

19 Mar 02:30
6ce9162

Choose a tag to compare

What's Changed

  • Fixes bug in desc.vmec.VMECIO.write_vmec_input for current-constrained equilibria, where DESC was incorrectly writing the $s^0$ mode, where VMEC actually assumes it is zero and starts at the $s^1$ (which is different than the usual convention VMEC uses for its current profile when it uses the current derivative, where it starts with the $s^0$ mode).

Full Changelog: v0.14.0...v0.14.1

v0.14.0

14 Mar 14:35
9f37cc6

Choose a tag to compare

What's Changed

  • Updates default parameters for partition support size in the singular surface integrals.
  • Enables tracking multiple field lines in Bounce2D.
  • Adds desc.objectives.LinkingCurrentConsistency for ensuring that coils in a stage 2 or single stage optimization provide the required linking current for a given equilibrium.
  • desc.objectives.Omnigenity is now vectorized and able to optimize multiple surfaces at the same time. Previously it was required to use a different objective for each surface.
  • Adds a new objective desc.objectives.MirrorRatio for targeting a particular mirror ratio on each flux surface, for either an Equilibrium or OmnigenousField.
  • Adds the output quantities wb and wp to VMECIO.save.
  • Changes implementation of Dommaschk potentials to use recursive algorithm and symbolic integration, improving agreement of numerical results with the literature.
  • eq.solve and eq.perturb now accept LinearConstraintProjection as objective. This option must be used without any constraints.
  • Allows non-proximal optimizers to handle optimizing more than one Equilibrium object simultaneously.
  • Renames compute quantity sqrt(g)_B to sqrt(g)_Boozer_DESC to more accurately reflect what the quantiy is (the jacobian from (rho,theta_B,zeta_B) to (rho,theta,zeta)), and adds a new function to compute sqrt(g)_Boozer which is the jacobian from (rho,theta_B,zeta_B) to (R,phi,Z).
  • DESC/JAX version and device info is no longer printed by default, but can be accessed with the function desc.backend.print_backend_info().

New Features

  • Adds Bounce integral methods with desc.integrals.Bounce2D.

  • Adds Effective ripple desc.objectives.EffectiveRipple and Gamma_c desc.objectives.Gamma_c optimization objectives.

  • Adds new compute quantities for partial derivatives in different coordinate systems.

  • Adds a new profile class PowerProfile for raising profiles to a power.

  • Adds an option scaled_termination (defaults to True) to all the desc optimizers to measure the norms for xtol and gtol in the scaled norm provided by x_scale (which defaults to using an adaptive scaling based on the Jacobian or Hessian). This should make things more robust when optimizing parameters with widely different magnitudes. The old behavior can be recovered by passing options={"scaled_termination": False}.

  • Adds a new objective desc.objectives.CoilIntegratedCurvature for targeting convex coils.

  • Adds the example "reactor_QA", which is similar to "precise_QA" but with self-consistent bootstrap current at finite beta.

  • desc.objectives.CoilSetMinDistance and desc.objectives.PlasmaCoilSetMinDistance now include the option to use a softmin which can give smoother gradients.

  • Adds a new function desc.coils.initialize_helical_coils for creating an initial guess for stage 2 helical coil optimization.

  • Adds desc.vmec_utils.make_boozmn_output for writing boozmn.nc style output files
    for compatibility with other codes which expect such files from the Booz_Xform code.

  • Adds a new objective desc.objectives.ExternalObjective for wrapping external codes with finite differences.

  • Allows specification of Nyquist spectrum maximum modenumbers when using VMECIO.save to save a DESC .h5 file as a VMEC-format wout file

  • Adds an option to VMECIO.save to specify the grid resolution in real space.

  • Performance Improvements

  • A number of minor improvements to basis function evaluation and spectral transforms to improve speed. These will also enable future improvements for larger gains.

  • proximal- optimizers use a single LinearConstraintProjection and this makes the optimization faster for high resolution cases where taking the SVD (for null-space and inverse) of constraint matrix takes significant time.

  • Chunking/batching can now be used in more places. Note that this might change the default behavior and you might get OOM (out of memory) errors.

    • Adds batching feature to parallelize singular integrals used in free boundary solves.
    • Adds chunk_size option to compute magnetic field methods to increase performance. Users may need to update their scripts to pass in bs_chunk_size=20 or some other reasonable number if out of memory occurs as the default attempts to perform the entire computation at once.
    • desc.objectives.CoilSetMinDistance and desc.objectives.PlasmaCoilSetMinDistance now have a dist_chunk_size option to break up the distance calculation into smaller pieces to save memory.
    • Changes hessian computation to use chunked jacfwd and jacrev, allowing jac_chunk_size to now reduce hessian memory usage as well.

Bug Fixes

  • Small bug fix to use the correct normalization length a in the BallooningStability objective.
  • Fixes I/O bug when saving/loading _Profile classes that do not have a _params attribute.
  • Minor bugs described in #1323.
  • Corrects basis vector computations made on surface objects #1175.
  • Allows keyword arguments to be passed to GenericObjective and ObjectiveFromUser.
  • Fixes bug where save_in_makegrid_format function did not correctly account for CoilSet objects with NFP>1 or sym=True attributes, and so would not save all the coils.
  • Fixes issue with interpolator for singular integrals #1522 and additional checks 1519.
  • Fixes the coil currents in desc.coils.initialize_modular_coils to now give the correct expected linking current.
  • desc.objectives.PlasmaVesselDistance now correctly accounts for multiple field periods on both the equilibrium and the vessel surface. Previously it only considered distances within a single field period.
  • Sets os.environ["JAX_PLATFORMS"] = "cpu" instead of os.environ["JAX_PLATFORM_NAME"] = "cpu" when doing set_device("cpu").
  • Fixes bug in desc.input_reader.desc_output_to_input utility function for asymmetric equilibria profiles, where the full profile resolution was not being saved.
  • Fixes bug when passing only sym into .change_resolution for FourierRZToroidalSurface, ZernikeRZToroidalSection and FourierRZCurve.
  • Fixes bug that was setting ObjectiveFunction._things_per_objective_idx incorrectly. Now each _Objective can define a unique order that it expects to use parameters for multiple "things".
  • Fixes bug that occurs when an NAE solution used with NAE constraints is asymmetric, but has a symmetric axis.
  • Fixes bug in FourierCurrentPotentialField.change_Phi_resolution where N_Phi would be changed to M_Phi if N is not explicitly passed into the method.
  • Fixes bug when setting current for a MixedCoilSet with an arbitrary tree structure.
  • Corrects Cholesky factorized least-squares solve for wide matrices used in root finding.
  • Fixes bug in the formula for computing "P_fusion".

Breaking Changes

  • Adds support for Python 3.13 and removes support for 3.9 since new JAX versions require minimum Python 3.10.

Full Changelog: v0.13.0...v0.14.0

v0.13.0

04 Dec 05:43
4e723e4

Choose a tag to compare

New Features

  • Adds function solve_regularized_surface_current to desc.magnetic_fields module that implements the REGCOIL algorithm (Landreman, (2017)) for surface current normal field optimization, which can run on both CPUs and GPUs.
    • Can specify the tuple current_helicity=(M_coil, N_coil) to determine if resulting contours correspond to helical topology (both (M_coil, N_coil) not equal to 0), modular (N_coil equal to 0 and M_coil nonzero) or windowpane/saddle (M_coil and N_coil both zero)
    • M_coil is the number of poloidal transits a coil makes before returning to itself, while N_coil is the number of toroidal transits a coil makes before returning to itself (this is sort of like the QS helicity)
    • if multiple values of the regularization parameter are input, will return a family of surface current fields (as a list) corresponding to the solution at each regularization value
  • Adds method to_CoilSet to FourierCurrentPotentialField which implements a coil cutting algorithm to discretize the surface current into coils
    • works for both modular and helical coils
  • Adds a new objective SurfaceCurrentRegularization (which minimizes w*|K|, the regularization term from surface current in the REGCOIL algorithm, with w being the objective weight which act as the regularization parameter)
    • use of both this and the QuadraticFlux objective allows for REGCOIL solutions to be obtained through the optimization framework, and combined with other objectives as well.
  • Adds a new tutorial showing how to useREGCOIL features, as well as a new section in the stage two optimization notebook using REGCOIL to obtain an initial guess for filamentary coil optimization.
  • Adds from_input_file method to Equilibrium class to generate an Equilibrium object with boundary, profiles, resolution and flux specified in a given DESC or VMEC input file
  • Adds SurfaceQuadraticFlux objective which minimizes the quadratic magnetic flux through a FourierRZToroidalSurface object, allowing for optimizing for Quadratic flux minimizing (QFM) surfaces.
  • Allows ToroidalFlux objective to accept FourierRZToroidalSurface so it can be used to specify the toroidal flux through a QFM surface.
  • Adds eq_fixed flag to ToroidalFlux to allow for the equilibrium/QFM surface to vary during optimization, useful for single-stage optimizations.
  • Adds tutorial notebook showcasing QFM surface capability.
  • Adds rotate_zeta function to desc.compat to rotate an Equilibrium around Z axis.

Minor Changes

  • Changes local area weighting of Bn in QuadraticFlux objective to be the square root of the local area element (Note that any existing optimizations using this objective may need different weights to achieve the same result now.)
  • Adds an NFP attribute to ScalarPotentialField, VectorPotentialField and DommaschkPotentialField, to allow SplineMagneticField.from_field and MagneticField.save_mgrid to efficiently take advantage of the discrete toroidal symmetry of these fields, if present.
  • Adds support for numpy version 2.0.0
  • Various improvements to optimization algorithms for improving performance of equilibrium solving and optimization, especially on GPUs.

Bug Fixes

  • Fixes bug that occurs when taking the gradient of root and root_scalar with newer versions of JAX (>=0.4.34) and unpins the JAX version.
  • Changes FixLambdaGauge constraint to now enforce zero flux surface average for lambda, instead of enforcing lambda(rho,0,0)=0 as it was incorrectly doing before.
  • Fixes bug in softmin/softmax implementation.
  • Fixes bug that occurred when using ProximalProjection with a scalar optimization algorithm.
  • Fixes bug where from desc.plotting import * would not import desc.plotting.poincare_plot

Full Changelog: v0.12.3...v0.13.0

v0.12.3

08 Oct 13:30
62e82f4

Choose a tag to compare

What's Changed

  • Add jac_chunk_size keyword argument to ObjectiveFunction to reduce memory usage of forward mode Jacobian calculation , see docs for more details
  • Add objective using for Ideal-Ballooning Stability, see related paper for more details.
  • Make naming of grids kwargs among free boundary objectives more uniform
  • Add kwarg options to plot 3d without any axis visible
  • Pin jax version temporarily to avoid JAX-related bug

Bug Fixes

  • Fix error that can occur when get_NAE_constraints is called for only fixing the axis
  • bug fix for most_rational with negative arguments
  • fix bug. in FixOmniBMax

New Contributors

Full Changelog: v0.12.2...v0.12.3

v0.12.2

20 Sep 19:02
75eafcc

Choose a tag to compare

What's Changed

  • Add Vector Potential Calculation to Coil classes and Most MagneticField Classes
  • Add automatic intersection checking to CoilSet objects, and a method is_self_intersecting which check if the coils in the CoilSet intersect one another.
  • Add flip_theta compatibility function to switch the zero-point of the poloidal angle between the inboard/outboard side of the plasma.
  • Change field line integration to use diffrax package instead of the deprecated jax.experimental.odeint function, allowing for specifying the integration method, the step-size used, and more. See the documentation of field_line_integrate and diffrax for more details.
  • Add use_signed_distance keyword to PlasmaVesselDistance objective to allow for specifying the desired relative position of the plasma and surface.
  • Vectorize Boozer transform over multiple surfaces, to allow for calculation of Boozer-related quantities on grids that contain multiple radial surfaces.
  • Optimizer now automatically scales linearly-constrained optimization parameters to be of roughly the same magnitude, to improve optimization when parameter values range many orders of magnitude
  • Add HermiteSplineProfile class, which allows for profile derivative information to be specified along with profile value information.
  • Add installation instructions for RAVEN cluster at IPP to the docs
  • Change optimizer printed output to be easier to read
  • Add HeatingPower and FusionPower objectives
  • Reduce QuadratureGrid number of radial points to match its intended functionality
  • Fix some plotting issues that arose when NFP differs from 1 for objects, or when passed-in phi exceeds 2pi/nfp
  • Update VMECIO to allow specification of Nyquist spectrum and fix some bugs with asymmetric wout files
  • The code no longer mods non-periodic angles (such as the field line label $\alpha$) by $2\pi$, as in field-line-following contexts, functions may not be periodic in these angles.

Full Changelog: v0.12.1...v0.12.2

v0.12.1

29 Jul 13:16
5b245a4

Choose a tag to compare

What's Changed

  • Optimizers now default to use QR factorization for least squares which is much faster
    especially on GPU.
  • Fix bug when reading VMEC input ZAXIS as ZAXIS_CS
  • Some fixes/improvements for computing quantities along a fieldline.
  • Adds compute quantities for PEST coordinate system basis vectors
  • Many init methods now default to running on CPU, even when GPU is enabled, as CPU was found
    to be much faster for these cases.
  • New objectives desc.objectives.FixNearAxis{R,Z,Lambda} for fixing near axis behavior.
  • Adds from_values method that was present in FourierRZCurve but missing in FourierRZCoil
  • Adds new from_values method for FourierPlanarCurve and FourierPlanarCoil

Full Changelog: v0.12.0...v0.12.1

v0.12.0

18 Jul 03:11
87592bc

Choose a tag to compare

New Features

  • Coil optimization is now possible in DESC using various filamentary coils. This includes
    a number of new objectives:
    • desc.objectives.QuadraticFlux
    • desc.objectives.ToroidalFlux
    • desc.objectives.CoilLength
    • desc.objectives.CoilCurvature
    • desc.objectives.CoilTorsion
    • desc.objectives.CoilCurrentLength
    • desc.objectives.CoilSetMinDistance
    • desc.objectives.PlasmaCoilSetMinDistance
    • desc.objectives.FixCoilCurrent
    • desc.objectives.FixSumCoilCurrent
  • Add Normal Field Error "B*n" as a plot quantity to desc.plotting.{plot_2d, plot_3d}.
  • New function desc.plotting.poincare_plot for creating Poincare plots by tracing
    field lines from coils or other external fields.
  • New profile type desc.profiles.TwoPowerProfile.
  • Add desc.geometry.FourierRZCurve.from_values method to fit curve with data.
  • Add desc.geometry.FourierRZToroidalSurface.from_shape_parameters method for generating a surface
    with specified elongation, triangularity, squareness, etc.
  • New class desc.magnetic_fields.MagneticFieldFromUser for user defined B(R,phi,Z).
  • All vector variables are now computed in toroidal (R,phi,Z) coordinates by default.
    Cartesian (X,Y,Z) coordinates can be requested with the compute keyword basis='xyz'.
  • Add method desc.coils.CoilSet.is_self_intersecting, which checks if any coils
    intersect each other in the coilset.

Minor changes

  • Improved heuristic initial guess for Equilibrium.map_coordinates.
  • Add documentation for default grid and target/bounds for objectives.
  • Add documentation for compute function keyword arguments.
  • Loading a coilset from a MAKEGRID file will now return a nested MixedCoilSet if there
    are coil groups present in the MAKEGRID file.
  • Users must now pass in spacing/weights to custom Grids (the previous defaults were
    often wrong, leading to incorrect results)
  • The normal and center parameters of a FourierPlanarCurve can now be specified
    in either cartesian or cylindrical coordinates, as determined by the basis parameter.
  • Misc small changes to reduce compile time and memory consumption (more coming soon!)
  • Linear constraint factorization has been refactored to improve efficiency and reduce
    floating point error.
  • desc.objectives.{GenericObjective, ObjectiveFromUser} can now work with other objects
    besides an Equilibrium (such as surfaces, curves, etc.)
  • Improve warning for missing attributes when loading desc objects.

Bug Fixes

  • Several small fixes to ensure things that should be ints are ints
  • Fix incorrect toroidal components of surface basis vectors.
  • Fix a regression in performance in evaluating Zernike polynomials.
  • Fix errors in Equilibrium.map_coordinates for prescribed current equilibria.
  • Fix definition of b0 in VMEC output.
  • Fix a bug where calling Equilibrium.compute(..., data=data) would lead to excessive
    recalculation and potentially wrong results.
  • Fixes a bug causing NaN in reverse mode AD for Omnigenity objective.
  • Fix a bug where "A(z)" would be zero if the grid doesn't contain nodes at rho=1.

New Contributors

Full Changelog: v0.11.1...v0.12.0