freepaths 2.2.1__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {freepaths-2.2.1 → freepaths-2.2.2}/PKG-INFO +1 -1
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/__main__.py +1 -1
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/run_particle.py +0 -2
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering.py +20 -2
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/PKG-INFO +1 -1
- {freepaths-2.2.1 → freepaths-2.2.2}/README.md +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/animation.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/config.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/data.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/default_config.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/electron.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/flight.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/interface_smmm.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/main_mfp_sampling.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/main_tracing.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/maps.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/materials.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/move.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/output_info.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/output_plots.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/output_structure.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/particle.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/particle_types.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/phonon.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/post_computations.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/progress.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scatterers.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_interfaces.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_primitives.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_semicircle.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_types.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/sources.py +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/SOURCES.txt +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/dependency_links.txt +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/entry_points.txt +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/requires.txt +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/top_level.txt +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/pyproject.toml +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/setup.cfg +0 -0
- {freepaths-2.2.1 → freepaths-2.2.2}/setup.py +0 -0
|
@@ -56,8 +56,6 @@ def run_particle(particle, flight, scatter_stats, places_stats, segment_stats, t
|
|
|
56
56
|
flight.save_free_paths()
|
|
57
57
|
flight.restart()
|
|
58
58
|
particle.assign_internal_scattering_time(material)
|
|
59
|
-
if cf.is_two_dimensional_material:
|
|
60
|
-
particle.phi = 0.0
|
|
61
59
|
|
|
62
60
|
# If hole scattering has occured, record it:
|
|
63
61
|
if triangle_scattering_places.is_scattered:
|
|
@@ -12,12 +12,18 @@ from freepaths.move import move
|
|
|
12
12
|
from freepaths.scattering_primitives import *
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def correction_for_two_dimensional_materials(pt):
|
|
16
|
+
"""Bring phi back to zero if a scattering happened"""
|
|
17
|
+
if cf.is_two_dimensional_material:
|
|
18
|
+
pt.phi = 0.0
|
|
19
|
+
|
|
20
|
+
|
|
15
21
|
def internal_scattering(pt, flight, scattering_types):
|
|
16
22
|
"""Check if the time passed since previous diffuse scattering event reached
|
|
17
23
|
the time until an internal scattering event, and if yes, scatters randomly"""
|
|
18
24
|
if flight.time_since_previous_scattering >= pt.time_of_internal_scattering:
|
|
19
25
|
scattering_types.internal = random_scattering(pt)
|
|
20
|
-
|
|
26
|
+
correction_for_two_dimensional_materials(pt)
|
|
21
27
|
|
|
22
28
|
def reinitialization(pt, scattering_types):
|
|
23
29
|
"""Re-thermalize (diffusely) particle when it comes back to one of the hot sides. Return true of particle was reinitialized"""
|
|
@@ -25,18 +31,22 @@ def reinitialization(pt, scattering_types):
|
|
|
25
31
|
|
|
26
32
|
if cf.hot_side_position_bottom and y < 0:
|
|
27
33
|
scattering_types.hot_side = horizontal_surface_up_scattering(pt, cf.side_wall_roughness, is_diffuse=True)
|
|
34
|
+
correction_for_two_dimensional_materials(pt)
|
|
28
35
|
return True
|
|
29
36
|
|
|
30
37
|
if cf.hot_side_position_top and y > cf.length:
|
|
31
38
|
scattering_types.hot_side = horizontal_surface_down_scattering(pt, cf.side_wall_roughness, is_diffuse=True)
|
|
39
|
+
correction_for_two_dimensional_materials(pt)
|
|
32
40
|
return True
|
|
33
41
|
|
|
34
42
|
if cf.hot_side_position_right and x > cf.width / 2:
|
|
35
43
|
scattering_types.hot_side = vertical_surface_left_scattering(pt, cf.side_wall_roughness, cf, is_diffuse=True)
|
|
44
|
+
correction_for_two_dimensional_materials(pt)
|
|
36
45
|
return True
|
|
37
46
|
|
|
38
47
|
if cf.hot_side_position_left and x < -cf.width / 2:
|
|
39
48
|
scattering_types.hot_side = vertical_surface_right_scattering(pt, cf.side_wall_roughness, cf, is_diffuse=True)
|
|
49
|
+
correction_for_two_dimensional_materials(pt)
|
|
40
50
|
return True
|
|
41
51
|
|
|
42
52
|
return False
|
|
@@ -100,9 +110,13 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
100
110
|
# Preliminary move to see if particle would cross something:
|
|
101
111
|
x, y, z = move(pt, cf.timestep)
|
|
102
112
|
|
|
103
|
-
# Scattering on top
|
|
113
|
+
# Scattering on top surface:
|
|
104
114
|
ceiling_scattering(pt, scattering_types, x, y, z)
|
|
115
|
+
correction_for_two_dimensional_materials(pt)
|
|
116
|
+
|
|
117
|
+
# Scattering on top surface:
|
|
105
118
|
floor_scattering(pt, scattering_types, x, y, z)
|
|
119
|
+
correction_for_two_dimensional_materials(pt)
|
|
106
120
|
|
|
107
121
|
# Scattering on sidewalls:
|
|
108
122
|
if cf.include_right_sidewall:
|
|
@@ -113,6 +127,7 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
113
127
|
scattering_on_top_sidewall(pt, scattering_types, x, y, z)
|
|
114
128
|
if cf.include_bottom_sidewall:
|
|
115
129
|
scattering_on_bottom_sidewall(pt, scattering_types, x, y, z)
|
|
130
|
+
correction_for_two_dimensional_materials(pt)
|
|
116
131
|
|
|
117
132
|
# Scattering on holes:
|
|
118
133
|
if cf.holes:
|
|
@@ -120,6 +135,7 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
120
135
|
for hole in cf.holes:
|
|
121
136
|
if hole.is_inside(x, y, z, cf):
|
|
122
137
|
hole.scatter(pt, scattering_types, x, y, z, cf)
|
|
138
|
+
correction_for_two_dimensional_materials(pt)
|
|
123
139
|
|
|
124
140
|
# If there was any scattering, then no need to check rest of the holes:
|
|
125
141
|
if scattering_types.holes is not None:
|
|
@@ -139,12 +155,14 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
139
155
|
for bulk in cf.bulks:
|
|
140
156
|
if bulk.is_crossed(pt, x, y, z):
|
|
141
157
|
bulk.scatter(pt, scattering_types, x, y, z, cf)
|
|
158
|
+
correction_for_two_dimensional_materials(pt)
|
|
142
159
|
|
|
143
160
|
# Scattering on interfaces (thin layers):
|
|
144
161
|
if cf.interfaces:
|
|
145
162
|
for interface in cf.interfaces:
|
|
146
163
|
if interface.is_crossed(pt, x, y, z):
|
|
147
164
|
interface.scatter(pt, cf, scattering_types)
|
|
165
|
+
correction_for_two_dimensional_materials(pt)
|
|
148
166
|
|
|
149
167
|
# If there was any scattering, then no need to check other interfaces:
|
|
150
168
|
if scattering_types.interfaces is not None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|