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

Implement cubic spline interpolation #1607

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

amandalund
Copy link
Contributor

This implements cubic spline interpolation, which is the default spline interpolation in Geant4. This was motivated by wanting to avoid updating a bunch of test results when we construct our own physics tables (#1544) and because it could eliminate the interpolation method as the reason for any discrepancies when doing physics comparisons.

There are options for using natural or not-a-knot boundary conditions: the latter is supposedly what's used by Geant4, but the second derivatives calculated using Geant4's code don't seem to match the expected values, so for now there's also a hack to optionally calculate the derivatives by exactly matching what Geant4 does.

Currently this is just hooked up in the XsCalculator, which is all that's needed for the range grid calculation, but it would be easy to support this in the non-uniform calculator and to optionally calculate the derivatives for the physics grids (so we can do some studies comparing all our interpolation methods). With this we can construct a range table that exactly matches the imported values.

@amandalund amandalund added enhancement New feature or request physics Particles, processes, and stepping algorithms labels Feb 3, 2025
@amandalund amandalund requested a review from sethrj February 3, 2025 02:13
@amandalund amandalund force-pushed the cubic-spline branch 3 times, most recently from 5a454ba to 4006b6e Compare February 3, 2025 02:41
Copy link

github-actions bot commented Feb 3, 2025

Test summary

 4 535 files   6 961 suites   15m 34s ⏱️
 1 708 tests  1 702 ✅  6 💤 0 ❌
24 465 runs  24 381 ✅ 84 💤 0 ❌

Results for commit b5fa9d4.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request physics Particles, processes, and stepping algorithms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant