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