SkillAgentSearch skills...

PB3D

High-n peeling ballooning MHD stability in 3-D

Install / Use

/learn @ToonWeyens/PB3D
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PB3D

Peeling Ballooning in 3D

by Toon Weyens (2012-2018)

  • ITER Organization
  • Eindhoven University of Technology
  • Universidad Carlos III de Madrid

The homepage can be found at https://pb3d.github.io. For example, have a look at https://pb3d.github.io/Doxygen/html/index.html for the documentation.


Also, have a look at https://github.com/ToonWeyens/PB3D_tools for auxiliary tools, among others, a user-friendly way to run the program on multiple systems:

  • Automatic support for HPC job schedulers PBS and SLURM.
  • Easy parameter scans.
  • Configurable and modifiable

Changelog

2.47:

  • Modernized build system: migrated from Makefile to CMake.
  • Added Spack environment support for portable dependency management.
  • Old Makefile preserved as Makefile.legacy for reference.
  • Added Documentation/spack-setup.md with build instructions.

2.46:

  • Fixed bug in interp_V_spline where 2-point interpolation cases crashed because EZspline requires at least 3 points. Now uses vectorized manual linear interpolation for 2-point cases.

2.45:

  • Cleaned up, removed errenous vacuum warnings.

2.44:

  • Cleaned up.

2.43:

  • Fixed show-stopper bug that caused the mode numbers to wrongly used in the vacuum response calculation.

2.42:

  • Fixed bug in create_VMEC_input: Equilibria without added perturbation were not yet adapted so that no negative poloidal modes appeared.

2.41:

  • Added check for problematic filenames with a dot in the VMEC files.
  • Default order for coord_F2E is now 1, as there appeared to be a problem with very large corrections for order 2 at specific points for ITER cases.
  • Guess in coord_F2E is now 2nd order.

2.40:

  • Fixed important bug where check on reverse shear regions was wrong and virtually no simulations would ever run.
  • Improved output of this check.

2.39:

  • Added check for nonpositive coordinate systems and reversed shear regions.
  • Adapted spline to handle monotonously decreasing abscissae as well as the increasing ones.
  • Fixed bug in plot_diff_for_paper where the wrong dimension was taken in the plots.
  • Fixed bug in plot_derived_q where the untrimmed grid was taken wrongly.
  • Fixed bug in print_HDF5_arrs where the head group was not closed before being deleted, which gave errors when jumping to solution.

2.38:

  • Fixed bug where min and max alpha were passed as integer, instead of real, which leads to serious rounding off errors.

2.37:

  • Fixed important bug for HELENA where the wrong indices were passed when calculating the shear.
  • Improved EZspline usage in num_utilities so that it should also work if the library has slightly different kinds for doubles than PB3D.

2.36:

  • The setup_modes routine was still buggy, and this has been fixed by simplifying the part where n and m are set up..
  • Fixed a bug in setup_modes when only one mode was used.
  • The structure of the calc_derived_q has been extensively rewritten. Mostly for HELENA there are large changes in order to be able to use the best option, which often does not coincide with the VMEC best option.
  • Further improved plotting of debug_calc_derived_q; It should work well with multiple equilibrium jobs as well now.

2.35:

  • Fixed bug in setup_modes where incorrect rounding of secondary mode limits led in some cases to the incorrect calculation of the mode numbers in each flux surface.
  • This sometimes led to the appearance of non-physical normal modes centered around the flux surfaces where even a slight error was made.
  • Improved plotting of debug_calc_derived_q.
  • setup_modes now does not use a trimmed grid, which was wrong before.
  • n_ivs_copies has been superceded by ivs_stats to give more detailed statistics about interp_V_spline.

2.34:

  • Fixed an important bug in interp_V where the output secondary mode indices were wrongly used for the selection of the input V_i. While it is true that the mode numbers have to be equal, this is not so for the array indices.
  • Renamed Run directory to Examples.
  • Moved all run scripts and auxiliary scripts to the PB3D_tools repository.
  • Examples now only contains sample input files.

2.33:

  • Rewrote the runscript using python, resulting in run.py as a replacement for run.sh.
  • Put it in a separate repository.
  • Updated to new PETSc 3.9.2 and accompanying SLEPc 3.9.1.
  • Updated makefile to fix a bug that appeared with these new PETSc and SLEPc.
  • Adapted to run on the new ITER 2018 cluster.
  • Fixed a bug in HDF5 where file ID's were of the incorrect integer format.
  • Fixed important bug in SLEPC_ops where the variable n_r was not initialized when setting the boundary conditions.

2.32:

  • FIXED THE PROBLEM WITH TRULY TERRIBLE PARALLEL CURRENT CALCULATION IN 3-D.
  • The parallel current is now calculated using new theory, in a way combined wihh the shear.
  • The results works for 3-D equilibria as well.

2.31:

  • THERE WERE RATHER LARGE BUGS IN EXPORT TO VMEC, WHICH HAVE BEEN FIXED AND CHECKED.
  • Testing with circular tokamak when exporting HELENA to VMEC in create_VMEC_input now is a real test.
  • nufft does not use pspline with periodic boundary conditions any more, as this was found not to work well and introduce errors in the fft; It now uses standard not-a-knot conditions with a large overlap.
  • In extend_grid_F, the variable r_E is now set by directly copying from the input grid, and in contrast to the previous method, this also works for grids that have limits not corresponding to the absolute minimum and maximum.
  • In driver_POST, divide_eq_jobs is now called with the correct normal ranges when they don't coincide with the PB3D normal ranges.
  • Rewrote create_VMEC_input to correct an important bug where some modes were not correctly shifted because those that were supposed to be shifted to a negative value were just discarded.
  • This bug caused top-bottom symmetrical perturbations to be actually not symmetrical, so it might be responsible for many of the problems found previously.
  • In the calculation of toroidal differences in calc_tor_diff, division by zero is now explicitely avoided.
  • Changed the method to calculate maximum perturbation at midplane in create_VMEC_input to also include the sine factors.

2.30:

  • Fixed important bug where sigma was calculated wrongly in calc_derived_q for VMEC when using multiple processes because the VMEC variables were wrongly used.
  • Restructered and debugged the Richardson extrapolation and jumping to solution options.
  • Fixed bug in print_output_in for HELENA where the array sizes for h_H were wrong.
  • Fixed some memory leaks.

2.29:

  • Fixed bug in calc_XUQ where for multiple MPI processes, the normal range was not limited for each mode to the current rank's range.
  • Fixed bug when solution modes were not calculated for Richardson restart.
  • Fixed multiple bugs that occured when not running in debug mode.
  • Vacuum is now completely bypassed, temporarily.

2.28:

  • Partly reverted changes in 2.22 where modes were not set up anymore when jumping to solution.
  • Now, the solution modes are set up in the solution driver.
  • Furthermore, the perturbation modes, as well as the general mode variables are set up in the perturbation driver.
  • The secondary modes output in setup_modes is fancified.
  • Trigonometric factors are now also copied when copying a grid.
  • Implemented some of Holoborodko's formula's to calculate smoothing second finite differences in calc_D2_smooth.
  • The problem, however, is that the result lags behind for left-sided finite differences. The functionality is therefore not yet used and put in debug mode.
  • Fixed an important bug that was introduced in version 2.18 where the derivatives of R and Z for VMEC were not calculated to high enough accuracy.

2.27:

  • Fixed bug in interp_V where the fact that the perturbation grid encompasses the solution grid but does not necessarily coincide was forgotten.
  • This was done implementing a new procedure trim_modes in X_utilities.
  • A similar bug was fixed in calc_XUQ.
  • Fixed bug in calc_norm_range_PB3D_X where negative shear caused the procedure to break.
  • Fixed bug in setup_modes where the closing of the last modes was wrong when there had been a region of negative shear.

2.26:

  • Rewrote commit system.
  • Started signing commits and tags.

2.25:

  • 2-D VMEC now works as well as 2-D HELENA, including energy reconstruction.
  • L_E and T_FE are no longer deallocated, as it is necessary for the calculation of derived quantities.
  • Rewrote calc_derived_q to calculate the curvatures without making use of normal derivatives.
  • Rewrote calc_derived_q for VMEC to calculate the local shear directly from VMEC output to avoid numerical problems.
  • Fixed bug in plot_sol_vec where trigonometric factors were not copied to output grid for VMEC.

2.24:

  • Removed .backup.
  • Reordered changelog using vim magic from https://vi.stackexchange.com/a/15123.
  • Merged Doxygen documentation to this repository under /docs.
  • Included source browser in Doxygen.
  • Fixed Doxygen errors.
  • The new documentation website is https://pb3d.github.io/Doxygen/html/index.html.
  • Updated input parameters of Doxygen.
  • Removed V_interp_style as it was not used because everything is done with splines.
  • Removed relax_fac_HH as has not been used any more for a long time.

2.23:

  • THIS VERSION DOES NOT HAVE VMEC WORKING YET BUT HELENA SHOULD DO JUST FINE, INCLUDING ENERGY RECONSTRUCTION.
  • Opened up source on Github.
  • Added licence.

2.22:

  • TOP-BOTTOM ASYMMETRIC HELENA EQUILIBRIA HAS BEEN IMPROVED TO BETTER ENERGY RECONSTRUCTION.
  • Fixed bug in driver_X, where modes were set up when jumping to solution.
  • Implemented a test to invert top-bottom asymmetric HELENA equilibria through run-time argument --invert_top_bottom_H.
  • Fixed bug in clean up

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated2mo ago
Forks0

Languages

Fortran

Security Score

75/100

Audited on Jan 30, 2026

No findings