Skip to content
Merged
Show file tree
Hide file tree
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 .github/workflows/rustbca_compile_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo apt-get install python3-pip
- name: Install Python libraries
run: |
pip3
pip3
python3 -m pip install numpy shapely scipy
- name: Install python TOML library from source
run: |
Expand All @@ -42,4 +42,6 @@ jobs:
- name: Run Examples
run: |
cargo run --release examples/boron_nitride.toml
cargo run --release 0D examples/boron_nitride_0D.toml
cargo run --release 0D examples/titanium_dioxide_0D.toml
cargo run --release --features distributions examples/layered_geometry.toml
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ name="rustBCA"

[dependencies]
rand = "0.8.3"
geo = "0.17.1"

toml = "0.5.8"
anyhow = "1.0.38"
itertools = "0.10.0"
rayon = "1.5.0"
indicatif = {version="0.15.0", features=["rayon"]}
geo = {version = "0.17.1", optional = false}
indicatif = {version = "0.15.0", features=["rayon"]}
serde = { version = "1.0.123", features = ["derive"] }
hdf5 = {version = "0.7.1", optional = true}
openblas-src = {version = "0.9", optional = true}
Expand All @@ -39,3 +40,5 @@ cpr_rootfinder_netlib = ["rcpr", "netlib-src"]
cpr_rootfinder_intel_mkl = ["rcpr", "intel-mkl-src"]
distributions = ["ndarray"]
no_list_output = []
mesh_0D = []
mesh_2D = []
2 changes: 1 addition & 1 deletion examples/boron_nitride.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,], [ 0.9999999999984769
interaction_index = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
particle_input_filename=""

[mesh_2d_input]
[geometry_input]
length_unit = "MICRON"
energy_barrier_thickness = 1.7645653881793786e-4
triangles = [ [ 0.0, 0.0, 0.0012558103905862675, 0.0, 0.02, 0.019960534568565433,], [ 0.0, 0.0012558103905862675, 0.0025066646712860853, 0.0, 0.019960534568565433, 0.019842294026289557,], [ 0.0, 0.0025066646712860853, 0.003747626291714493, 0.0, 0.019842294026289557, 0.019645745014573775,], [ 0.0, 0.003747626291714493, 0.004973797743297096, 0.0, 0.019645745014573775, 0.01937166322257262,], [ 0.0, 0.004973797743297096, 0.0061803398874989484, 0.0, 0.01937166322257262, 0.019021130325903073,], [ 0.0, 0.0061803398874989484, 0.00736249105369356, 0.0, 0.019021130325903073, 0.018595529717765027,], [ 0.0, 0.00736249105369356, 0.008515585831301454, 0.0, 0.018595529717765027, 0.01809654104932039,], [ 0.0, 0.008515585831301454, 0.009635073482034308, 0.0, 0.01809654104932039, 0.01752613360087727,], [ 0.0, 0.009635073482034308, 0.010716535899579934, 0.0, 0.01752613360087727, 0.0168865585100403,], [ 0.0, 0.010716535899579934, 0.011755705045849463, 0.0, 0.0168865585100403, 0.016180339887498948,], [ 0.0, 0.011755705045849463, 0.012748479794973795, 0.0, 0.016180339887498948, 0.015410264855515783,], [ 0.0, 0.012748479794973795, 0.013690942118573775, 0.0, 0.015410264855515783, 0.014579372548428232,], [ 0.0, 0.013690942118573775, 0.014579372548428232, 0.0, 0.014579372548428232, 0.013690942118573773,], [ 0.0, 0.014579372548428232, 0.015410264855515785, 0.0, 0.013690942118573773, 0.012748479794973793,], [ 0.0, 0.015410264855515785, 0.016180339887498948, 0.0, 0.012748479794973793, 0.011755705045849461,], [ 0.0, 0.016180339887498948, 0.0168865585100403, 0.0, 0.011755705045849461, 0.01071653589957993,], [ 0.0, 0.0168865585100403, 0.017526133600877274, 0.0, 0.01071653589957993, 0.009635073482034304,], [ 0.0, 0.017526133600877274, 0.018096541049320392, 0.0, 0.009635073482034304, 0.008515585831301454,], [ 0.0, 0.018096541049320392, 0.01859552971776503, 0.0, 0.008515585831301454, 0.007362491053693557,], [ 0.0, 0.01859552971776503, 0.019021130325903073, 0.0, 0.007362491053693557, 0.006180339887498949,], [ 0.0, 0.019021130325903073, 0.01937166322257262, 0.0, 0.006180339887498949, 0.004973797743297095,], [ 0.0, 0.01937166322257262, 0.019645745014573775, 0.0, 0.004973797743297095, 0.0037476262917144902,], [ 0.0, 0.019645745014573775, 0.019842294026289557, 0.0, 0.0037476262917144902, 0.0025066646712860853,], [ 0.0, 0.019842294026289557, 0.019960534568565433, 0.0, 0.0025066646712860853, 0.001255810390586266,], [ 0.0, 0.019960534568565433, 0.02, 0.0, 0.001255810390586266, -3.2162452993532734e-18,], [ 0.0, 0.02, 0.019960534568565433, 0.0, -3.2162452993532734e-18, -0.001255810390586268,], [ 0.0, 0.019960534568565433, 0.019842294026289557, 0.0, -0.001255810390586268, -0.0025066646712860875,], [ 0.0, 0.019842294026289557, 0.019645745014573772, 0.0, -0.0025066646712860875, -0.0037476262917144967,], [ 0.0, 0.019645745014573772, 0.01937166322257262, 0.0, -0.0037476262917144967, -0.004973797743297097,], [ 0.0, 0.01937166322257262, 0.019021130325903073, 0.0, -0.004973797743297097, -0.006180339887498951,], [ 0.0, 0.019021130325903073, 0.01859552971776503, 0.0, -0.006180339887498951, -0.00736249105369356,], [ 0.0, 0.01859552971776503, 0.01809654104932039, 0.0, -0.00736249105369356, -0.008515585831301454,], [ 0.0, 0.01809654104932039, 0.01752613360087727, 0.0, -0.008515585831301454, -0.00963507348203431,], [ 0.0, 0.01752613360087727, 0.0168865585100403, 0.0, -0.00963507348203431, -0.010716535899579938,], [ 0.0, 0.0168865585100403, 0.016180339887498948, 0.0, -0.010716535899579938, -0.011755705045849461,], [ 0.0, 0.016180339887498948, 0.015410264855515785, 0.0, -0.011755705045849461, -0.012748479794973795,], [ 0.0, 0.015410264855515785, 0.014579372548428228, 0.0, -0.012748479794973795, -0.013690942118573775,], [ 0.0, 0.014579372548428228, 0.01369094211857377, 0.0, -0.013690942118573775, -0.014579372548428234,], [ 0.0, 0.01369094211857377, 0.01274847979497379, 0.0, -0.014579372548428234, -0.015410264855515788,], [ 0.0, 0.01274847979497379, 0.011755705045849465, 0.0, -0.015410264855515788, -0.016180339887498948,], [ 0.0, 0.011755705045849465, 0.010716535899579934, 0.0, -0.016180339887498948, -0.0168865585100403,], [ 0.0, 0.010716535899579934, 0.009635073482034304, 0.0, -0.0168865585100403, -0.01752613360087727,], [ 0.0, 0.009635073482034304, 0.00851558583130145, 0.0, -0.01752613360087727, -0.018096541049320392,], [ 0.0, 0.00851558583130145, 0.007362491053693555, 0.0, -0.018096541049320392, -0.01859552971776503,], [ 0.0, 0.007362491053693555, 0.006180339887498942, 0.0, -0.01859552971776503, -0.019021130325903073,], [ 0.0, 0.006180339887498942, 0.004973797743297097, 0.0, -0.019021130325903073, -0.01937166322257262,], [ 0.0, 0.004973797743297097, 0.0037476262917144915, 0.0, -0.01937166322257262, -0.019645745014573775,], [ 0.0, 0.0037476262917144915, 0.002506664671286082, 0.0, -0.019645745014573775, -0.019842294026289557,], [ 0.0, 0.002506664671286082, 0.0012558103905862628, 0.0, -0.019842294026289557, -0.019960534568565433,], [ 0.0, 0.0012558103905862628, -6.432490598706547e-18, 0.0, -0.019960534568565433, -0.02,], [ 0.0, -6.432490598706547e-18, -0.0012558103905862669, 0.0, -0.02, -0.019960534568565433,], [ 0.0, -0.0012558103905862669, -0.0025066646712860858, 0.0, -0.019960534568565433, -0.019842294026289557,], [ 0.0, -0.0025066646712860858, -0.0037476262917144954, 0.0, -0.019842294026289557, -0.019645745014573772,], [ 0.0, -0.0037476262917144954, -0.0049737977432971, 0.0, -0.019645745014573772, -0.01937166322257262,], [ 0.0, -0.0049737977432971, -0.0061803398874989545, 0.0, -0.01937166322257262, -0.019021130325903073,], [ 0.0, -0.0061803398874989545, -0.007362491053693567, 0.0, -0.019021130325903073, -0.018595529717765024,], [ 0.0, -0.007362491053693567, -0.008515585831301454, 0.0, -0.018595529717765024, -0.01809654104932039,], [ 0.0, -0.008515585831301454, -0.009635073482034308, 0.0, -0.01809654104932039, -0.01752613360087727,], [ 0.0, -0.009635073482034308, -0.010716535899579936, 0.0, -0.01752613360087727, -0.0168865585100403,], [ 0.0, -0.010716535899579936, -0.011755705045849468, 0.0, -0.0168865585100403, -0.016180339887498944,], [ 0.0, -0.011755705045849468, -0.0127484797949738, 0.0, -0.016180339887498944, -0.015410264855515781,], [ 0.0, -0.0127484797949738, -0.013690942118573775, 0.0, -0.015410264855515781, -0.014579372548428232,], [ 0.0, -0.013690942118573775, -0.014579372548428232, 0.0, -0.014579372548428232, -0.013690942118573773,], [ 0.0, -0.014579372548428232, -0.015410264855515788, 0.0, -0.013690942118573773, -0.01274847979497379,], [ 0.0, -0.015410264855515788, -0.016180339887498948, 0.0, -0.01274847979497379, -0.011755705045849465,], [ 0.0, -0.016180339887498948, -0.016886558510040308, 0.0, -0.011755705045849465, -0.010716535899579927,], [ 0.0, -0.016886558510040308, -0.01752613360087727, 0.0, -0.010716535899579927, -0.009635073482034306,], [ 0.0, -0.01752613360087727, -0.018096541049320396, 0.0, -0.009635073482034306, -0.008515585831301443,], [ 0.0, -0.018096541049320396, -0.01859552971776503, 0.0, -0.008515585831301443, -0.007362491053693556,], [ 0.0, -0.01859552971776503, -0.019021130325903073, 0.0, -0.007362491053693556, -0.006180339887498951,], [ 0.0, -0.019021130325903073, -0.019371663222572624, 0.0, -0.006180339887498951, -0.004973797743297089,], [ 0.0, -0.019371663222572624, -0.019645745014573775, 0.0, -0.004973797743297089, -0.003747626291714493,], [ 0.0, -0.019645745014573775, -0.019842294026289557, 0.0, -0.003747626291714493, -0.0025066646712860745,], [ 0.0, -0.019842294026289557, -0.019960534568565433, 0.0, -0.0025066646712860745, -0.001255810390586264,], [ 0.0, -0.019960534568565433, -0.02, 0.0, -0.001255810390586264, -3.673940397442059e-18,], [ 0.0, -0.02, -0.019960534568565433, 0.0, -3.673940397442059e-18, 0.0012558103905862745,], [ 0.0, -0.019960534568565433, -0.019842294026289557, 0.0, 0.0012558103905862745, 0.0025066646712860845,], [ 0.0, -0.019842294026289557, -0.019645745014573772, 0.0, 0.0025066646712860845, 0.003747626291714503,], [ 0.0, -0.019645745014573772, -0.01937166322257262, 0.0, 0.003747626291714503, 0.004973797743297099,], [ 0.0, -0.01937166322257262, -0.019021130325903073, 0.0, 0.004973797743297099, 0.006180339887498945,], [ 0.0, -0.019021130325903073, -0.018595529717765024, 0.0, 0.006180339887498945, 0.007362491053693565,], [ 0.0, -0.018595529717765024, -0.018096541049320392, 0.0, 0.007362491053693565, 0.008515585831301452,], [ 0.0, -0.018096541049320392, -0.017526133600877267, 0.0, 0.008515585831301452, 0.009635073482034314,], [ 0.0, -0.017526133600877267, -0.0168865585100403, 0.0, 0.009635073482034314, 0.010716535899579936,], [ 0.0, -0.0168865585100403, -0.01618033988749894, 0.0, 0.010716535899579936, 0.011755705045849473,], [ 0.0, -0.01618033988749894, -0.015410264855515781, 0.0, 0.011755705045849473, 0.0127484797949738,], [ 0.0, -0.015410264855515781, -0.014579372548428232, 0.0, 0.0127484797949738, 0.013690942118573773,], [ 0.0, -0.014579372548428232, -0.013690942118573766, 0.0, 0.013690942118573773, 0.014579372548428239,], [ 0.0, -0.013690942118573766, -0.012748479794973793, 0.0, 0.014579372548428239, 0.015410264855515788,], [ 0.0, -0.012748479794973793, -0.011755705045849453, 0.0, 0.015410264855515788, 0.016180339887498955,], [ 0.0, -0.011755705045849453, -0.010716535899579927, 0.0, 0.016180339887498955, 0.016886558510040305,], [ 0.0, -0.010716535899579927, -0.009635073482034308, 0.0, 0.016886558510040305, 0.01752613360087727,], [ 0.0, -0.009635073482034308, -0.008515585831301445, 0.0, 0.01752613360087727, 0.018096541049320396,], [ 0.0, -0.008515585831301445, -0.007362491053693557, 0.0, 0.018096541049320396, 0.01859552971776503,], [ 0.0, -0.007362491053693557, -0.006180339887498935, 0.0, 0.01859552971776503, 0.019021130325903076,], [ 0.0, -0.006180339887498935, -0.00497379774329709, 0.0, 0.019021130325903076, 0.019371663222572624,], [ 0.0, -0.00497379774329709, -0.0037476262917144937, 0.0, 0.019371663222572624, 0.019645745014573775,], [ 0.0, -0.0037476262917144937, -0.002506664671286076, 0.0, 0.019645745014573775, 0.019842294026289557,], [ 0.0, -0.002506664671286076, -0.0012558103905862654, 0.0, 0.019842294026289557, 0.019960534568565433,], [ 0.0, -0.0012558103905862654, -4.898587196589413e-18, 0.0, 0.019960534568565433, 0.02,],]
Expand Down
50 changes: 50 additions & 0 deletions examples/boron_nitride_0D.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[options]
name = "boron_dust_grain_"
track_trajectories = false
track_recoils = true
track_recoil_trajectories = false
write_buffer_size = 8000
weak_collision_order = 0
suppress_deep_recoils = false
high_energy_free_flight_paths = false
num_threads = 1
num_chunks = 1
use_hdf5 = false
electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
mean_free_path_model = "LIQUID"
interaction_potential = [["KR_C"]]
scattering_integral = [["MENDENHALL_WELLER"]]
root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-3}}]]
track_displacements = false
track_energy_losses = false

[material_parameters]
energy_unit = "EV"
mass_unit = "AMU"
Eb = [ 0.0, 0.0,]
Es = [ 5.76, 0.0,]
Ec = [ 1.0, 1.0,]
Z = [ 5, 7,]
m = [ 10.811, 14,]
interaction_index = [0, 0]
surface_binding_model = "AVERAGE"

[particle_parameters]
length_unit = "MICRON"
energy_unit = "EV"
mass_unit = "AMU"
N = [ 10000 ]
m = [ 1.008 ]
Z = [ 1 ]
E = [ 1000.0 ]
Ec = [ 1.0 ]
Es = [ 10.0 ]
pos = [ [ 0.0, 0.0, 0.0,] ]
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,] ]
interaction_index = [ 0 ]
particle_input_filename=""

[geometry_input]
length_unit = "ANGSTROM"
electronic_stopping_correction_factor = 1.0
densities = [0.065, 0.065]
4 changes: 2 additions & 2 deletions examples/layered_geometry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ Ec = [ 1.0,]
Es = [ 0.0,]
interaction_index = [0]
pos = [ [ -1.7453292519934434e-8, 0.0, 0.0,],]
dir = [ [ 0.999, 0.0001, 0.0,],]
dir = [ [ 0.999, 0.001, 0.0,],]
particle_input_filename = ""

[mesh_2d_input]
[geometry_input]
length_unit = "MICRON"
triangles = [ [ 0.0, 0.01, 0.0, 0.5, 0.5, -0.5,], [ 0.0, 0.01, 0.01, -0.5, 0.5, -0.5,], [ 0.01, 0.01, 0.04, -0.5, 0.5, -0.5,], [ 0.01, 0.04, 0.04, 0.5, 0.5, -0.5,], [ 0.04, 0.5, 0.04, 0.5, 0.5, -0.5,], [ 0.04, 0.5, 0.5, -0.5, 0.5, -0.5,],]
densities = [ [ 3.0e+10, 6.0e+10, 0.0, 0.0,], [ 3.0e+10, 6.0e+10, 0.0, 0.0,], [ 0.0, 0.0, 6.026e+10, 0.0,], [ 0.0, 0.0, 6.026e+10, 0.0,], [ 0.0, 0.0, 0.0, 4.996e+10,], [ 0.0, 0.0, 0.0, 4.996e+10,],]
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple_interaction_potentials.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pos = [ [ -1.7453292519934434e-8, 0.0, 0.0,], [ -1.7453292519934434e-8, 0.0, 0.0
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,], [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,],]
particle_input_filename =

[mesh_2d_input]
[geometry_input]
energy_barrier_thickness = 2.2E-4
length_unit = "MICRON"
triangles = [ [ 0.0, 0.01, 0.0, 0.5, 0.5, -0.5,], [ 0.0, 0.01, 0.01, -0.5, 0.5, -0.5,], [ 0.01, 0.01, 0.04, -0.5, 0.5, -0.5,], [ 0.01, 0.04, 0.04, 0.5, 0.5, -0.5,], [ 0.04, 0.5, 0.04, 0.5, 0.5, -0.5,], [ 0.04, 0.5, 0.5, -0.5, 0.5, -0.5,],]
Expand Down
65 changes: 65 additions & 0 deletions examples/titanium_dioxide_0D.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[options]
name = "2000.0eV_0.0001deg_He_TiO2"
track_trajectories = false
track_recoils = true
track_recoil_trajectories = false
write_buffer_size = 8000
weak_collision_order = 3
suppress_deep_recoils = false
high_energy_free_flight_paths = false
electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
mean_free_path_model = "LIQUID"
interaction_potential = [["KR_C"]]
scattering_integral = [["MENDENHALL_WELLER"]]
use_hdf5 = false
root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-6}}]]
num_threads = 4
num_chunks = 10
track_displacements = false
track_energy_losses = false
energy_min = 0.0
energy_max = 2000.0
energy_num = 20
angle_min = 0.0
angle_max = 90.0
angle_num = 20
x_min = 0.0
y_min = -0.1
z_min = -0.1
x_max = 0.1
y_max = 0.1
z_max = 0.1
x_num = 20
y_num = 20
z_num = 20

[particle_parameters]
length_unit = "1e-6"
energy_unit = "EV"
mass_unit = "AMU"
N = [ 100000,]
m = [ 4.002602,]
Z = [ 2,]
E = [ 2000.0,]
Ec = [ 1.0,]
Es = [ 0.0,]
interaction_index = [0]
pos = [ [ 0.0, 0.0, 0.0,],]
dir = [ [ 0.5, 0.5, 0.0,],]
particle_input_filename = ""

[geometry_input]
length_unit = "MICRON"
densities = [ 3.0e+10, 6.0e+10, 0.0, 0.0 ]
electronic_stopping_correction_factor = 1.0

[material_parameters]
energy_unit = "EV"
mass_unit = "AMU"
Eb = [ 3.0, 2.58, 3.0, 0.0,]
Es = [ 4.84, 2.58, 3.39, 4.72,]
Ec = [ 3.5, 2.0, 3.0, 1.5,]
Z = [ 22, 8, 13, 14,]
m = [ 47.867, 15.9994, 26.98, 28.08553,]
interaction_index = [0, 0, 0, 0]
surface_binding_model = "TARGET"
Loading