Skip to content

Releases: PlasmaControl/DESC

v0.4.12

18 Aug 04:24
1591263
Compare
Choose a tag to compare

New Features:

  • New function plot_comparison to plot comparison between multiple DESC equilibria

  • plot_surfaces now has a more intuitive API - instead of specifying grids, the user specifies the specific rho/theta contours to plot

  • equil.is_nested now checks more toroidal planes for non-axisymmetric equilibria by default

  • Updates Equilibrium to make creating them more straightforward.

    • Instead of a dictionary of arrays and values, init method now takes individual arguments. These can either be objects of the correct type (ie Surface objects for boundary condiitons, Profile for pressure and iota etc,) or ndarrays which will get parsed into objects of the correct type (for backwards compatibility)
    • Also introduces more options for generating initial guesses, and a new dedicated method equilibrium.set_initial_guess(). The default is to scale the boundary surface that is assigned to the equilibrium, but another surface (and axis) can be supplied as an argument to the function to use that surface instead for the initial guess. It also accepts another Equilibrium instance, or a path to a saved DESC or VMEC equilibrium which will be loaded and its flux surfaces will be used as the initial guess.
    • Command line interface updated to allow for initial guesses from DESC or VMEC solutions using --guess=path (this also replaces the old --vmec flag)
  • Adds classes for representing various types of magnetic fields

    • Base class for all magnetic field types defining the compute_magnetic_field API and methods for combining fields
    • SplineMagneticField for dealing with mgrid files and splining expensive to compute fields
    • ScalarPotentialField for vacuum fields that can be written as B=grad(Phi)
    • basic field types for testing, such as toroidal, poloidal, vertical
    • field line integration function for tracing field lines in R,phi,Z, using JAX for differentiability

v0.4.11

08 Aug 01:00
d6b1a7d
Compare
Choose a tag to compare

Bug fixes:

  • Transforms used in the profile class weren't built by default, causing them to be built when first called which is under jit, meaning they would be recomputed every time instead of caching the transform as expected. Updated to now build transforms by default.

New Features:

  • DESC version number is now saved in hdf5 output files as version field.
  • Added straight field line method for plotting field line traces from a solved equilibrium.
  • A new method has been implemented that uses identities for the zernike polynomials in terms of jacobi polynomials, and a stable iterative evaluation for the jacobi polynomials and binomial coefficients. Accuracy seems on par or better than the old method using extended precision, at least for a given amount of computation time. There is some overhead from JIT compilation, but seems to pay off well for high resolution
  • Added new "unique" option for basis.evaluate to first reduce the work by finding unique combos of nodes/modes. Previously this was done inside each basis function evaluation, but doing it on the outside should be more efficient and makes the underlying functions differentiable.
  • Refactored fourier series evaluation to shift the arguments for evaluating derivatives rather than using recursion and conditionals.

v0.4.10

13 Jul 04:07
6001138
Compare
Choose a tag to compare

Bug Fixes:

  • Reordered import statements to ensure user requests to use GPU are handled correctly

New Features:

  • Adds several new classes to represent different types/parameterizations of curves and surfaces, for plasma boundaries, coordinate surfaces, coils, magnetic axis etc
  • New classes also have several new methods that will be made into objectives in the future, such as area, length, curvature, etc.
  • Surfaces can be used as boundary conditions via surface.get_constraint method
  • Added new plot method to trace field lines and plot them in real space (R, phi, Z)

v0.4.9

05 Jul 21:05
c7a8d01
Compare
Choose a tag to compare

Bug Fixes:

  • Fix a major bug in the least squares routine that set the initial regularization parameter to np.nan, meaning that the optimizer would stall as soon as it can no longer take full newton steps.

New Features:

  • Adds a Cholesky factorization option for solving the least squares trust region problem. This can be faster, but less numerically stable due to squaring the condition number of the Jacobian. Often still produces good results since the trust region itself regularizes the solution enough to overcome the poor conditioning.
  • Methods that take Grid objects now also accept an ndarray of nodes or an integer specifying the number of nodes in each direction.
  • Added repr methods for string representations of more objects.

v0.4.8

25 Jun 03:07
d1fd6f1
Compare
Choose a tag to compare

Bug fixes:

  • Fixed array comparison in eq method to return False for differently sized arrays rather than throwing an error
  • Misc errors fixed in VMECIO.save()
  • Fixed indexing issue with m=0, n=0 modes when transforming FourierSeries basis
  • Fixed sign error in computations of MHD energy

Changes:

  • 2nd-order optimal perturbation capability added
  • Quasi-symmetry objective functions have been validated against STELLOPT benchmarks
  • Additional data added to the VMEC-like NetCDF output generated by VMECIO.save() for compatibility with other legacy codes
  • Added equilibrium methods for calculating cross sectional area, aspect ratio, major and minor radii
  • Grid weights are now scaled to always sum to 4pi^2 even for symmetric grids so that volume and area will be calculated correctly for symmetric equilibria

Tests:

  • Added tests for VMECIO.save()
  • Added tests for FourierSeries transform bug

v0.4.7

16 Jun 20:05
0c4f616
Compare
Choose a tag to compare

Bug fixes:

  • Fixes the magnetic axis initial guess error raised in Issue #92

Tests:

  • Added a test to check the magnetic axis guess is used properly
  • Updated the "Dummy Stellarator" parameters, which gets used for several of the tests

v0.4.6

03 Jun 17:33
9146ee6
Compare
Choose a tag to compare

Bug fixes:

  • Plots of straight field line vartheta contours are now actually of straight field line vartheta, previously they were only approximations.

Backend:

  • New method equil.compute_theta_coords finds the geometric angle theta that maps to a given straight field line angle vartheta

v0.4.5

02 Jun 18:57
1798c1e
Compare
Choose a tag to compare

Bug fixes:

  • Fix bug in pickle IO that prevented objects with jitted attributes from being saved, pickling now only saves essential information.

Changes:

  • Added generic load function for loading objects without knowing what class they are
  • Removed usage of "==" operator between DESC objects in favor of obj1.eq(obj2). Equivalence is defined as "if saved and loaded, the two objects would be the same," so it ignores equality in trivially recomputeable attributes and focuses on the actual physics of the objects being compared.
  • Concentric grids are now up-down symmetric when symmetry is not enforced

Backend:

  • Remove object_lib from io, instead, now use built in dynamic importing to import the correct classes at runtime
  • Avoids needing to import classes in lots of files just so they can be in the object_lib, makes adding new stuff a lot easier.
  • Changed name in io stuff to class to avoid conflicts with actual name attributes

v0.4.4

30 May 21:27
c68fa66
Compare
Choose a tag to compare

Bug Fixes:
-Fixed key error in hdf5io that prevented some solutions from being loaded properly
-Updated requirements with correct version of flatbuffers to work with JAX

Documentation
-Updated installation instructions
-Updated hands on example and other notebooks with recent changes
-Fixed bug where docs wouldn't build on RTD

New functionality
-Added new method equilibrium.compute_flux_coords to find the flux coordinates (rho, theta, zeta) corresponding to a set of real space coordinates (R,phi,Z), useful for computing synthetic diagnostics.

Backend
-Added wrappers for more control flow operators, which will be needed for future development
-Added interpolation module with 1d, 2d, and 3d interpolation using linear or various cubic splines. These will primarily be needed for planned work on equilibrium reconstruction.