Skip to content

Experimental recoil generation - #315

Merged
drobnyjt merged 26 commits into
devfrom
experimental_recoil_generation
Jul 31, 2026
Merged

Experimental recoil generation#315
drobnyjt merged 26 commits into
devfrom
experimental_recoil_generation

Conversation

@drobnyjt

@drobnyjt drobnyjt commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Thank you for your contribution to rustBCA!

Before submitting this PR, please make sure you have:

  • Opened an issue
  • Referenced the relevant issue number(s) below
  • Provided a description of the changes below
  • Ensured all tests pass and added any necessary tests for new code

Fixes #314, #302

Description

This PR swaps out the custom derived formulas for constructing an orthonormal basis for recoil generation and particle deflection with Duff et al.'s robust formula.

This also rolls in improvements to input validation and rolls-back the electronic stopping change - probably BV stopping needs two different ck for each energy regime?

Tests

cargo test passes with modification to tests.rs for the new orthonormal bases; test_cube.py reproduces the correct behavior. Other results all seem identical within statistical error.

This will break the seeded rng tests.

@drobnyjt
drobnyjt changed the base branch from main to dev July 30, 2026 17:14
@drobnyjt

drobnyjt commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author
image

Testing different branches on make_input_file_and_run.py - improved_duff refers to a branchless but otherwise identical version of the ONB algorithm. Due to the newly implemented determinism, improved_duff is identical to experimental_recoil_generation (which uses the branched version ).

The following should be done too:

  • rotate_given_surface_normal in lib.rs
  • rotate_back in lib.rs

@drobnyjt
drobnyjt merged commit f384630 into dev Jul 31, 2026
2 checks passed
@drobnyjt
drobnyjt deleted the experimental_recoil_generation branch July 31, 2026 05:44
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.

1 participant