Skip to content

RustBCA v3.0.0

Latest

Choose a tag to compare

@drobnyjt drobnyjt released this 11 Aug 00:33
· 5 commits to main since this release
673bd3f

RustBCA 3.0.0

The breaking changes are a new, seeded PRNG and deprecation of HDF5. With version 3.0.0, RustBCA should be faster, more numerically robust, and better tested.

Correctness

  • Fixed Biersack-Varelas stopping power for ck!=1.0; split electronic stopping powers into their own functions and implemented testing of electronic stopping functions.
  • Added additional assertions on Ed, Eb values (must be >0)
  • Implemented recoil generation and particle advance routines using Duff et al.'s orthonormal basis instead of ad hoc switching between two cartesian bases - this should significantly increase the robustness and decrease the errors (when ux ~ 1) involved in the calculation of recoil locations and particle deflection. Additionally, this is slightly faster, as it requires fewer floating point operations.

Optimizations

  • Implemented LazyLock initialized Lookup Tables (LUTs) for functions of (Za, Zb); this offers speedups of up to ~30%, with some new constraints: Za, Zb must be integers, and Z_MAX is currently hardcoded at 120.
  • Changed all unnecessary invocations of powf to powi, sqrt, or cbrt. This change offered a ~5% speedup.
  • Removed some redundant function calls - ~5% speedup.

New features

  • New seeded PRNG; I've implemented a streaming PRNG, ChaCha8, that the user can seed manually. This makes RustBCA deterministic for all functions except some C/Fortran API functions where implementing it would be troublesome to the function calling.
  • New INTERPOLATEDPLUS electronic stopping mode - this mode allows mild adjustments of the Bragg peak magnitude with a new parameter, c_i, in BiersackVarelas stopping, S_BV = ((S_LS)^(-ci) + (S_BB)^(-ci))^(-1/ci).
  • added generalized RustBCA function wrappers; these allow one to call a complete RustBCA simulation from an input file dictionary, with the option to directly output lists of particles to memory or to print files as in the standalone code.

Other changes

  • deprecated HDF5 input
  • minor code cleanup/optimizations throughout
  • added many more integration tests, tightened epsilon on some pre-existing unit tests