Skip to content

Commit 2959eca

Browse files
committed
Update examples
1 parent 2d1ca76 commit 2959eca

3 files changed

Lines changed: 53 additions & 4 deletions

File tree

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rayon = "1.10.0"
2424
geo = {version = "0.25", optional = false}
2525
indicatif = {version = "0.18.6", features=["rayon"]}
2626
serde = { version = "1.0.163", features = ["derive"] }
27-
rcpr = { git = "https://github.com/drobnyjt/rcpr", branch="trucnation_fixes", optional=true}
27+
rcpr = { git = "https://github.com/drobnyjt/rcpr", branch="main", optional=true}
2828
ndarray = {version = "0.17.2", features = ["serde"], optional = true}
2929
parry3d-f64 = {optional = true, version="0.2.0"}
3030
pyo3 = {version = "0.29.0", optional=true}

‎examples/f_kporha_et_al_benchmark.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def tungsten_sputtering(ion, energy, angle, num_ions=1000, run_sim=False, pot="W
190190
colors = []
191191

192192
num_ions = 10000
193-
run_sim = False
193+
run_sim = True
194194

195195
tungsten["Es"] = 8.79
196196
tungsten["Eb"] = 0.0

‎examples/xenon_sputtering_benchmark.py‎

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def input_file(ion, target, incident_energy, angle, number_ions=1000):
1414

1515
mfp = (target["n"]/10**30)**(-1./3.)
1616

17-
cpr = {'CPR': {'n0': 2, 'nmax': 32, 'epsilon': 1e-3, 'complex_threshold': 1E-9, 'truncation_threshold': 1E-12, 'far_from_zero': 1e3, 'interval_limit': 1E-3, 'derivative_free': True}}
17+
cpr = {'CPR': {'n0': 2, 'nmax': 32, 'epsilon': 1e-3, 'complex_threshold': 1E-9, 'far_from_zero': 1e3, 'interval_limit': 1E-3, 'derivative_free': True}}
1818
options = {
1919
'name': f'input_file_{ion["symbol"]}_{target["symbol"]}_{np.round(angle, 1)}_{np.round(incident_energy/1000, 4)}',
2020
'track_trajectories': False, # whether to track trajectories for plotting; memory intensive
@@ -196,7 +196,7 @@ def input_file(ion, target, incident_energy, angle, number_ions=1000):
196196

197197
num_ions = 10000
198198
num_energies = 25
199-
run_sim = True
199+
run_sim = False
200200
energies = np.logspace(np.log10(25), np.log10(1600), num_energies)
201201
angle = 0.0
202202

@@ -231,8 +231,57 @@ def input_file(ion, target, incident_energy, angle, number_ions=1000):
231231

232232
plt.plot(energies, Y_Xe_Mo, label='RustBCA Default')
233233
plt.gca().set_xscale('log')
234+
plt.gca().set_yscale('log')
234235
plt.legend()
235236
plt.xlabel('E [eV]')
236237
plt.ylabel('Y [at/ion]')
237238
plt.title('Xe on Mo Sputtering Yields')
239+
240+
# Xe on Ti
241+
242+
data = np.array([
243+
[0.06339144215530546, 0.1428571428571308],
244+
[29.920760697305866, 0.39030612244896945],
245+
[44.88114104595877, 0.5459183673469292],
246+
[59.968304278922346, 0.6530612244897864],
247+
[69.79397781299527, 0.5586734693877453],
248+
[0.1267828843106198, 0.33928571428570375],
249+
[30.047543581616488, 0.7755102040816233],
250+
[44.8811410459588, 1.0714285714285632],
251+
[59.96830427892236, 1.2602040816326459],
252+
[69.79397781299525, 1.1938775510204005],
253+
[0.25356576862123426, 0.4846938775510101],
254+
[29.920760697305866, 1.030612244897951],
255+
[45.00792393026942, 1.4285714285714222],
256+
[59.96830427892236, 1.6173469387755044],
257+
[69.98415213946117, 1.6632653061224434],
258+
[0.06339144215530546, 0.8061224489795826],
259+
[29.984152139461166, 1.5255102040816264],
260+
[45.00792393026942, 2.056122448979588],
261+
[59.96830427892236, 2.4693877551020385],
262+
[69.85736925515056, 2.6377551020408143],
263+
[0.12678288431062157, 1.0076530612244818],
264+
[29.98415213946116, 1.834183673469383],
265+
[44.94453248811412, 2.461734693877548],
266+
[59.96830427892236, 3.229591836734694],
267+
[69.92076069730587, 3.357142857142858],
268+
])
269+
270+
run_sim = True
271+
num_angles = 15
272+
num_ions = 1000
273+
angles = np.linspace(0, 89, num_angles)
274+
energies = [200, 400, 600, 1000, 1400]
275+
titanium['Eb'] = 3.0
276+
277+
plt.figure()
278+
for energy in energies:
279+
Y_Xe_Ti = np.zeros(num_angles)
280+
for index, angle in enumerate(angles):
281+
input_data = input_file(xenon, titanium, energy, angle, num_ions)
282+
if run_sim: rustbca_py(input_data, geometry_mode="0D")
283+
sputtered = np.genfromtxt(f'{input_data["options"]["name"]}sputtered.output', delimiter=',')
284+
Y_Xe_Ti[index] = np.shape(sputtered)[0]/num_ions
285+
plt.plot(angles, Y_Xe_Ti, label=f'{energy} eV')
286+
plt.scatter(data[:, 0], data[:, 1])
238287
plt.show()

0 commit comments

Comments
 (0)