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

Add wb and wp to VMECIO.save #1475

Merged
merged 5 commits into from
Dec 18, 2024
Merged

Add wb and wp to VMECIO.save #1475

merged 5 commits into from
Dec 18, 2024

Conversation

ddudt
Copy link
Collaborator

@ddudt ddudt commented Dec 16, 2024

Adds two additional quantities to the VMEC "wout" output. They are normalized versions of our "W_B" and "W_p" compute quantities.

@ddudt ddudt added the easy Short and simple to code or review label Dec 16, 2024
@ddudt ddudt requested review from f0uriest and dpanici December 16, 2024 23:35
@ddudt ddudt self-assigned this Dec 16, 2024
wb[:] = data_quad["W_B"] * mu_0 / (4 * np.pi**2)

wp = file.createVariable("wp", np.float64)
wp.long_name = "plasma thermodynamic energy * mu_0/(4*pi^2)"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the $4\pi^2$ factor is related to the normalization for vp

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.62%. Comparing base (c1cf058) to head (22174d0).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1475   +/-   ##
=======================================
  Coverage   95.62%   95.62%           
=======================================
  Files          98       98           
  Lines       25420    25420           
=======================================
+ Hits        24307    24309    +2     
+ Misses       1113     1111    -2     
Files with missing lines Coverage Δ
desc/vmec.py 91.88% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Contributor

github-actions bot commented Dec 17, 2024

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_lowres         |     +3.30 +/- 13.46    | +1.73e-02 +/- 7.08e-02 |  5.43e-01 +/- 7.0e-02  |  5.26e-01 +/- 1.2e-02  |
 test_equilibrium_init_medres            |     +3.43 +/- 9.81     | +1.42e-01 +/- 4.05e-01 |  4.27e+00 +/- 4.0e-01  |  4.12e+00 +/- 3.1e-02  |
 test_equilibrium_init_highres           |     +0.93 +/- 0.96     | +5.00e-02 +/- 5.16e-02 |  5.42e+00 +/- 3.9e-02  |  5.37e+00 +/- 3.4e-02  |
 test_objective_compile_dshape_current   |     -0.01 +/- 0.70     | -3.64e-04 +/- 2.75e-02 |  3.93e+00 +/- 2.2e-02  |  3.93e+00 +/- 1.7e-02  |
 test_objective_compute_dshape_current   |     -0.10 +/- 3.21     | -5.26e-06 +/- 1.65e-04 |  5.15e-03 +/- 9.4e-05  |  5.16e-03 +/- 1.4e-04  |
 test_objective_jac_dshape_current       |     -1.55 +/- 9.00     | -6.72e-04 +/- 3.90e-03 |  4.26e-02 +/- 2.5e-03  |  4.33e-02 +/- 3.0e-03  |
 test_perturb_2                          |     -1.25 +/- 2.05     | -2.48e-01 +/- 4.07e-01 |  1.96e+01 +/- 3.5e-01  |  1.99e+01 +/- 2.0e-01  |
 test_proximal_freeb_jac                 |     -1.90 +/- 0.79     | -1.42e-01 +/- 5.90e-02 |  7.31e+00 +/- 3.3e-02  |  7.45e+00 +/- 4.9e-02  |
 test_solve_fixed_iter                   |     +0.26 +/- 2.37     | +8.75e-02 +/- 7.86e-01 |  3.32e+01 +/- 5.3e-01  |  3.31e+01 +/- 5.8e-01  |
 test_LinearConstraintProjection_build   |     -0.38 +/- 2.74     | -3.84e-02 +/- 2.81e-01 |  1.02e+01 +/- 2.2e-01  |  1.02e+01 +/- 1.8e-01  |
 test_build_transform_fft_midres         |     +8.41 +/- 6.51     | +5.06e-02 +/- 3.92e-02 |  6.52e-01 +/- 3.2e-02  |  6.01e-01 +/- 2.2e-02  |
 test_build_transform_fft_highres        |     +3.54 +/- 4.34     | +3.47e-02 +/- 4.26e-02 |  1.01e+00 +/- 2.6e-02  |  9.80e-01 +/- 3.4e-02  |
 test_equilibrium_init_lowres            |     +2.56 +/- 3.00     | +9.68e-02 +/- 1.13e-01 |  3.88e+00 +/- 3.7e-02  |  3.79e+00 +/- 1.1e-01  |
 test_objective_compile_atf              |     -0.15 +/- 4.60     | -1.18e-02 +/- 3.71e-01 |  8.07e+00 +/- 2.0e-01  |  8.08e+00 +/- 3.1e-01  |
 test_objective_compute_atf              |     -0.22 +/- 2.09     | -3.41e-05 +/- 3.31e-04 |  1.58e-02 +/- 2.2e-04  |  1.58e-02 +/- 2.5e-04  |
 test_objective_jac_atf                  |     -1.04 +/- 2.45     | -2.05e-02 +/- 4.82e-02 |  1.94e+00 +/- 4.1e-02  |  1.96e+00 +/- 2.5e-02  |
 test_perturb_1                          |     +0.81 +/- 5.19     | +1.18e-01 +/- 7.59e-01 |  1.48e+01 +/- 5.1e-01  |  1.46e+01 +/- 5.6e-01  |
 test_proximal_jac_atf                   |     +0.39 +/- 0.93     | +3.22e-02 +/- 7.61e-02 |  8.24e+00 +/- 6.1e-02  |  8.20e+00 +/- 4.5e-02  |
 test_proximal_freeb_compute             |     -0.58 +/- 1.07     | -1.15e-03 +/- 2.13e-03 |  1.98e-01 +/- 1.6e-03  |  1.99e-01 +/- 1.5e-03  |
 test_solve_fixed_iter_compiled          |     -2.48 +/- 2.94     | -5.51e-01 +/- 6.55e-01 |  2.17e+01 +/- 3.6e-01  |  2.23e+01 +/- 5.4e-01  |

dpanici
dpanici previously approved these changes Dec 17, 2024
Copy link
Member

@f0uriest f0uriest left a comment

Choose a reason for hiding this comment

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

Fix units

@ddudt ddudt merged commit 93d2564 into master Dec 18, 2024
25 checks passed
@ddudt ddudt deleted the dd/wb branch December 18, 2024 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Short and simple to code or review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants