@@ -82,6 +82,7 @@ pub use crate::output::{OutputUnits};
8282pub use crate :: geometry:: { Geometry , GeometryElement , Mesh0D , Mesh1D , Mesh2D } ;
8383pub use crate :: sphere:: { Sphere , SphereInput , InputSphere } ;
8484pub use crate :: math:: * ;
85+ pub use crate :: material:: * ;
8586
8687#[ cfg( feature = "parry3d" ) ]
8788pub use crate :: parry:: { ParryBall , ParryBallInput , InputParryBall , ParryTriMesh , ParryTriMeshInput , InputParryTriMesh } ;
@@ -100,6 +101,8 @@ pub fn libRustBCA(py: Python, m: &PyModule) -> PyResult<()> {
100101 m. add_function ( wrap_pyfunction ! ( reflection_coefficient, m) ?) ?;
101102 m. add_function ( wrap_pyfunction ! ( compound_reflection_coefficient, m) ?) ?;
102103 m. add_function ( wrap_pyfunction ! ( reflect_single_ion_py, m) ?) ?;
104+ m. add_function ( wrap_pyfunction ! ( electronic_stopping_cross_sections, m) ?) ?;
105+ m. add_function ( wrap_pyfunction ! ( reflect_single_ion_py, m) ?) ?;
103106 #[ cfg( feature = "parry3d" ) ]
104107 m. add_function ( wrap_pyfunction ! ( rotate_given_surface_normal_py, m) ?) ?;
105108 #[ cfg( feature = "parry3d" ) ]
@@ -828,8 +831,29 @@ pub extern "C" fn simple_bca_c(x: f64, y: f64, z: f64, ux: f64, uy: f64, uz: f64
828831 }
829832}
830833
834+ #[ cfg( feature="python" ) ]
835+ #[ pyfunction]
836+ ///electronic_stopping_cross_sections(Za, Zb, E, Ma, ck)
837+ /// uses RustBCA internal functions to calculate electronic stopping power cross-sections
838+ /// Args:
839+ /// Za (f64): atomic number of ion
840+ /// Zb (f64): atomic number of target
841+ /// E (f64): ion energy in eV
842+ /// Ma (f64): ion mass in AMU
843+ /// ck (f64): LS correction factor
844+ /// ci (f64): BV custom interp. weight
845+ /// Returns:
846+ /// (Lindhard-Scharff [eV m^2], Bethe-Bloch [eV m^2], Biersack-Varelas [eV m^2], Biersack-Varelas with custom interp. weight [eV m^2])
847+ pub fn electronic_stopping_cross_sections ( Za : f64 , Zb : f64 , E : f64 , Ma : f64 , ck : f64 , ci : f64 ) -> ( f64 , f64 , f64 , f64 ) {
848+
849+ let S_low = lindhard_scharff_stopping_power_cross_section ( Za , Zb , E * EV , Ma * AMU ) ;
850+ let S_high = bethe_bloch_stopping_power_cross_section ( Za , Zb , E * EV , Ma * AMU ) ;
851+
852+ ( S_low * ck/EV , S_high /EV , 1. /( 1. /( S_high ) + 1. /( S_low * ck) ) /EV , ( S_high . powf ( -ci) + ( S_low * ck) . powf ( -ci) ) . powf ( -1. /ci) /EV )
853+ }
854+
831855#[ cfg( feature = "python" ) ]
832- ///compound_\\\\\\_bca_list_py (ux, uy, uz, energy, Z1, m1, Ec1, Es1, Z2, m2, Ec2, Es2, n2, Eb2)
856+ ///compound_bca_list_py (ux, uy, uz, energy, Z1, m1, Ec1, Es1, Z2, m2, Ec2, Es2, n2, Eb2)
833857/// runs a BCA simulation for a list of particles and outputs a list of sputtered, reflected, and implanted particles.
834858/// Args:
835859/// energies (list(f64)): initial ion energies in eV.
0 commit comments