Skip to content

add sputtering_reflection_compounds fn + gitignore #278

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jguterl
Copy link

@jguterl jguterl commented Apr 17, 2025

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 # (issue)

Description

add a function binded in python to compute sputtering and reflection in 0D for a compound

Tests

Please describe how the changes in this pull request have been tested, including system information such as OS.

Copy link
Collaborator

@drobnyjt drobnyjt left a comment

Choose a reason for hiding this comment

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

Looks good to me with that one variable name change. Thanks!

let num_reflected = *num_reflected.lock().unwrap();
let energy_reflected = *energy_reflected.lock().unwrap();
let num_sputtered = num_sputtered.lock().unwrap();
let num_sputtered_: Vec<f64> = num_sputtered.iter().map(|&x| x / num_samples as f64).collect();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend a name change of this variable from num_sputtered_ to sputtering_yield or partial_sputtering_yields or similar. It's not super important, but since it's a return value, someone looking at the last line of the function might expect total counts instead of yields

@@ -106,6 +107,15 @@ pub fn libRustBCA(py: Python, m: &PyModule) -> PyResult<()> {
Ok(())
}

pub fn find_index(Z: f64, Z2: &[f64]) -> Option<usize> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, one more thought - indexing by Z could present a problem. What happens when someone wants to simulate a target of, for example, 90% Li-6 and 10% Li-7?

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.

2 participants