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.
Files changed (40) hide show
  1. {freepaths-2.2.1 → freepaths-2.2.2}/PKG-INFO +1 -1
  2. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/__main__.py +1 -1
  3. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/run_particle.py +0 -2
  4. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering.py +20 -2
  5. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/PKG-INFO +1 -1
  6. {freepaths-2.2.1 → freepaths-2.2.2}/README.md +0 -0
  7. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/animation.py +0 -0
  8. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/config.py +0 -0
  9. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/data.py +0 -0
  10. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/default_config.py +0 -0
  11. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/electron.py +0 -0
  12. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/flight.py +0 -0
  13. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/interface_smmm.py +0 -0
  14. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/main_mfp_sampling.py +0 -0
  15. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/main_tracing.py +0 -0
  16. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/maps.py +0 -0
  17. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/materials.py +0 -0
  18. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/move.py +0 -0
  19. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/output_info.py +0 -0
  20. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/output_plots.py +0 -0
  21. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/output_structure.py +0 -0
  22. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/particle.py +0 -0
  23. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/particle_types.py +0 -0
  24. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/phonon.py +0 -0
  25. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/post_computations.py +0 -0
  26. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/progress.py +0 -0
  27. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scatterers.py +0 -0
  28. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_interfaces.py +0 -0
  29. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_primitives.py +0 -0
  30. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_semicircle.py +0 -0
  31. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/scattering_types.py +0 -0
  32. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths/sources.py +0 -0
  33. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/SOURCES.txt +0 -0
  34. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/dependency_links.txt +0 -0
  35. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/entry_points.txt +0 -0
  36. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/requires.txt +0 -0
  37. {freepaths-2.2.1 → freepaths-2.2.2}/freepaths.egg-info/top_level.txt +0 -0
  38. {freepaths-2.2.1 → freepaths-2.2.2}/pyproject.toml +0 -0
  39. {freepaths-2.2.1 → freepaths-2.2.2}/setup.cfg +0 -0
  40. {freepaths-2.2.1 → freepaths-2.2.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: freepaths
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Phonon Monte Carlo simulator
5
5
  Home-page: https://github.com/anufrievroman/freepaths
6
6
  Author: Roman Anufriev
@@ -6,7 +6,7 @@ from colorama import Fore, Style
6
6
 
7
7
  from freepaths.particle_types import ParticleType
8
8
 
9
- __version__ = "2.2.1"
9
+ __version__ = "2.2.2"
10
10
 
11
11
  colorama.init()
12
12
 
@@ -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 and bottom surfaces:
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: freepaths
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Phonon Monte Carlo simulator
5
5
  Home-page: https://github.com/anufrievroman/freepaths
6
6
  Author: Roman Anufriev
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