Skip to content

Added warning when input includes zero-length electronic stopping cor… #260

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

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl Geometry for Mesh0D {
let electronic_stopping_correction_factor = input.electronic_stopping_correction_factor;

let densities: Vec<f64> = input.densities.iter().map(|element| element/(length_unit).powi(3)).collect();
assert!(densities.len() > 0, "Input Error: density list empty.");

let total_density: f64 = densities.iter().sum();

Expand Down Expand Up @@ -135,6 +136,7 @@ impl Geometry for Mesh1D {

let layer_thicknesses = geometry_input.layer_thicknesses.clone();
let electronic_stopping_correction_factors = geometry_input.electronic_stopping_correction_factors.clone();
assert!(electronic_stopping_correction_factors.len() > 0, "Input Error: Electronic stopping correction factor list empty.");
let n = layer_thicknesses.len();

let mut layers: Vec<Layer1D> = Vec::with_capacity(n);
Expand Down Expand Up @@ -433,7 +435,7 @@ impl Geometry for Mesh2D {

let simulation_boundary_points = geometry_input.simulation_boundary_points.clone();
let electronic_stopping_correction_factors = geometry_input.electronic_stopping_correction_factors.clone();

assert!(electronic_stopping_correction_factors.len() > 0, "Input Error: Electronic stopping correction factor list empty.");
let n = triangles.len();

let mut cells: Vec<Cell2D> = Vec::with_capacity(n);
Expand Down