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

Vectorize omnigenity objective over multiple surfaces #1225

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

f0uriest
Copy link
Member

No description provided.

@f0uriest f0uriest requested a review from ddudt August 27, 2024 02:55
@f0uriest f0uriest marked this pull request as draft August 27, 2024 02:57
f0uriest added a commit that referenced this pull request Sep 2, 2024
- [x] Allows the calculation of `B_mn` on tensor product grids with
multiple flux surfaces.
- [x] Allows `QuasisymmetryBoozer` objective to target multiple surfaces
at once
~- [ ] Allows `Omnigenity` objective to target multiple surfaces at
once~ moved to #1225
- [x] Simplify boozer/QS plotting functions

Resolves #754
Base automatically changed from rc/boozer to master September 2, 2024 20:25
Copy link
Contributor

github-actions bot commented Sep 6, 2024

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_midres         |     -0.20 +/- 5.86     | -1.34e-03 +/- 3.84e-02 |  6.54e-01 +/- 3.6e-02  |  6.55e-01 +/- 1.4e-02  |
 test_build_transform_fft_highres        |     -3.69 +/- 5.44     | -3.65e-02 +/- 5.39e-02 |  9.53e-01 +/- 5.2e-02  |  9.90e-01 +/- 1.4e-02  |
 test_equilibrium_init_lowres            |     -0.16 +/- 20.26    | -6.20e-03 +/- 7.88e-01 |  3.88e+00 +/- 5.6e-01  |  3.89e+00 +/- 5.6e-01  |
 test_objective_compile_atf              |     +0.55 +/- 6.88     | +4.34e-02 +/- 5.44e-01 |  7.95e+00 +/- 2.1e-01  |  7.91e+00 +/- 5.0e-01  |
 test_objective_compute_atf              |     +6.54 +/- 2.47     | +6.84e-04 +/- 2.59e-04 |  1.11e-02 +/- 2.0e-04  |  1.05e-02 +/- 1.7e-04  |
 test_objective_jac_atf                  |     -0.34 +/- 2.99     | -6.60e-03 +/- 5.79e-02 |  1.93e+00 +/- 4.2e-02  |  1.94e+00 +/- 3.9e-02  |
 test_perturb_1                          |     -3.36 +/- 12.69    | -4.85e-01 +/- 1.83e+00 |  1.40e+01 +/- 1.4e+00  |  1.44e+01 +/- 1.2e+00  |
 test_proximal_jac_atf                   |     +0.36 +/- 3.37     | +2.98e-02 +/- 2.76e-01 |  8.22e+00 +/- 2.1e-01  |  8.19e+00 +/- 1.8e-01  |
+test_proximal_freeb_compute             |     -3.21 +/- 0.95     | -6.56e-03 +/- 1.94e-03 |  1.98e-01 +/- 7.8e-04  |  2.04e-01 +/- 1.8e-03  |
 test_build_transform_fft_lowres         |     +7.54 +/- 5.46     | +3.90e-02 +/- 2.82e-02 |  5.56e-01 +/- 2.7e-02  |  5.17e-01 +/- 9.7e-03  |
 test_equilibrium_init_medres            |     +1.00 +/- 2.09     | +4.10e-02 +/- 8.57e-02 |  4.15e+00 +/- 6.6e-02  |  4.11e+00 +/- 5.4e-02  |
 test_equilibrium_init_highres           |     +0.21 +/- 1.91     | +1.14e-02 +/- 1.03e-01 |  5.41e+00 +/- 5.4e-02  |  5.40e+00 +/- 8.8e-02  |
 test_objective_compile_dshape_current   |     -0.15 +/- 1.33     | -5.87e-03 +/- 5.13e-02 |  3.87e+00 +/- 3.1e-02  |  3.87e+00 +/- 4.1e-02  |
 test_objective_compute_dshape_current   |     -0.26 +/- 1.58     | -9.52e-06 +/- 5.70e-05 |  3.61e-03 +/- 4.5e-05  |  3.62e-03 +/- 3.4e-05  |
 test_objective_jac_dshape_current       |     -0.58 +/- 7.23     | -2.26e-04 +/- 2.84e-03 |  3.91e-02 +/- 9.9e-04  |  3.93e-02 +/- 2.7e-03  |
 test_perturb_2                          |     +0.51 +/- 2.04     | +9.57e-02 +/- 3.86e-01 |  1.90e+01 +/- 3.3e-01  |  1.89e+01 +/- 2.1e-01  |
 test_proximal_freeb_jac                 |     -0.01 +/- 1.22     | -9.24e-04 +/- 9.11e-02 |  7.47e+00 +/- 7.5e-02  |  7.47e+00 +/- 5.2e-02  |
 test_solve_fixed_iter                   |     -0.32 +/- 54.50    | -1.59e-02 +/- 2.74e+00 |  5.02e+00 +/- 2.0e+00  |  5.04e+00 +/- 1.8e+00  |

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.52%. Comparing base (51d637c) to head (bfb5651).
Report is 50 commits behind head on master.

Files with missing lines Patch % Lines
desc/objectives/_omnigenity.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1225      +/-   ##
==========================================
+ Coverage   95.50%   95.52%   +0.02%     
==========================================
  Files          96       96              
  Lines       24028    24057      +29     
==========================================
+ Hits        22948    22981      +33     
+ Misses       1080     1076       -4     
Files with missing lines Coverage Δ
desc/compute/_omnigenity.py 100.00% <100.00%> (ø)
desc/objectives/_omnigenity.py 97.06% <95.00%> (+0.69%) ⬆️

... and 1 file with indirect coverage changes

---- 🚨 Try these New Features:

@f0uriest f0uriest requested review from dpanici, daniel-dudt, a team, rahulgaur104, kianorr, sinaatalay, unalmis and YigitElma and removed request for a team November 14, 2024 05:24
@f0uriest f0uriest marked this pull request as ready for review November 14, 2024 05:24
field_grid : Grid, optional
Collocation grid containing the nodes to evaluate at for omnigenous field data.
The grid nodes are given in the usual (ρ,θ,ζ) coordinates (with θ ∈ [0, 2π),
ζ ∈ [0, 2π/NFP)), but θ is mapped to η and ζ is mapped to α. Defaults to a
linearly space grid on the rho=1 surface. Must be a single flux surface without
stellarator symmetry.
linearly space grid on the rho=1 surface. Must be without stellarator symmetry.
M_booz : int, optional
Poloidal resolution of Boozer transformation. Default = 2 * eq.M.
N_booz : int, optional
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably discussed during the first PR but can we change the docs of eq_fixed at line 536 to say "only the field is allowed to change" or something on that front? The user probably doesn't know what self.things mean

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for line 542

# the order will be different but the values should be the same so we sort
# before comparing
np.testing.assert_allclose(
np.sort(np.concatenate([f1, f2])), np.sort(f3), atol=1e-14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the order different exactly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants