Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ε and Γ_c with Fourier Bounce #1290

Merged
merged 119 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
c5d6a99
Merge branch 'Gamma_c' into ku/fourier_bounce_neo
unalmis Oct 3, 2024
b1a5c81
write eps_eff compute function with bounce2d
unalmis Oct 3, 2024
a81014d
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 6, 2024
29d24f5
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 6, 2024
eb448e9
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 6, 2024
15875d9
Debugging JAX issues
unalmis Oct 6, 2024
5eb11eb
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 6, 2024
22500b2
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 6, 2024
70a3a9e
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 7, 2024
dc82cfa
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 7, 2024
d20ee87
Merge commit '70a3a9e' into ku/fourier_bounce_neo
unalmis Oct 7, 2024
fd723a6
Merge branch 'Gamma_c' into ku/fourier_bounce_neo
unalmis Oct 17, 2024
8b5cdb8
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 17, 2024
276f6af
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 18, 2024
4d89326
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 19, 2024
d6d9407
Merge branch 'Gamma_c' into ku/fourier_bounce_neo
unalmis Oct 19, 2024
4ed1701
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 19, 2024
2f3a03a
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 19, 2024
5a58582
Writing new compute funs with Bounce2D
unalmis Oct 20, 2024
5ea5c02
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 20, 2024
3227c8f
Merge branch 'Gamma_c' into ku/fourier_bounce_neo
unalmis Oct 20, 2024
8a8e8f2
Updating epsilon and gamma objectives with Bounce2D
unalmis Oct 20, 2024
bd5ff90
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 20, 2024
f2c3ac1
Update docstrings for neoclassical objectives to use new docstring fo…
unalmis Oct 20, 2024
8733ab7
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 20, 2024
89e63f7
Add jitable flag to create meshgrid
unalmis Oct 20, 2024
ed7aa75
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 21, 2024
36512d1
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 21, 2024
4ebe882
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 21, 2024
695ebac
Removing redundant parameter when constructing bounce2d
unalmis Oct 21, 2024
0c88f3c
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 21, 2024
c22b495
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 21, 2024
365b55d
Making changes that arise from Rory's suggested naming changes
unalmis Oct 21, 2024
0e6fa9f
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 21, 2024
f7220a0
Review inspired changes
unalmis Oct 21, 2024
968afed
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 22, 2024
7b58acf
Improving documentation and fixing bug in objective where Y_B not set…
unalmis Oct 22, 2024
5e0bd0d
Mark Gamma_c as not implemented axis limit
unalmis Oct 22, 2024
15f9278
Add Gamma_c axis limit
unalmis Oct 22, 2024
62fa063
Creating new option to reduce memory usage
unalmis Oct 23, 2024
03a0af5
Adding abs around B^zeta missing from last commit. Now, I'm done.
unalmis Oct 23, 2024
8fbd2f1
Merge branch 'grid_resolution_fix' into ku/fourier_bounce_neo
unalmis Oct 24, 2024
19afc1e
Increasing FFT resolution in tests
unalmis Oct 24, 2024
abfa7f4
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
rahulgaur104 Oct 25, 2024
f82bf2d
Avoid redundant interpolation to speed things
unalmis Oct 27, 2024
1f26a33
Add psuedo spectral version of velasco gamma_c
unalmis Oct 27, 2024
54c7369
Speed up by ffting at once
unalmis Oct 27, 2024
2b36f5a
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 29, 2024
d88227e
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 29, 2024
aa9513f
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 30, 2024
51cceeb
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 31, 2024
02aff96
Update dev requirement
unalmis Oct 31, 2024
808c5e2
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Oct 31, 2024
4275f69
Update ripple optimization notebook
unalmis Nov 3, 2024
23c546f
Update optimization notebook with better result using fwd mode
unalmis Nov 6, 2024
08fb177
Update variable name, reduce memory
unalmis Nov 10, 2024
3c95413
Clean up integration api
unalmis Nov 10, 2024
bdf7225
Make api match between 1d and 2d methods
unalmis Nov 11, 2024
78e902a
Remove useles multiply
unalmis Nov 12, 2024
8297e45
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Nov 12, 2024
def0853
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Nov 13, 2024
04f315f
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Nov 16, 2024
5c14f9f
Update changelog
unalmis Nov 16, 2024
78bcf33
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Nov 19, 2024
502bef6
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Nov 20, 2024
d796c6d
Merge commit '78bcf33' into ku/fourier_bounce_neo
unalmis Nov 20, 2024
ccd6e2b
Address Rory's request https://github.com/PlasmaControl/DESC/pull/111…
unalmis Nov 21, 2024
c590fd1
Reviewer requested name change (#1407)
unalmis Nov 21, 2024
40f1971
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Nov 24, 2024
10b547f
Change defaults for reverse mode jacobian chunk size for eps_eff
unalmis Nov 24, 2024
5511ce6
Fix if statement from previous commit
unalmis Nov 24, 2024
f0a780c
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 3, 2024
48cfedc
Cosmetic changes requested by review
unalmis Dec 3, 2024
b05abec
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 3, 2024
5881dc4
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
rahulgaur104 Dec 3, 2024
530826f
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 4, 2024
010da52
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
60b73f1
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
9c9b447
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
8ed49f5
More fallout from renaming grid attribute
unalmis Dec 5, 2024
10aa307
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
e72ec3d
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
a7f4222
Merge branch 'ku/fourier_bounce' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
0dad867
Make quadratures public
unalmis Dec 5, 2024
48af680
Remove option to supress higher order singularities as all bounce int…
unalmis Dec 5, 2024
845854d
Merge branch 'master' into ku/fourier_bounce_neo
unalmis Dec 5, 2024
ceb610a
Fallout from reviewer requested change
unalmis Dec 5, 2024
6e35fe7
Bumpy python version from 3.9 to 3.10
unalmis Dec 5, 2024
3546979
Exclude grid requirement quantities from test axis limit and compute …
unalmis Dec 5, 2024
9e6e73e
Fix failing test that compares string to hardcoded valu
unalmis Dec 5, 2024
3b34fb1
Update for #1441
unalmis Dec 11, 2024
7aa45d0
Review changes from other branch
unalmis Dec 11, 2024
a480b47
Merge branch 'master' into ku/fourier_bounce_neo
unalmis Dec 17, 2024
c261d03
Missing edits from previous merge
unalmis Dec 17, 2024
1cf86c2
Increase tolerance in compute_scalar_resolution test
unalmis Dec 17, 2024
3b7e5e1
Switch to using same quad for weak and strong integrals in GammaC to …
unalmis Dec 17, 2024
5c374d8
Quad change for speed (#1478)
unalmis Dec 17, 2024
b06aab4
Review requests 1
unalmis Dec 18, 2024
f75c458
Improve performance of Gamma_c Nemov computation
unalmis Dec 19, 2024
e575712
More reviewer requested refactoring...
unalmis Dec 19, 2024
432933b
Merge branch 'master' into ku/fourier_bounce_neo
unalmis Dec 19, 2024
8cbbac8
Review requests
unalmis Dec 19, 2024
566c735
Allow python 3.9 for Rory
unalmis Dec 19, 2024
67484f1
Fix space
unalmis Dec 19, 2024
9848354
Fighting with the docs. all of these edits were necesseary apparently
unalmis Dec 19, 2024
548674e
.
unalmis Dec 19, 2024
f3237b1
Update notebook name so it appears in docs
unalmis Dec 19, 2024
274352c
Fix docs
unalmis Dec 19, 2024
4097aa8
Fix math comment
unalmis Dec 19, 2024
30988de
Fix math comment
unalmis Dec 19, 2024
3fd85a1
Fix docs
unalmis Dec 19, 2024
0a4c3eb
adding back method useful for nan debugging
unalmis Dec 20, 2024
d3c84d3
Remove unneded min
unalmis Dec 20, 2024
735bf21
Fix batching
unalmis Dec 21, 2024
059f217
Set default automorphism to None to simplify for user
unalmis Dec 21, 2024
d62435c
Simplify api for user (#1487)
unalmis Dec 21, 2024
441630d
Merge branch 'nan_debug' into ku/fourier_bounce_neo
unalmis Dec 22, 2024
2cb0f3e
Remove softargmax interp to argmin now that nan gradient identified
unalmis Dec 22, 2024
08b31b2
Merge branch 'master' into ku/fourier_bounce_neo
unalmis Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Changelog
=========

New Feature
New Features
unalmis marked this conversation as resolved.
Show resolved Hide resolved

- Bounce integral methods with ``desc.integrals.Bounce2D``.
- Effective ripple ``desc.objectives.EffectiveRipple`` and Gamma_c ``desc.objectives.Gamma_c`` optimization objectives.
- See GitHub pull requests [#1003](https://github.com/PlasmaControl/DESC/pull/1003), [#1042](https://github.com/PlasmaControl/DESC/pull/1042), [#1119](https://github.com/PlasmaControl/DESC/pull/1119), and [#1290](https://github.com/PlasmaControl/DESC/pull/1290) for more details.
- Many new compute quantities for partial derivatives in different coordinate systems.
- Adds a new profile class ``PowerProfile`` for raising profiles to a power.
- Add ``desc.objectives.LinkingCurrentConsistency`` for ensuring that coils in a stage 2 or single stage optimization provide the required linking current for a given equilibrium.
- Adds an option ``scaled_termination`` (defaults to True) to all of 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 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}``.
- ``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``.
Expand All @@ -14,11 +18,14 @@ Bug Fixes

- Small bug fix to use the correct normalization length ``a`` in the BallooningStability objective.
- Fixed I/O bug when saving/loading ``_Profile`` classes that do not have a ``_params`` attribute.
- Minor bugs described in [#1323](https://github.com/PlasmaControl/DESC/pull/1323).
- Corrects basis vectors computations made on surface objects [#1175](https://github.com/PlasmaControl/DESC/pull/1175).

v0.13.0
-------

New Features

- 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 function ``solve_regularized_surface_current`` to ``desc.magnetic_fields`` module that implements the REGCOIL algorithm (Landreman, (2017)) for surface current normal field optimization
* 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)
Expand Down
9 changes: 9 additions & 0 deletions desc/batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ def _chunk_vmapped_function(
return functools.partial(_eval_fun_in_chunks, vmapped_fun, chunk_size, argnums)


def batch_map(fun, fun_input, batch_size):
"""Compute vectorized ``fun`` in batches."""
return (
fun(fun_input)
if batch_size is None
else _eval_fun_in_chunks(fun, batch_size, (0,), fun_input)
)


def _parse_in_axes(in_axes):
if isinstance(in_axes, int):
in_axes = (in_axes,)
Expand Down
1 change: 1 addition & 0 deletions desc/compute/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
_bootstrap,
_core,
_curve,
_deprecated,
_equil,
_field,
_geometry,
Expand Down
Loading
Loading