Skip to content

Commit 5b01319

Browse files
authored
Merge pull request #288 from lcpp-org/recoil_generation
Recoil generation fix for z-directed particles
2 parents 8e26b98 + 1b93c01 commit 5b01319

15 files changed

+198
-141
lines changed

examples/boron_nitride_0D.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ E = [ 1000.0 ]
2828
Ec = [ 1.0 ]
2929
Es = [ 10.0 ]
3030
pos = [ [ 0.0, 0.0, 0.0,] ]
31-
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,] ]
31+
dir = [ [ 1.0, 0.0, 0.0,] ]
3232

3333
[geometry_input]
3434
length_unit = "ANGSTROM"

examples/boron_nitride_sphere.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ E = [ 500.0 ]
3131
Ec = [ 1.0 ]
3232
Es = [ 10.0 ]
3333
pos = [ [ -100.0, 0.0, 0.0,] ]
34-
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,] ]
34+
dir = [ [ 1.0, 0.0, 0.0,] ]
3535
interaction_index = [ 0 ]
3636
particle_input_filename=""
3737

examples/boron_nitride_wire.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ E = [ 5000.0 ]
2424
Ec = [ 1.0 ]
2525
Es = [ 10.0 ]
2626
pos = [ [ 0.0, 0.0, 0.0,] ]
27-
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,] ]
27+
dir = [ [ 1.0, 0.0, 0.0,] ]
2828

2929
[geometry_input]
3030
length_unit = "ANGSTROM"

examples/boron_nitride_wire_homogeneous.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ E = [ 5000.0 ]
2424
Ec = [ 1.0 ]
2525
Es = [ 10.0 ]
2626
pos = [ [ 0.0, 0.0, 0.0,] ]
27-
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,] ]
27+
dir = [ [ 1.0, 0.0, 0.0,] ]
2828

2929
[geometry_input]
3030
length_unit = "ANGSTROM"

examples/layered_geometry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Ec = [ 1.0,]
4646
Es = [ 0.0,]
4747
interaction_index = [0]
4848
pos = [ [ -1.7453292519934434e-8, 0.0, 0.0,],]
49-
dir = [ [ 0.999, 0.001, 0.0,],]
49+
dir = [ [ 1.0, 0.0, 0.0,],]
5050

5151
[geometry_input]
5252
length_unit = "MICRON"

examples/layered_geometry_1D.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Ec = [ 1.0,]
4646
Es = [ 0.0,]
4747
interaction_index = [0]
4848
pos = [ [ -1.7453292519934434e-8, 0.0, 0.0,],]
49-
dir = [ [ 0.999, 0.001, 0.0,],]
49+
dir = [ [ 1.0, 0.0, 0.0,],]
5050

5151
[geometry_input]
5252
length_unit = "MICRON"

examples/lithium_vapor_shield.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Ec = [ 1.0,]
4646
Es = [ 0.0,]
4747
interaction_index = [0]
4848
pos = [ [ -1.7453292519934434e-8, 0.0, 0.0,],]
49-
dir = [ [ 0.999, 0.001, 0.0,],]
49+
dir = [ [ 1.0, 0.0, 0.0,],]
5050

5151
[geometry_input]
5252
length_unit = "MICRON"

examples/multiple_interaction_potentials.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Ec = [ 0.1, 0.1]
4040
Es = [ 0.0, 1.0]
4141
interaction_index = [0, 1]
4242
pos = [ [ -1.7453292519934434e-8, 0.0, 0.0,], [ -1.7453292519934434e-8, 0.0, 0.0,],]
43-
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,], [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,],]
43+
dir = [ [ 1.0, 0.0, 0.0,], [ 1.0, 0.0, 0.0,],]
4444

4545
[geometry_input]
4646
energy_barrier_thickness = 2.2E-4

examples/test_cube.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ def main():
115115
run_sim = True
116116
track_trajectories = False
117117
a = 1000
118-
num_samples = 100000
118+
num_samples = 10000
119119
num_angles = 10
120-
energy = 100
121-
angles = np.linspace(0.01, 89.9, num_angles)
120+
energy = 200
121+
angles = np.linspace(0.0, 89.9, num_angles)
122122

123123
sputtering_yields_x = np.zeros(num_angles)
124124
sputtering_yields_z = np.zeros(num_angles)
@@ -138,43 +138,48 @@ def main():
138138

139139
sim_index = 0
140140
impl_index = num_angles*3//4
141+
bins = np.linspace(0, 500, 100)
142+
141143
for angle_index, angle in enumerate(angles):
142144

143145
R, Y, reflected, sputtered, implanted = run(energy, sim_index, num_samples, track_trajectories=track_trajectories, run_sim=run_sim, ux=np.cos(angle*np.pi/180.), uy=np.sin(angle*np.pi/180.)/np.sqrt(2), uz=np.sin(angle*np.pi/180.)/np.sqrt(2))
144146
sim_index += 1
145147
plt.figure(1)
146-
if angle_index == impl_index: plt.hist(implanted[:, 2], histtype='step', bins=100, density=False, label='x')
147-
148+
if angle_index == impl_index: plt.hist(implanted[:, 2], histtype='step', bins=bins, density=False, label='x')
148149
sputtering_yields_x[angle_index] = Y
149150
R_x[angle_index] = R
150151

151152
R, Y, reflected, sputtered, implanted = run(energy, sim_index, num_samples, track_trajectories=track_trajectories, run_sim=run_sim, x0=a, ux=-np.cos(angle*np.pi/180.), uy=np.sin(angle*np.pi/180.)/np.sqrt(2), uz=np.sin(angle*np.pi/180.)/np.sqrt(2))
152153
sim_index += 1
153-
if angle_index == impl_index: plt.hist(a - implanted[:, 2], histtype='step', bins=100, density=False, label='-x')
154+
if angle_index == impl_index: plt.hist(a - implanted[:, 2], histtype='step', bins=bins, density=False, label='-x')
154155
sputtering_yields_x_minus[angle_index] = Y
155156
R_x_minus[angle_index] = R
156157

157158
R, Y, reflected, sputtered, implanted = run(energy, sim_index, num_samples, track_trajectories=track_trajectories, run_sim=run_sim, x0=a/2., y0=a/2., z0=a, ux=np.sin(angle*np.pi/180.)/np.sqrt(2), uy=np.sin(angle*np.pi/180.)/np.sqrt(2), uz=-np.cos(angle*np.pi/180.))
158159
sim_index += 1
159-
if angle_index == impl_index: plt.hist(a - implanted[:, 4], histtype='step', bins=100, density=False, label='-z')
160+
if angle_index == impl_index: plt.hist(a - implanted[:, 4], histtype='step', bins=bins, density=False, label='-z')
161+
160162
sputtering_yields_z_minus[angle_index] = Y
161163
R_z_minus[angle_index] = R
162164

163165
R, Y, reflected, sputtered, implanted = run(energy, sim_index, num_samples, track_trajectories=track_trajectories, run_sim=run_sim, x0=a/2., y0=a/2., z0=0.0, ux=np.sin(angle*np.pi/180.)/np.sqrt(2), uy=np.sin(angle*np.pi/180.)/np.sqrt(2), uz=np.cos(angle*np.pi/180.))
164166
sim_index += 1
165-
if angle_index == impl_index: plt.hist(implanted[:, 4], histtype='step', bins=100, density=False, label='z')
167+
if angle_index == impl_index: plt.hist(implanted[:, 4], histtype='step', bins=bins, density=False, label='z')
168+
166169
sputtering_yields_z[angle_index] = Y
167170
R_z[angle_index] = R
168171

169172
R, Y, reflected, sputtered, implanted = run(energy, sim_index, num_samples, track_trajectories=track_trajectories, run_sim=run_sim, x0=a/2., y0=0.0, z0=a/2., ux=np.sin(angle*np.pi/180.)/np.sqrt(2), uz=np.sin(angle*np.pi/180.)/np.sqrt(2), uy=np.cos(angle*np.pi/180.))
170173
sim_index += 1
171-
if angle_index == impl_index: plt.hist(implanted[:, 3], histtype='step', bins=100, density=False, label='y')
174+
if angle_index == impl_index: plt.hist(implanted[:, 3], histtype='step', bins=bins, density=False, label='y')
175+
172176
sputtering_yields_y[angle_index] = Y
173177
R_y[angle_index] = R
174178

175179
R, Y, reflected, sputtered, implanted = run(energy, sim_index, num_samples, track_trajectories=track_trajectories, run_sim=run_sim, x0=a/2., y0=a, z0=a/2., ux=np.sin(angle*np.pi/180.)/np.sqrt(2), uz=np.sin(angle*np.pi/180.)/np.sqrt(2), uy=-np.cos(angle*np.pi/180.))
176180
sim_index += 1
177-
if angle_index == impl_index: plt.hist(a - implanted[:, 3], histtype='step', bins=100, density=False, label='-y')
181+
if angle_index == impl_index: plt.hist(a - implanted[:, 3], histtype='step', bins=bins, density=False, label='-y')
182+
178183
sputtering_yields_y_minus[angle_index] = Y
179184
R_y_minus[angle_index] = R
180185

@@ -206,7 +211,6 @@ def main():
206211
plt.show()
207212

208213
if track_trajectories and do_plots:
209-
210214
do_trajectory_plot('cube_19', boundary=[[0.0, 0.0], [0.0, a], [a, a], [a, 0.0], [0.0, 0.0]])
211215

212216
do_trajectory_plot('cube_20', boundary=[[0.0, 0.0], [0.0, a], [a, a], [a, 0.0], [0.0, 0.0]])

examples/tungsten_twist_trimesh.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ E = [ 2000.0 ]
4242
Ec = [ 1.0 ]
4343
Es = [ 0.0 ]
4444
pos = [ [ 0.0, 0.0, 1.0,] ]
45-
dir = [ [ 0.0, 0.0001, -0.9999,] ]
45+
dir = [ [ 0.0, 0.0, -1.0,] ]
4646
interaction_index = [ 0 ]
4747

4848
[geometry_input]

0 commit comments

Comments
 (0)