freepaths 2.1.2__tar.gz → 2.1.3__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.1.2 → freepaths-2.1.3}/PKG-INFO +2 -2
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/__main__.py +1 -1
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/config.py +1 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/default_config.py +1 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/phonon.py +30 -11
- freepaths-2.1.3/freepaths/run_phonon.py +78 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths.egg-info/PKG-INFO +2 -2
- freepaths-2.1.2/freepaths/run_phonon.py +0 -71
- {freepaths-2.1.2 → freepaths-2.1.3}/README.md +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/animation.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/data.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/flight.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/main_mfp_sampling.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/main_tracing.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/maps.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/materials.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/move.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/output_info.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/output_plots.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/output_structure.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/progress.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/scatterers.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/scattering.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/scattering_primitives.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/scattering_semicircle.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/scattering_types.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths/sources.py +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths.egg-info/SOURCES.txt +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths.egg-info/dependency_links.txt +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths.egg-info/entry_points.txt +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths.egg-info/requires.txt +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/freepaths.egg-info/top_level.txt +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/pyproject.toml +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/setup.cfg +0 -0
- {freepaths-2.1.2 → freepaths-2.1.3}/setup.py +0 -0
|
@@ -93,6 +93,7 @@ class Config:
|
|
|
93
93
|
self.hot_side_position_bottom = HOT_SIDE_POSITION_BOTTOM
|
|
94
94
|
self.hot_side_position_right = HOT_SIDE_POSITION_RIGHT
|
|
95
95
|
self.hot_side_position_left = HOT_SIDE_POSITION_LEFT
|
|
96
|
+
self.rethermalization_on_hot_sides = RETHERMALIZATION_ON_HOT_SIDES
|
|
96
97
|
|
|
97
98
|
# Sources:
|
|
98
99
|
self.phonon_sources = PHONON_SOURCES
|
|
@@ -58,6 +58,7 @@ HOT_SIDE_POSITION_TOP = False
|
|
|
58
58
|
HOT_SIDE_POSITION_BOTTOM = True
|
|
59
59
|
HOT_SIDE_POSITION_RIGHT = False
|
|
60
60
|
HOT_SIDE_POSITION_LEFT = False
|
|
61
|
+
RETHERMALIZATION_ON_HOT_SIDES = True
|
|
61
62
|
|
|
62
63
|
# Phonon source:
|
|
63
64
|
PHONON_SOURCES = [Source(x=0, y=0, z=0, size_x=0, size_y=0, size_z=0, angle_distribution="random", angle=0)]
|
|
@@ -66,17 +66,36 @@ class Phonon:
|
|
|
66
66
|
return self.speed / self.f
|
|
67
67
|
|
|
68
68
|
@property
|
|
69
|
-
def
|
|
70
|
-
"""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
def has_crossed_cold_side(self):
|
|
70
|
+
"""
|
|
71
|
+
Checks if the phonon at this timestep crossed the cold side.
|
|
72
|
+
Depending on where user set cold sides, we check if phonon crossed that line.
|
|
73
|
+
Return boolean of wheather any of the cold sides has been crossed.
|
|
74
|
+
"""
|
|
75
|
+
has_crossed_top = self.y > cf.length
|
|
76
|
+
has_crossed_bottom = self.y < 0
|
|
77
|
+
has_crossed_right = self.x > cf.width / 2.0
|
|
78
|
+
has_crossed_left = self.x < - cf.width / 2.0
|
|
79
|
+
return ((cf.cold_side_position_top and has_crossed_top) or
|
|
80
|
+
(cf.cold_side_position_bottom and has_crossed_bottom) or
|
|
81
|
+
(cf.cold_side_position_right and has_crossed_right) or
|
|
82
|
+
(cf.cold_side_position_left and has_crossed_left))
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def has_crossed_hot_side(self):
|
|
86
|
+
"""
|
|
87
|
+
Checks if the phonon at this timestep crossed the hot side.
|
|
88
|
+
Depending on where user set hot sides, we check if phonon crossed that line.
|
|
89
|
+
Return boolean of wheather any of the hot sides has been crossed.
|
|
90
|
+
"""
|
|
91
|
+
has_crossed_top = self.y > cf.length
|
|
92
|
+
has_crossed_bottom = self.y < 0
|
|
93
|
+
has_crossed_right = self.x > cf.width / 2.0
|
|
94
|
+
has_crossed_left = self.x < - cf.width / 2.0
|
|
95
|
+
return ((cf.hot_side_position_top and has_crossed_top) or
|
|
96
|
+
(cf.hot_side_position_bottom and has_crossed_bottom) or
|
|
97
|
+
(cf.hot_side_position_right and has_crossed_right) or
|
|
98
|
+
(cf.hot_side_position_left and has_crossed_left))
|
|
80
99
|
|
|
81
100
|
def assign_frequency(self, material):
|
|
82
101
|
"""Assigning frequency with probability according to Planckian distribution"""
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Module that runs one phonon through the structure, from phonon source to a cold side.
|
|
3
|
+
After the run, we record various parameters of this run into flight object.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from freepaths.config import cf
|
|
7
|
+
from freepaths.scattering import internal_scattering, surface_scattering, reinitialization
|
|
8
|
+
from freepaths.scattering_types import ScatteringTypes, ScatteringPlaces
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def run_phonon(phonon, flight, scatter_stats, places_stats, segment_stats, thermal_maps, scatter_maps, material):
|
|
12
|
+
"""Run one phonon through the system and record parameters of this run"""
|
|
13
|
+
|
|
14
|
+
# Initialize object that will store scattering types:
|
|
15
|
+
scattering_types = ScatteringTypes()
|
|
16
|
+
triangle_scattering_places = ScatteringPlaces()
|
|
17
|
+
|
|
18
|
+
# Run the phonon step-by-step:
|
|
19
|
+
for step_number in range(cf.number_of_timesteps):
|
|
20
|
+
|
|
21
|
+
# If the phonon reached a cold side, record it and break the loop:
|
|
22
|
+
if phonon.has_crossed_cold_side:
|
|
23
|
+
flight.add_point_to_path()
|
|
24
|
+
flight.save_free_paths()
|
|
25
|
+
flight.finish(step_number, cf.timestep)
|
|
26
|
+
break
|
|
27
|
+
|
|
28
|
+
# If the phonon reached a hot side, record it and break the loop:
|
|
29
|
+
if phonon.has_crossed_hot_side and not cf.rethermalization_on_hot_sides:
|
|
30
|
+
flight.add_point_to_path()
|
|
31
|
+
flight.save_free_paths()
|
|
32
|
+
break
|
|
33
|
+
|
|
34
|
+
# Check if different scattering events happened during current time step:
|
|
35
|
+
if cf.include_internal_scattering:
|
|
36
|
+
internal_scattering(phonon, flight, scattering_types)
|
|
37
|
+
surface_scattering(phonon, scattering_types, triangle_scattering_places)
|
|
38
|
+
if cf.rethermalization_on_hot_sides:
|
|
39
|
+
reinitialization(phonon, scattering_types)
|
|
40
|
+
|
|
41
|
+
# If any scattering has occurred, record it:
|
|
42
|
+
if scattering_types.is_scattered:
|
|
43
|
+
flight.add_point_to_path()
|
|
44
|
+
scatter_stats.save_scattering_events(phonon.y, scattering_types)
|
|
45
|
+
if cf.output_scattering_map:
|
|
46
|
+
scatter_maps.add_scattering_to_map(phonon, scattering_types)
|
|
47
|
+
|
|
48
|
+
# Otherwise, record only if animation is requested:
|
|
49
|
+
else:
|
|
50
|
+
if cf.output_path_animation:
|
|
51
|
+
flight.add_point_to_path()
|
|
52
|
+
|
|
53
|
+
# If diffuse scattering has occurred, reset phonon free path:
|
|
54
|
+
if scattering_types.is_diffuse or scattering_types.is_internal:
|
|
55
|
+
flight.save_free_paths()
|
|
56
|
+
flight.restart()
|
|
57
|
+
phonon.assign_internal_scattering_time(material)
|
|
58
|
+
if cf.is_two_dimensional_material:
|
|
59
|
+
phonon.phi = 0.0
|
|
60
|
+
|
|
61
|
+
# If hole scattering has occured, record it:
|
|
62
|
+
if triangle_scattering_places.is_scattered:
|
|
63
|
+
places_stats.save_scattering_events(phonon.y, triangle_scattering_places)
|
|
64
|
+
if scattering_types.is_diffuse_on_hole:
|
|
65
|
+
flight.save_hole_diff_scattering_angle(phonon.theta)
|
|
66
|
+
if scattering_types.is_specular_on_hole:
|
|
67
|
+
flight.save_hole_spec_scattering_angle(phonon.theta)
|
|
68
|
+
|
|
69
|
+
else:
|
|
70
|
+
flight.add_step(cf.timestep)
|
|
71
|
+
|
|
72
|
+
# Record presence of the phonon at this timestep and move on:
|
|
73
|
+
thermal_maps.add_energy_to_maps(phonon, step_number, material)
|
|
74
|
+
segment_stats.record_time_in_segment(phonon.y)
|
|
75
|
+
scattering_types.reset()
|
|
76
|
+
triangle_scattering_places.reset()
|
|
77
|
+
phonon.move()
|
|
78
|
+
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Module that runs one phonon through the structure, from phonon source to a cold side.
|
|
3
|
-
After the run, we record various parameters of this run into flight object.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from freepaths.config import cf
|
|
7
|
-
from freepaths.scattering import internal_scattering, surface_scattering, reinitialization
|
|
8
|
-
from freepaths.scattering_types import ScatteringTypes, ScatteringPlaces
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def run_phonon(phonon, flight, scatter_stats, places_stats, segment_stats, thermal_maps, scatter_maps, material):
|
|
12
|
-
"""Run one phonon through the system and record parameters of this run"""
|
|
13
|
-
|
|
14
|
-
# Initialize object that will store scattering types:
|
|
15
|
-
scattering_types = ScatteringTypes()
|
|
16
|
-
triangle_scattering_places = ScatteringPlaces()
|
|
17
|
-
|
|
18
|
-
# Run the phonon step-by-step:
|
|
19
|
-
for step_number in range(cf.number_of_timesteps):
|
|
20
|
-
if phonon.is_in_system:
|
|
21
|
-
|
|
22
|
-
# Check if different scattering events happened during current time step:
|
|
23
|
-
if cf.include_internal_scattering:
|
|
24
|
-
internal_scattering(phonon, flight, scattering_types)
|
|
25
|
-
surface_scattering(phonon, scattering_types, triangle_scattering_places)
|
|
26
|
-
reinitialization(phonon, scattering_types)
|
|
27
|
-
|
|
28
|
-
# If any scattering has occurred, record it:
|
|
29
|
-
if scattering_types.is_scattered:
|
|
30
|
-
flight.add_point_to_path()
|
|
31
|
-
scatter_stats.save_scattering_events(phonon.y, scattering_types)
|
|
32
|
-
if cf.output_scattering_map:
|
|
33
|
-
scatter_maps.add_scattering_to_map(phonon, scattering_types)
|
|
34
|
-
|
|
35
|
-
# Otherwise, record only if animation is requested:
|
|
36
|
-
else:
|
|
37
|
-
if cf.output_path_animation:
|
|
38
|
-
flight.add_point_to_path()
|
|
39
|
-
|
|
40
|
-
# If diffuse scattering has occurred, reset phonon free path:
|
|
41
|
-
if scattering_types.is_diffuse or scattering_types.is_internal:
|
|
42
|
-
flight.save_free_paths()
|
|
43
|
-
flight.restart()
|
|
44
|
-
phonon.assign_internal_scattering_time(material)
|
|
45
|
-
if cf.is_two_dimensional_material:
|
|
46
|
-
phonon.phi = 0.0
|
|
47
|
-
|
|
48
|
-
# If hole scattering has occured, record it:
|
|
49
|
-
if triangle_scattering_places.is_scattered:
|
|
50
|
-
places_stats.save_scattering_events(phonon.y, triangle_scattering_places)
|
|
51
|
-
if scattering_types.is_diffuse_on_hole:
|
|
52
|
-
flight.save_hole_diff_scattering_angle(phonon.theta)
|
|
53
|
-
if scattering_types.is_specular_on_hole:
|
|
54
|
-
flight.save_hole_spec_scattering_angle(phonon.theta)
|
|
55
|
-
|
|
56
|
-
else:
|
|
57
|
-
flight.add_step(cf.timestep)
|
|
58
|
-
|
|
59
|
-
# Record presence of the phonon at this timestep and move on:
|
|
60
|
-
thermal_maps.add_energy_to_maps(phonon, step_number, material)
|
|
61
|
-
segment_stats.record_time_in_segment(phonon.y)
|
|
62
|
-
scattering_types.reset()
|
|
63
|
-
triangle_scattering_places.reset()
|
|
64
|
-
phonon.move()
|
|
65
|
-
|
|
66
|
-
# If the phonon reached cold side, record it and break the loop:
|
|
67
|
-
else:
|
|
68
|
-
flight.add_point_to_path()
|
|
69
|
-
flight.save_free_paths()
|
|
70
|
-
flight.finish(step_number, cf.timestep)
|
|
71
|
-
break
|
|
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
|