PB3D
High-n peeling ballooning MHD stability in 3-D
Install / Use
/learn @ToonWeyens/PB3DREADME
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.legacyfor reference. - Added
Documentation/spack-setup.mdwith build instructions.
2.46:
- Fixed bug in
interp_V_splinewhere 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_F2Eis 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_F2Eis 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
splineto handle monotonously decreasing abscissae as well as the increasing ones. - Fixed bug in
plot_diff_for_paperwhere the wrong dimension was taken in the plots. - Fixed bug in
plot_derived_qwhere the untrimmed grid was taken wrongly. - Fixed bug in
print_HDF5_arrswhere 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_utilitiesso that it should also work if the library has slightly different kinds for doubles than PB3D.
2.36:
- The
setup_modesroutine was still buggy, and this has been fixed by simplifying the part where n and m are set up.. - Fixed a bug in
setup_modeswhen only one mode was used. - The structure of the
calc_derived_qhas 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_modeswhere 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_modesnow does not use a trimmed grid, which was wrong before.n_ivs_copieshas been superceded byivs_statsto give more detailed statistics aboutinterp_V_spline.
2.34:
- Fixed an important bug in
interp_Vwhere the output secondary mode indices were wrongly used for the selection of the inputV_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_toolsrepository. Examplesnow only contains sample input files.
2.33:
- Rewrote the runscript using python, resulting in
run.pyas a replacement forrun.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_opswhere the variablen_rwas 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_inputnow is a real test. nufftdoes 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 variabler_Eis 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_jobsis now called with the correct normal ranges when they don't coincide with the PB3D normal ranges. - Rewrote
create_VMEC_inputto 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_inputto also include the sine factors.
2.30:
- Fixed important bug where
sigmawas calculated wrongly incalc_derived_qfor 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_infor HELENA where the array sizes forh_Hwere wrong. - Fixed some memory leaks.
2.29:
- Fixed bug in
calc_XUQwhere 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_modesis 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_Vwhere 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_modesinX_utilities. - A similar bug was fixed in
calc_XUQ. - Fixed bug in
calc_norm_range_PB3D_Xwhere negative shear caused the procedure to break. - Fixed bug in
setup_modeswhere 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_EandT_FEare no longer deallocated, as it is necessary for the calculation of derived quantities.- Rewrote
calc_derived_qto calculate the curvatures without making use of normal derivatives. - Rewrote
calc_derived_qfor VMEC to calculate the local shear directly from VMEC output to avoid numerical problems. - Fixed bug in
plot_sol_vecwhere 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
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
