Skip to content

Stopping power functions with MeV energy units - #304

Open
witNie wants to merge 8 commits into
masterfrom
stopping-power-mev-units
Open

witNie wants to merge 8 commits into
masterfrom
stopping-power-mev-units

Conversation

@witNie

@witNie witNie commented Sep 28, 2026

Copy link
Copy Markdown

No description provided.

@witNie
witNie marked this pull request as ready for review September 30, 2026 20:00
Comment thread include/AT_StoppingPower.h Outdated
Comment thread include/AT_StoppingPower.h Outdated

@grzanka grzanka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments inline

Comment thread include/AT_StoppingPower.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The additions are small, correct, delegate to existing well-established routines with proper unit conversion, and the only findings are optional robustness nits around unchecked allocations.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR extends the stopping-power API in the libamtrack C library by adding convenience functions that accept total kinetic energy in MeV (rather than the library's native MeV/u). Each new MeV-based array function converts the input energies to MeV/u via AT_E_MeV_u_from_E_MeV (per-particle, using the atomic weight) and delegates to the existing _with_no routines. The PR also adds single-particle wrappers for both MeV and MeV/u inputs, improving ergonomics for callers that work with one particle at a time.

Changes:

  • Added array functions AT_Mass_Stopping_Power_E_MeV_with_no and AT_Stopping_Power_E_MeV_with_no that convert MeV→MeV/u before computing stopping power.
  • Added single-particle wrappers: AT_Stopping_Power_E_MeV_single, AT_Mass_Stopping_Power_E_MeV_single, AT_Stopping_Power_E_MeV_u_single, and AT_Mass_Stopping_Power_E_MeV_u_single.
  • Added matching Doxygen-documented declarations in the public header.
File Description
src/​AT_StoppingPower.c Implements the new MeV-based array functions (with per-particle unit conversion) and the four single-particle wrappers; delegates to existing _with_no routines.
include/​AT_StoppingPower.h Declares the new functions with consistent Doxygen documentation describing units and conversion behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/AT_StoppingPower.c
@witNie witNie added the ready label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants