Releases: PlasmaControl/DESC
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
v0.15.0
New Features
- Adds new
desc.geometry.FourierXYCurveanddesc.coils.FourierXYCoilclasses, 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 likeFourierPlanarCurveandFourierPlanarCoil), which can make describing certain shapes (such as ellipses) easier. See #1504 for more information. - Adds
desc.objectives.PlasmaCoilSetMaxDistanceobjective, 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_flattenutility 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_linesfunction which can take in an inputdesc.magnetic_fields.MagneticFieldobject and plot a field line trajectory starting from some initial point in cylindrical coordinates. - Adds
gamma_ccompute quantity which is the integrand ofGamma_c. User can also plotgamma_cusing thedesc.plotting.plot_gammacfunction. (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_axismethod - Improve performance of
desc.magnetic_fields.field_line_integratefor fields with large stored attributes (such asdesc.magnetic_fields.SplineMagneticField(#1830) - Performance improvements for
desc.objectives.BallooningStabilityobjective (#1763, #1826) - Performance improvements for objectives which rely on coordinate mapping #1826
Minor Changes
- Adds
source_gridkwarg tofrom_fieldforSplineMagneticField, 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
safenormalizeto work on multiple vectors. - Updates to docs
- Notes on role of
eq.Psiin vacuum free boundary in free boundary tutorial and coil optimization tutorial - Updates
Adding new objective functionstutorial - Adds example uses of
GenericObjectiveandObjectiveFromUserto advanced optimization tutorial - updates installation docs for della and adds new
uvinstall method
- Notes on role of
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_inputfor spline profiles (see #1740) - fixes error when reading VMEC input files with
PMASS_TYPEdefined which could result in converted DESC input files lacking a pressure profile
- bug in
- Ensures the stochastic optimizer
sgdprints an iteration even if the first step satisfies the termination criterion - Fix
nanin reverse mode gradient caused byrotation_matrix - Fix some outstanding bugs with
desc.io.write_asciifunction - Fixes bug in
desc.geometry.FourierRZCurve from_valueswhen a numpy array. See #1828 - Ensures user supplied linear constraint
x_scalepassed todesc.optimize.Optimizer.optimizeis not overwritten by the default dynamically updatedx_scale
Deprecations
desc.io.write_asciimethod 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_Fandnorm_namekwargs fromdesc.plottingfunctions (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
linecolortocolorin thedesc.plottingmodule 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 thedescrepository, but if you have custom objectives or other local objects that subclass fromdescyou 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 withdescif you have any questions.
New Contributors
- @gretahibbard made their first contribution in #1529
Full Changelog: v0.14.2...v0.15.0
v0.14.2
New Features
- Updates
Equilibriuminitial 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_equilibriumwhich takes in anEquilibriumobject and an argumentinner_rho, and returns a newEquilibriumwith originalEquilibrium'sinner_rhoflux surface as its boundary.
Optionally can also contract the profiles of the originalEquilibriumso that the newEquilibrium's profiles match the original's in real space. - Adds second-order NAE constraints, accessible by passing
order=2todesc.objectives.get_NAE_constraints. resultdictionary returned byOptimizer.optimizeoreq.optimizenow 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.BootstrapRedlConsistencyand when computingcurrent Redland<J*B> Redlcompute quantities - Allows Redl compute quantities to use
SplineProfileand updates Redl bootstrap current consistency tutorial to include aSplineProfileoptimization - Adds automatically generated header file showing date the input file was created with
desc.vmec.VMECIO.write_vmec_input - Adds
source_gridargument todesc.magnetic_fields._MagneticField.save_mgrid functionto allow user to control the discretization of the magnetic field object being used to construct themgridoutput. - Allows
x_scaleto be passed tofactorize_linear_constraintsinOptimizer.optimizethrough the new"linear_constraint_options".
Performance Improvements
ProximalProjectionuses jvp's for the derivative of theForceBalancepart 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-auglagandfmin-auglagoptimizers as well as theirproximal-versions.
Bug Fixes
- Fixes issue in
desc.geometry.curve.FourierPlanarCurve.from_valueswhere 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
ObjectiveFunctionwas incorrectly usingderiv_mode="batched"and the heuristic-setjac_chunk_sizewhenjac_chunk_sizeis given to a sub-objective, where it should have instead defaulted toderiv_mode="blocked". See #1687 - Fixes bug where
ProximalProjectionwas using wrongjac_chunk_sizeinternally and using more memory than one would expect given thejac_chunk_size. This fix gives separateblockedandbatchedmethods toProximalProjection.
New Contributors
Full Changelog: v0.14.1...v0.14.2
v0.14.1
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
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.LinkingCurrentConsistencyfor ensuring that coils in a stage 2 or single stage optimization provide the required linking current for a given equilibrium. desc.objectives.Omnigenityis 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.MirrorRatiofor targeting a particular mirror ratio on each flux surface, for either anEquilibriumorOmnigenousField. - Adds the output quantities
wbandwptoVMECIO.save. - Changes implementation of Dommaschk potentials to use recursive algorithm and symbolic integration, improving agreement of numerical results with the literature.
eq.solveandeq.perturbnow acceptLinearConstraintProjectionas objective. This option must be used without any constraints.- Allows non-proximal optimizers to handle optimizing more than one
Equilibriumobject simultaneously. - Renames compute quantity
sqrt(g)_Btosqrt(g)_Boozer_DESCto 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 computesqrt(g)_Boozerwhich 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.EffectiveRippleand Gamma_cdesc.objectives.Gamma_coptimization objectives. -
Adds new compute quantities for partial derivatives in different coordinate systems.
-
Adds a new profile class
PowerProfilefor raising profiles to a power. -
Adds an option
scaled_termination(defaults to True) to all the desc optimizers to measure the norms forxtolandgtolin the scaled norm provided byx_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 passingoptions={"scaled_termination": False}. -
Adds a new objective
desc.objectives.CoilIntegratedCurvaturefor 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.CoilSetMinDistanceanddesc.objectives.PlasmaCoilSetMinDistancenow include the option to use a softmin which can give smoother gradients. -
Adds a new function
desc.coils.initialize_helical_coilsfor creating an initial guess for stage 2 helical coil optimization. -
Adds
desc.vmec_utils.make_boozmn_outputfor 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.ExternalObjectivefor wrapping external codes with finite differences. -
Allows specification of Nyquist spectrum maximum modenumbers when using
VMECIO.saveto save a DESC .h5 file as a VMEC-format wout file -
Adds an option to
VMECIO.saveto 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 singleLinearConstraintProjectionand 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_sizeoption to compute magnetic field methods to increase performance. Users may need to update their scripts to pass inbs_chunk_size=20or some other reasonable number if out of memory occurs as the default attempts to perform the entire computation at once. desc.objectives.CoilSetMinDistanceanddesc.objectives.PlasmaCoilSetMinDistancenow have adist_chunk_sizeoption to break up the distance calculation into smaller pieces to save memory.- Changes hessian computation to use chunked
jacfwdandjacrev, allowingjac_chunk_sizeto now reduce hessian memory usage as well.
Bug Fixes
- Small bug fix to use the correct normalization length
ain the BallooningStability objective. - Fixes I/O bug when saving/loading
_Profileclasses that do not have a_paramsattribute. - Minor bugs described in #1323.
- Corrects basis vector computations made on surface objects #1175.
- Allows keyword arguments to be passed to
GenericObjectiveandObjectiveFromUser. - Fixes bug where
save_in_makegrid_formatfunction did not correctly account forCoilSetobjects 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_coilsto now give the correct expected linking current. desc.objectives.PlasmaVesselDistancenow 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 ofos.environ["JAX_PLATFORM_NAME"] = "cpu"when doingset_device("cpu"). - Fixes bug in
desc.input_reader.desc_output_to_inpututility function for asymmetric equilibria profiles, where the full profile resolution was not being saved. - Fixes bug when passing only
syminto.change_resolutionforFourierRZToroidalSurface,ZernikeRZToroidalSectionandFourierRZCurve. - Fixes bug that was setting
ObjectiveFunction._things_per_objective_idxincorrectly. Now each_Objectivecan 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_resolutionwhereN_Phiwould be changed toM_PhiifNis not explicitly passed into the method. - Fixes bug when setting current for a
MixedCoilSetwith 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
New Features
- Adds function
solve_regularized_surface_currenttodesc.magnetic_fieldsmodule 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_coilequal to 0 andM_coilnonzero) or windowpane/saddle (M_coilandN_coilboth zero) M_coilis the number of poloidal transits a coil makes before returning to itself, whileN_coilis the number of toroidal transits a coil makes before returning to itself (this is sort of like the QShelicity)- 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
- Can specify the tuple
- Adds method
to_CoilSettoFourierCurrentPotentialFieldwhich 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 minimizesw*|K|, the regularization term from surface current in the REGCOIL algorithm, withwbeing the objective weight which act as the regularization parameter)- use of both this and the
QuadraticFluxobjective allows for REGCOIL solutions to be obtained through the optimization framework, and combined with other objectives as well.
- use of both this and the
- Adds a new tutorial showing how to use
REGCOILfeatures, 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_filemethod toEquilibriumclass to generate anEquilibriumobject with boundary, profiles, resolution and flux specified in a given DESC or VMEC input file - Adds
SurfaceQuadraticFluxobjective which minimizes the quadratic magnetic flux through aFourierRZToroidalSurfaceobject, allowing for optimizing for Quadratic flux minimizing (QFM) surfaces. - Allows
ToroidalFluxobjective to acceptFourierRZToroidalSurfaceso it can be used to specify the toroidal flux through a QFM surface. - Adds
eq_fixedflag toToroidalFluxto allow for the equilibrium/QFM surface to vary during optimization, useful for single-stage optimizations. - Adds tutorial notebook showcasing QFM surface capability.
- Adds
rotate_zetafunction todesc.compatto rotate anEquilibriumaround Z axis.
Minor Changes
- Changes local area weighting of Bn in
QuadraticFluxobjective 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
NFPattribute toScalarPotentialField,VectorPotentialFieldandDommaschkPotentialField, to allowSplineMagneticField.from_fieldandMagneticField.save_mgridto efficiently take advantage of the discrete toroidal symmetry of these fields, if present. - Adds support for
numpyversion2.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
rootandroot_scalarwith newer versions of JAX (>=0.4.34) and unpins the JAX version. - Changes
FixLambdaGaugeconstraint 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/softmaximplementation. - Fixes bug that occurred when using
ProximalProjectionwith a scalar optimization algorithm. - Fixes bug where
from desc.plotting import *would not importdesc.plotting.poincare_plot
Full Changelog: v0.12.3...v0.13.0
v0.12.3
What's Changed
- Add
jac_chunk_sizekeyword argument toObjectiveFunctionto 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_constraintsis called for only fixing the axis - bug fix for
most_rationalwith negative arguments - fix bug. in
FixOmniBMax
New Contributors
- @lisamessier made their first contribution in #1269
- @missing-user made their first contribution in #1274
- @felicia22 made their first contribution in #1284
Full Changelog: v0.12.2...v0.12.3
v0.12.2
What's Changed
- Add Vector Potential Calculation to
Coilclasses and MostMagneticFieldClasses - Add automatic intersection checking to
CoilSetobjects, and a methodis_self_intersectingwhich check if the coils in theCoilSetintersect one another. - Add
flip_thetacompatibility function to switch the zero-point of the poloidal angle between the inboard/outboard side of the plasma. - Change field line integration to use
diffraxpackage instead of the deprecatedjax.experimental.odeintfunction, allowing for specifying the integration method, the step-size used, and more. See the documentation offield_line_integrateanddiffraxfor more details. - Add
use_signed_distancekeyword toPlasmaVesselDistanceobjective 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
HermiteSplineProfileclass, 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
HeatingPowerandFusionPowerobjectives - Reduce
QuadratureGridnumber 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
VMECIOto 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
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_valuesmethod that was present inFourierRZCurvebut missing inFourierRZCoil - Adds new
from_valuesmethod forFourierPlanarCurveandFourierPlanarCoil
Full Changelog: v0.12.0...v0.12.1
v0.12.0
New Features
- Coil optimization is now possible in DESC using various filamentary coils. This includes
a number of new objectives:desc.objectives.QuadraticFluxdesc.objectives.ToroidalFluxdesc.objectives.CoilLengthdesc.objectives.CoilCurvaturedesc.objectives.CoilTorsiondesc.objectives.CoilCurrentLengthdesc.objectives.CoilSetMinDistancedesc.objectives.PlasmaCoilSetMinDistancedesc.objectives.FixCoilCurrentdesc.objectives.FixSumCoilCurrent
- Add Normal Field Error
"B*n"as a plot quantity todesc.plotting.{plot_2d, plot_3d}. - New function
desc.plotting.poincare_plotfor creating Poincare plots by tracing
field lines from coils or other external fields. - New profile type
desc.profiles.TwoPowerProfile. - Add
desc.geometry.FourierRZCurve.from_valuesmethod to fit curve with data. - Add
desc.geometry.FourierRZToroidalSurface.from_shape_parametersmethod for generating a surface
with specified elongation, triangularity, squareness, etc. - New class
desc.magnetic_fields.MagneticFieldFromUserfor 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 keywordbasis='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
MixedCoilSetif 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
normalandcenterparameters of aFourierPlanarCurvecan now be specified
in either cartesian or cylindrical coordinates, as determined by thebasisparameter. - 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 anEquilibrium(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 areints - Fix incorrect toroidal components of surface basis vectors.
- Fix a regression in performance in evaluating Zernike polynomials.
- Fix errors in
Equilibrium.map_coordinatesfor prescribed current equilibria. - Fix definition of
b0in 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
Omnigenityobjective. - 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