devsim 2.10.0__cp39-abi3-win_amd64.whl

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 (157) hide show
  1. devsim/__init__.py +17 -0
  2. devsim/devsim_py3.pyd +0 -0
  3. devsim/python_packages/Klaassen.py +336 -0
  4. devsim/python_packages/__init__.py +0 -0
  5. devsim/python_packages/fermi_physics.py +31 -0
  6. devsim/python_packages/model_create.py +262 -0
  7. devsim/python_packages/mos_physics.py +170 -0
  8. devsim/python_packages/pythonmesh.py +131 -0
  9. devsim/python_packages/ramp.py +101 -0
  10. devsim/python_packages/simple_dd.py +75 -0
  11. devsim/python_packages/simple_physics.py +463 -0
  12. devsim/umfpack/umfpack_lgpl.dll +0 -0
  13. devsim/umfpack/umfpack_loader.py +517 -0
  14. devsim/umfpack/umfshim.py +116 -0
  15. devsim-2.10.0.data/data/devsim_data/BUILD.md +94 -0
  16. devsim-2.10.0.data/data/devsim_data/CHANGES.md +773 -0
  17. devsim-2.10.0.data/data/devsim_data/CITATION.md +23 -0
  18. devsim-2.10.0.data/data/devsim_data/CODE_OF_CONDUCT.md +74 -0
  19. devsim-2.10.0.data/data/devsim_data/CONTRIBUTING.md +43 -0
  20. devsim-2.10.0.data/data/devsim_data/HOWTO.md +27 -0
  21. devsim-2.10.0.data/data/devsim_data/INSTALL.md +65 -0
  22. devsim-2.10.0.data/data/devsim_data/README.md +97 -0
  23. devsim-2.10.0.data/data/devsim_data/TEST.md +13 -0
  24. devsim-2.10.0.data/data/devsim_data/doc/devsim.pdf +0 -0
  25. devsim-2.10.0.data/data/devsim_data/doc/symdiff.pdf +0 -0
  26. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0.jpg +0 -0
  27. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0_3d.jpg +0 -0
  28. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7.jpg +0 -0
  29. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7_3d.jpg +0 -0
  30. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_2d.py +85 -0
  31. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_3d.py +85 -0
  32. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_common.py +399 -0
  33. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.geo +62 -0
  34. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.msh +65606 -0
  35. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.geo +183 -0
  36. devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.msh +25808 -0
  37. devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap.lay +1587 -0
  38. devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap1d.py +155 -0
  39. devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap2d.py +200 -0
  40. devsim-2.10.0.data/data/devsim_data/examples/diode/3dblock.geo +48 -0
  41. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d.py +94 -0
  42. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d_custom.py +159 -0
  43. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_2d.py +68 -0
  44. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_common.py +253 -0
  45. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_current.lay +3271 -0
  46. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_density.lay +3271 -0
  47. devsim-2.10.0.data/data/devsim_data/examples/diode/diode_potential.lay +3272 -0
  48. devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.msh +1477 -0
  49. devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.py +55 -0
  50. devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.msh +8557 -0
  51. devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.py +74 -0
  52. devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_equil.py +43 -0
  53. devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_float128.py +85 -0
  54. devsim-2.10.0.data/data/devsim_data/examples/diode/laux2d.py +43 -0
  55. devsim-2.10.0.data/data/devsim_data/examples/diode/laux3d.py +54 -0
  56. devsim-2.10.0.data/data/devsim_data/examples/diode/laux_common.py +503 -0
  57. devsim-2.10.0.data/data/devsim_data/examples/diode/pythonmesh3d.py +61 -0
  58. devsim-2.10.0.data/data/devsim_data/examples/diode/ssac_diode.py +57 -0
  59. devsim-2.10.0.data/data/devsim_data/examples/diode/tran_diode.py +63 -0
  60. devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.geo +160 -0
  61. devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.msh +8599 -0
  62. devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.py +96 -0
  63. devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_create.py +174 -0
  64. devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_kla.py +162 -0
  65. devsim-2.10.0.data/data/devsim_data/examples/mobility/logElectrons.lay +1327 -0
  66. devsim-2.10.0.data/data/devsim_data/examples/mobility/pythonmesh2d.py +100 -0
  67. devsim-2.10.0.data/data/devsim_data/examples/mobility/test.lay +3385 -0
  68. devsim-2.10.0.data/data/devsim_data/examples/mobility/times.txt +34 -0
  69. devsim-2.10.0.data/data/devsim_data/examples/plotting/visualization.ipynb +160 -0
  70. devsim-2.10.0.data/data/devsim_data/examples/symdiff/arrhenius.py +24 -0
  71. devsim-2.10.0.data/data/devsim_data/examples/symdiff/deftest.py +48 -0
  72. devsim-2.10.0.data/data/devsim_data/examples/symdiff/modellist1.py +9 -0
  73. devsim-2.10.0.data/data/devsim_data/examples/symdiff/models1.py +41 -0
  74. devsim-2.10.0.data/data/devsim_data/examples/symdiff/ordered.py +9 -0
  75. devsim-2.10.0.data/data/devsim_data/examples/symdiff/parsetest.py +107 -0
  76. devsim-2.10.0.data/data/devsim_data/examples/symdiff/remove1.py +8 -0
  77. devsim-2.10.0.data/data/devsim_data/examples/symdiff/subexpression1.py +10 -0
  78. devsim-2.10.0.data/data/devsim_data/examples/symdiff/table.py +7 -0
  79. devsim-2.10.0.data/data/devsim_data/examples/symdiff/undefined1.py +10 -0
  80. devsim-2.10.0.data/data/devsim_data/examples/symdiff/utf8.py +10 -0
  81. devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.geo +34 -0
  82. devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.lay +1469 -0
  83. devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.msh +13596 -0
  84. devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.py +177 -0
  85. devsim-2.10.0.data/data/devsim_data/setup.cfg +23 -0
  86. devsim-2.10.0.data/data/devsim_data/setup.py +58 -0
  87. devsim-2.10.0.data/data/devsim_data/testing/3dtetmesh.msh +281 -0
  88. devsim-2.10.0.data/data/devsim_data/testing/CMakeLists.txt +175 -0
  89. devsim-2.10.0.data/data/devsim_data/testing/Fermi1.py +59 -0
  90. devsim-2.10.0.data/data/devsim_data/testing/Fermi1_float128.py +18 -0
  91. devsim-2.10.0.data/data/devsim_data/testing/GaussFermi.py +38 -0
  92. devsim-2.10.0.data/data/devsim_data/testing/GaussFermi_float128.py +18 -0
  93. devsim-2.10.0.data/data/devsim_data/testing/cap2.py +439 -0
  94. devsim-2.10.0.data/data/devsim_data/testing/cap_mesh.py +33 -0
  95. devsim-2.10.0.data/data/devsim_data/testing/circ1.py +79 -0
  96. devsim-2.10.0.data/data/devsim_data/testing/circ2.py +79 -0
  97. devsim-2.10.0.data/data/devsim_data/testing/circ3.py +18 -0
  98. devsim-2.10.0.data/data/devsim_data/testing/circ4.py +105 -0
  99. devsim-2.10.0.data/data/devsim_data/testing/dio2_element_2d.py +136 -0
  100. devsim-2.10.0.data/data/devsim_data/testing/dio2_element_physics.py +302 -0
  101. devsim-2.10.0.data/data/devsim_data/testing/equation1.py +68 -0
  102. devsim-2.10.0.data/data/devsim_data/testing/erf1.py +52 -0
  103. devsim-2.10.0.data/data/devsim_data/testing/erf2.py +34 -0
  104. devsim-2.10.0.data/data/devsim_data/testing/fpetest1.py +21 -0
  105. devsim-2.10.0.data/data/devsim_data/testing/fpetest2.py +25 -0
  106. devsim-2.10.0.data/data/devsim_data/testing/gmsh_mos3d.geo +272 -0
  107. devsim-2.10.0.data/data/devsim_data/testing/info.py +11 -0
  108. devsim-2.10.0.data/data/devsim_data/testing/kahan.py +24 -0
  109. devsim-2.10.0.data/data/devsim_data/testing/kahan_float128.py +18 -0
  110. devsim-2.10.0.data/data/devsim_data/testing/laux1.py +232 -0
  111. devsim-2.10.0.data/data/devsim_data/testing/mctest.mc +30 -0
  112. devsim-2.10.0.data/data/devsim_data/testing/mctest_user.mc +33 -0
  113. devsim-2.10.0.data/data/devsim_data/testing/mesh1.msh +52 -0
  114. devsim-2.10.0.data/data/devsim_data/testing/mesh1.py +121 -0
  115. devsim-2.10.0.data/data/devsim_data/testing/mesh2.msh +70 -0
  116. devsim-2.10.0.data/data/devsim_data/testing/mesh2.py +210 -0
  117. devsim-2.10.0.data/data/devsim_data/testing/mesh2d.py +105 -0
  118. devsim-2.10.0.data/data/devsim_data/testing/mesh3.py +8 -0
  119. devsim-2.10.0.data/data/devsim_data/testing/mesh4.py +8 -0
  120. devsim-2.10.0.data/data/devsim_data/testing/mos_2d.py +111 -0
  121. devsim-2.10.0.data/data/devsim_data/testing/mos_2d_create.py +207 -0
  122. devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart.py +69 -0
  123. devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart2.py +24 -0
  124. devsim-2.10.0.data/data/devsim_data/testing/noise_res.py +51 -0
  125. devsim-2.10.0.data/data/devsim_data/testing/noise_res_2d.py +101 -0
  126. devsim-2.10.0.data/data/devsim_data/testing/ptest1.py +53 -0
  127. devsim-2.10.0.data/data/devsim_data/testing/ptest2.py +110 -0
  128. devsim-2.10.0.data/data/devsim_data/testing/pythonmesh1d.py +202 -0
  129. devsim-2.10.0.data/data/devsim_data/testing/res1.py +65 -0
  130. devsim-2.10.0.data/data/devsim_data/testing/res2.py +65 -0
  131. devsim-2.10.0.data/data/devsim_data/testing/res3.py +59 -0
  132. devsim-2.10.0.data/data/devsim_data/testing/rundifftest.py +62 -0
  133. devsim-2.10.0.data/data/devsim_data/testing/ssac_cap.py +145 -0
  134. devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_edge.py +199 -0
  135. devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_element.py +214 -0
  136. devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_edge.py +148 -0
  137. devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_element.py +167 -0
  138. devsim-2.10.0.data/data/devsim_data/testing/ssac_circ.py +18 -0
  139. devsim-2.10.0.data/data/devsim_data/testing/ssac_res.py +30 -0
  140. devsim-2.10.0.data/data/devsim_data/testing/symdiff1.py +54 -0
  141. devsim-2.10.0.data/data/devsim_data/testing/test_common.py +435 -0
  142. devsim-2.10.0.data/data/devsim_data/testing/testfunc.py +65 -0
  143. devsim-2.10.0.data/data/devsim_data/testing/testfunc_extended.py +8 -0
  144. devsim-2.10.0.data/data/devsim_data/testing/transient_circ.py +67 -0
  145. devsim-2.10.0.data/data/devsim_data/testing/transient_circ2.py +67 -0
  146. devsim-2.10.0.data/data/devsim_data/testing/transient_circ3.py +125 -0
  147. devsim-2.10.0.data/data/devsim_data/testing/transient_rc.py +157 -0
  148. devsim-2.10.0.data/data/devsim_data/testing/trimesh1.msh +47 -0
  149. devsim-2.10.0.data/data/devsim_data/testing/trimesh1.py +114 -0
  150. devsim-2.10.0.data/data/devsim_data/testing/trimesh2.py +114 -0
  151. devsim-2.10.0.data/data/devsim_data/testing/utf8_2.py +126 -0
  152. devsim-2.10.0.dist-info/METADATA +121 -0
  153. devsim-2.10.0.dist-info/RECORD +157 -0
  154. devsim-2.10.0.dist-info/WHEEL +5 -0
  155. devsim-2.10.0.dist-info/licenses/LICENSE +202 -0
  156. devsim-2.10.0.dist-info/licenses/NOTICE +241 -0
  157. devsim-2.10.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,202 @@
1
+ from devsim import (
2
+ add_gmsh_contact,
3
+ add_gmsh_interface,
4
+ add_gmsh_region,
5
+ create_device,
6
+ create_gmsh_mesh,
7
+ finalize_mesh,
8
+ get_contact_list,
9
+ get_element_node_list,
10
+ get_interface_list,
11
+ get_node_model_values,
12
+ get_region_list,
13
+ write_devices,
14
+ )
15
+
16
+ import itertools
17
+
18
+ print("coordinates")
19
+ coordinates = []
20
+ for i in range(0, 11):
21
+ coordinates.extend([float(i), 0.0, 0.0])
22
+ print(coordinates)
23
+ print()
24
+
25
+ print("elements")
26
+ elements = []
27
+ for i in range(0, 5):
28
+ # line type, physical region 0
29
+ x = [1, 0, i, i + 1]
30
+ print(x)
31
+ elements.extend(x)
32
+ for i in range(5, 10):
33
+ # line type, physical region 1
34
+ x = [1, 1, i, i + 1]
35
+ print(x)
36
+ elements.extend([1, 1, i, i + 1])
37
+
38
+ # points for boundary conditions
39
+ elements.extend([0, 2, 0])
40
+ print(elements[-3:])
41
+ elements.extend([0, 3, 10])
42
+ print(elements[-3:])
43
+ elements.extend([0, 4, 5])
44
+ print(elements[-3:])
45
+ print()
46
+
47
+ print("physical_names")
48
+ physical_names = ["top", "bot", "top_contact", "bot_contact", "top_bot_interface"]
49
+ print(physical_names)
50
+ print()
51
+
52
+ create_gmsh_mesh(
53
+ mesh="toy",
54
+ coordinates=coordinates,
55
+ physical_names=physical_names,
56
+ elements=elements,
57
+ )
58
+ add_gmsh_region(mesh="toy", gmsh_name="top", region="top", material="silicon")
59
+ add_gmsh_region(mesh="toy", gmsh_name="bot", region="bot", material="silicon")
60
+ add_gmsh_contact(
61
+ mesh="toy",
62
+ gmsh_name="top_contact",
63
+ name="top_contact",
64
+ region="top",
65
+ material="metal",
66
+ )
67
+ add_gmsh_contact(
68
+ mesh="toy",
69
+ gmsh_name="bot_contact",
70
+ name="bot_contact",
71
+ region="bot",
72
+ material="metal",
73
+ )
74
+ add_gmsh_interface(
75
+ mesh="toy",
76
+ gmsh_name="top_bot_interface",
77
+ name="top_bot_interface",
78
+ region0="top",
79
+ region1="bot",
80
+ )
81
+ finalize_mesh(mesh="toy")
82
+ create_device(mesh="toy", device="toy")
83
+ write_devices(device="toy", file="pythonmesh1d.msh")
84
+
85
+
86
+ class MeshWriter:
87
+ def __init__(self, device):
88
+ # gets the mesh input for existing devices
89
+ self.device = device
90
+ self.physical_names = []
91
+ self.elements = []
92
+ self.coordinates = []
93
+ self.coordinates_xyz = []
94
+ self.region_to_coordinate_indexes = {}
95
+ self.name_to_physical_index = {}
96
+
97
+ def get_element_list(self, shapes, physical_index, region_coordinate_indexes):
98
+ # Element Type (float)
99
+ # 0 node
100
+ # 1 edge
101
+ # 2 triangle
102
+ # 3 tetrahedron
103
+ element_list = []
104
+ for shape in shapes:
105
+ element_list.append(len(shape) - 1)
106
+ element_list.append(physical_index)
107
+ element_list.extend([region_coordinate_indexes[i] for i in shape])
108
+ return element_list
109
+
110
+ def get_global_coordinates(self):
111
+ # this is the global list of coordinates
112
+
113
+ for r in get_region_list(device=self.device):
114
+ region_coordinates = [
115
+ int(x)
116
+ for x in get_node_model_values(
117
+ device=self.device, region=r, name="coordinate_index"
118
+ )
119
+ ]
120
+ self.region_to_coordinate_indexes[r] = region_coordinates
121
+
122
+ # expand global coordinate list as necessary
123
+ clen = max(region_coordinates) + 1
124
+ if clen > len(self.coordinates_xyz):
125
+ self.coordinates_xyz.extend([None] * (clen - len(self.coordinates_xyz)))
126
+
127
+ node_positions = zip(
128
+ get_node_model_values(device=self.device, region=r, name="x"),
129
+ get_node_model_values(device=self.device, region=r, name="y"),
130
+ get_node_model_values(device=self.device, region=r, name="z"),
131
+ )
132
+
133
+ for i, p in enumerate(node_positions):
134
+ self.coordinates_xyz[region_coordinates[i]] = p
135
+
136
+ self.coordinates = list(itertools.chain.from_iterable(self.coordinates_xyz))
137
+
138
+ def get_elements(self):
139
+ for r in get_region_list(device=self.device):
140
+ rtc = self.region_to_coordinate_indexes[r]
141
+ physical_index = self.name_to_physical_index[r]
142
+ elist = self.get_element_list(
143
+ get_element_node_list(device=self.device, region=r), physical_index, rtc
144
+ )
145
+ self.elements.extend(elist)
146
+
147
+ for c in get_contact_list(device=self.device):
148
+ r = get_region_list(device=self.device, contact=c)[0]
149
+ rtc = self.region_to_coordinate_indexes[r]
150
+ physical_index = self.name_to_physical_index[c]
151
+ elist = self.get_element_list(
152
+ get_element_node_list(device=self.device, region=r, contact=c),
153
+ physical_index,
154
+ rtc,
155
+ )
156
+ self.elements.extend(elist)
157
+
158
+ # warning, this will not work for the special periodic boundary condition
159
+ for i in get_interface_list(device=self.device):
160
+ elists = []
161
+ for r in get_region_list(device=self.device, interface=i):
162
+ rtc = self.region_to_coordinate_indexes[r]
163
+ physical_index = self.name_to_physical_index[i]
164
+ elist = self.get_element_list(
165
+ get_element_node_list(device=self.device, region=r, interface=i),
166
+ physical_index,
167
+ rtc,
168
+ )
169
+ elists.append(elist)
170
+ if elists[0] != elists[1]:
171
+ raise RuntimeError(
172
+ f"Error processing interface {i}. If you are using the periodic interface boundary condition, then please contact support for modifying script."
173
+ )
174
+ self.elements.extend(elists[0])
175
+
176
+ def populate_physical_names(self):
177
+ def add_name(name):
178
+ if name in self.name_to_physical_index:
179
+ raise RuntimeError(f"Cannot use name {name} twice")
180
+ self.physical_names.append(name)
181
+ self.name_to_physical_index[name] = len(self.physical_names) - 1
182
+
183
+ for r in get_region_list(device=self.device):
184
+ add_name(r)
185
+
186
+ for c in get_contact_list(device=self.device):
187
+ add_name(c)
188
+
189
+ for i in get_interface_list(device=self.device):
190
+ add_name(i)
191
+
192
+ def process_mesh(self):
193
+ self.populate_physical_names()
194
+ self.get_global_coordinates()
195
+ self.get_elements()
196
+
197
+
198
+ mw = MeshWriter(device="toy")
199
+ mw.process_mesh()
200
+ print(mw.physical_names)
201
+ print(mw.coordinates)
202
+ print(mw.elements)
@@ -0,0 +1,65 @@
1
+ # Copyright 2013 DEVSIM LLC
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ import devsim
6
+ import test_common
7
+
8
+ device = "MyDevice"
9
+ region = "MyRegion"
10
+ contacts = ("top", "bot")
11
+
12
+
13
+ def run_initial_bias(use_circuit_bias, net_doping=1e16):
14
+ """
15
+ use_circuit for topbias
16
+ """
17
+ test_common.SetupResistorConstants(device, region)
18
+ test_common.SetupInitialResistorSystem(device, region, net_doping)
19
+ test_common.SetupInitialResistorContact(
20
+ device=device, contact="top", use_circuit_bias=use_circuit_bias
21
+ )
22
+ test_common.SetupInitialResistorContact(device=device, contact="bot")
23
+
24
+ #####
25
+ ##### Initial DC Solution
26
+ #####
27
+ devsim.solve(
28
+ type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30
29
+ )
30
+
31
+ for name in ("Potential", "IntrinsicElectrons"):
32
+ devsim.print_node_values(device=device, region=region, name=name)
33
+
34
+ test_common.SetupCarrierResistorSystem(device, region)
35
+ test_common.SetupCarrierResistorContact(
36
+ device=device, contact="top", use_circuit_bias=use_circuit_bias
37
+ )
38
+ test_common.SetupCarrierResistorContact(device, contact="bot")
39
+
40
+
41
+ if __name__ == "__main__":
42
+ test_common.CreateSimpleMesh(device, region)
43
+ devsim.set_parameter(name="topbias", value=0.0)
44
+ devsim.set_parameter(name="botbias", value=0.0)
45
+ run_initial_bias(False)
46
+ for v in (0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10):
47
+ devsim.set_parameter(name="topbias", value=v)
48
+ devsim.solve(
49
+ type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30
50
+ )
51
+
52
+ test_common.printResistorCurrent(device=device, contact="top")
53
+ test_common.printResistorCurrent(device=device, contact="bot")
54
+
55
+ devsim.print_node_values(device=device, region=region, name="Electrons")
56
+ devsim.print_node_values(device=device, region=region, name="Potential")
57
+ devsim.print_edge_values(device=device, region=region, name="ElectricField")
58
+ devsim.print_edge_values(device=device, region=region, name="ElectronCurrent")
59
+
60
+ l = 1.0 # noqa: E741
61
+ q = 1.6e-19
62
+ n = 1.0e16
63
+ u = 400
64
+ R = l / (q * n * u)
65
+ print(0.1 / R)
@@ -0,0 +1,65 @@
1
+ # Copyright 2013 DEVSIM LLC
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ import devsim
6
+ import test_common
7
+
8
+ device = "MyDevice"
9
+ regions = ("MySi1", "MySi2")
10
+ interface = "MyInt"
11
+ contacts = ("top", "bot")
12
+
13
+ test_common.CreateSimpleMeshWithInterface(
14
+ device=device, region0=regions[0], region1=regions[1], interface=interface
15
+ )
16
+
17
+ for region in regions:
18
+ test_common.SetupResistorConstants(device, region)
19
+ test_common.SetupInitialResistorSystem(device, region, net_doping=1e16)
20
+
21
+ for contact in contacts:
22
+ test_common.SetupInitialResistorContact(device, contact=contact)
23
+
24
+ test_common.SetupContinuousPotentialAtInterface(device, interface)
25
+
26
+ #####
27
+ ##### Initial DC Solution
28
+ #####
29
+ devsim.set_parameter(name="topbias", value=0.0)
30
+ devsim.set_parameter(name="botbias", value=0.0)
31
+ devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
32
+
33
+ for region in regions:
34
+ for name in ("Potential", "IntrinsicElectrons"):
35
+ devsim.print_node_values(device=device, region=region, name=name)
36
+
37
+ for region in regions:
38
+ test_common.SetupCarrierResistorSystem(device, region)
39
+
40
+ for contact in contacts:
41
+ test_common.SetupCarrierResistorContact(device, contact=contact)
42
+
43
+ test_common.SetupContinuousElectronsAtInterface(device, interface)
44
+
45
+ for v in (0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10):
46
+ devsim.set_parameter(name="topbias", value=v)
47
+ devsim.solve(
48
+ type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30
49
+ )
50
+
51
+ test_common.printResistorCurrent(device=device, contact="top")
52
+ test_common.printResistorCurrent(device=device, contact="bot")
53
+
54
+ for region in regions:
55
+ devsim.print_node_values(device=device, region=region, name="Electrons")
56
+ devsim.print_node_values(device=device, region=region, name="Potential")
57
+ devsim.print_edge_values(device=device, region=region, name="ElectricField")
58
+ devsim.print_edge_values(device=device, region=region, name="ElectronCurrent")
59
+
60
+ l = 1.0 # noqa: E741
61
+ q = 1.6e-19
62
+ n = 1.0e16
63
+ u = 400
64
+ R = l / (q * n * u)
65
+ print(0.1 / R)
@@ -0,0 +1,59 @@
1
+ # Copyright 2013 DEVSIM LLC
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ import devsim
6
+ import test_common
7
+
8
+ device = "MyDevice"
9
+ regions = ("MySi1", "MySi2")
10
+ interface = "MyInt"
11
+ contacts = ("top", "bot")
12
+
13
+ test_common.CreateSimpleMeshWithInterface(
14
+ device=device, region0=regions[0], region1=regions[1], interface=interface
15
+ )
16
+
17
+ for region in regions:
18
+ test_common.SetupResistorConstants(device, region)
19
+ test_common.SetupInitialResistorSystem(device, region, net_doping=1e16)
20
+
21
+ for contact in contacts:
22
+ test_common.SetupInitialResistorContact(device, contact=contact)
23
+
24
+ test_common.SetupContinuousPotentialAtInterface(device, interface)
25
+
26
+ #####
27
+ ##### Initial DC Solution
28
+ #####
29
+ devsim.set_parameter(name="topbias", value=0.0)
30
+ devsim.set_parameter(name="botbias", value=0.0)
31
+ devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
32
+
33
+ for region in regions:
34
+ for name in ("Potential", "IntrinsicElectrons"):
35
+ devsim.print_node_values(device=device, region=region, name=name)
36
+
37
+ for region in regions:
38
+ test_common.SetupCarrierResistorSystem(device, region)
39
+
40
+ for contact in contacts:
41
+ test_common.SetupCarrierResistorContact(device, contact=contact)
42
+
43
+ test_common.SetupElectronSRVAtInterface(device, interface)
44
+
45
+
46
+ for v in (0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10):
47
+ devsim.set_parameter(name="topbias", value=v)
48
+ devsim.solve(
49
+ type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30
50
+ )
51
+
52
+ test_common.printResistorCurrent(device=device, contact="top")
53
+ test_common.printResistorCurrent(device=device, contact="bot")
54
+
55
+ for region in regions:
56
+ devsim.print_node_values(device=device, region=region, name="Electrons")
57
+ devsim.print_node_values(device=device, region=region, name="Potential")
58
+ devsim.print_edge_values(device=device, region=region, name="ElectricField")
59
+ devsim.print_edge_values(device=device, region=region, name="ElectronCurrent")
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env python
2
+
3
+ # ARGUMENTS
4
+ # testexe with full path
5
+ # goldenresults directory with full path
6
+ # name of the test output file to create and to compare with the goldenresults
7
+
8
+ import argparse
9
+ import os
10
+ import subprocess
11
+
12
+ parser = argparse.ArgumentParser()
13
+
14
+ parser.add_argument("--testexe", help="binary to test", required=False)
15
+ parser.add_argument("--goldendir", help="golden results directory", required=True)
16
+ parser.add_argument("--working", help="working directory", required=False, default="")
17
+ parser.add_argument(
18
+ "--output", help="output filename to compare with goldenresult", required=True
19
+ )
20
+ parser.add_argument("--args", help="list of input arguments", nargs="+", required=False)
21
+ args = parser.parse_args()
22
+
23
+ if args.working:
24
+ output_file = os.path.abspath(os.path.join(args.working, args.output))
25
+ compare_file = os.path.abspath(os.path.join(args.goldendir, args.output))
26
+ else:
27
+ head, tail = os.path.split(args.output)
28
+ if head:
29
+ output_file = os.path.abspath(args.output)
30
+ compare_file = os.path.abspath(os.path.join(args.goldendir, tail))
31
+
32
+
33
+ if output_file == compare_file:
34
+ raise RuntimeError("output and golden file cannot be the same file " + output_file)
35
+
36
+ if args.working:
37
+ os.chdir(args.working)
38
+ if args.testexe:
39
+ arguments = [
40
+ args.testexe,
41
+ ]
42
+ if args.args:
43
+ arguments.extend(args.args)
44
+ with open(output_file, "w") as ofile:
45
+ process = subprocess.run(arguments, stdout=ofile, stderr=subprocess.STDOUT)
46
+ if process.returncode != 0:
47
+ raise RuntimeError(
48
+ "%s returned error code %d" % (args.testexe, process.returncode)
49
+ )
50
+
51
+ f1stat = os.stat(output_file)
52
+ f2stat = os.stat(compare_file)
53
+
54
+ with open(output_file) as f1:
55
+ with open(compare_file) as f2:
56
+ while True:
57
+ a1 = next(f1, "SENTINELlkj")
58
+ a2 = next(f2, "SENTINELlkj")
59
+ if a1 != a2:
60
+ raise RuntimeError("%s differs from %s" % (output_file, compare_file))
61
+ elif a1 == "SENTINELlkj":
62
+ break
@@ -0,0 +1,145 @@
1
+ # Copyright 2013 DEVSIM LLC
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ # cap device to test displacement current at contact
6
+ import devsim
7
+ import test_common
8
+
9
+ device = "MyDevice"
10
+ region = "MyRegion"
11
+
12
+ test_common.CreateSimpleMesh(device, region)
13
+
14
+ ###
15
+ ### Set parameters on the region
16
+ ###
17
+ devsim.set_parameter(
18
+ device=device, region=region, name="Permittivity", value=3.9 * 8.85e-14
19
+ )
20
+
21
+ ###
22
+ ### Create the Potential solution variable
23
+ ###
24
+ devsim.node_solution(device=device, region=region, name="Potential")
25
+
26
+ ###
27
+ ### Creates the Potential@n0 and Potential@n1 edge model
28
+ ###
29
+ devsim.edge_from_node_model(device=device, region=region, node_model="Potential")
30
+
31
+ ###
32
+ ### Electric field on each edge, as well as its derivatives with respect to
33
+ ### the potential at each node
34
+ ###
35
+ devsim.edge_model(
36
+ device=device,
37
+ region=region,
38
+ name="ElectricField",
39
+ equation="(Potential@n0 - Potential@n1)*EdgeInverseLength",
40
+ )
41
+
42
+ devsim.edge_model(
43
+ device=device,
44
+ region=region,
45
+ name="ElectricField:Potential@n0",
46
+ equation="EdgeInverseLength",
47
+ )
48
+
49
+ devsim.edge_model(
50
+ device=device,
51
+ region=region,
52
+ name="ElectricField:Potential@n1",
53
+ equation="-EdgeInverseLength",
54
+ )
55
+
56
+ ###
57
+ ### Model the D Field
58
+ ###
59
+ devsim.edge_model(
60
+ device=device, region=region, name="DField", equation="Permittivity*ElectricField"
61
+ )
62
+
63
+ devsim.edge_model(
64
+ device=device,
65
+ region=region,
66
+ name="DField:Potential@n0",
67
+ equation="diff(Permittivity*ElectricField, Potential@n0)",
68
+ )
69
+
70
+ devsim.edge_model(
71
+ device=device,
72
+ region=region,
73
+ name="DField:Potential@n1",
74
+ equation="-DField:Potential@n0",
75
+ )
76
+
77
+ ###
78
+ ### Create the bulk equation
79
+ ###
80
+ devsim.equation(
81
+ device=device,
82
+ region=region,
83
+ name="PotentialEquation",
84
+ variable_name="Potential",
85
+ edge_model="DField",
86
+ variable_update="default",
87
+ )
88
+
89
+ # the topbias is a circuit node, and we want to prevent it from being overridden by a parameter
90
+ devsim.set_parameter(device=device, region=region, name="botbias", value=0.0)
91
+
92
+ for name, equation in (
93
+ ("topnode_model", "Potential - topbias"),
94
+ ("topnode_model:Potential", "1"),
95
+ ("topnode_model:topbias", "-1"),
96
+ ("botnode_model", "Potential - botbias"),
97
+ ("botnode_model:Potential", "1"),
98
+ ):
99
+ devsim.node_model(device=device, region=region, name=name, equation=equation)
100
+
101
+ # attached to circuit node
102
+ devsim.contact_equation(
103
+ device=device,
104
+ contact="top",
105
+ name="PotentialEquation",
106
+ node_model="topnode_model",
107
+ edge_charge_model="DField",
108
+ circuit_node="topbias",
109
+ )
110
+ # attached to ground
111
+ devsim.contact_equation(
112
+ device=device,
113
+ contact="bot",
114
+ name="PotentialEquation",
115
+ node_model="botnode_model",
116
+ edge_charge_model="DField",
117
+ )
118
+
119
+ #
120
+ # Voltage source
121
+ #
122
+ devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0, acreal=1.0)
123
+ devsim.circuit_element(name="R1", n1="topbias", n2=1, value=1e3)
124
+
125
+ #
126
+ devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
127
+
128
+ test_common.print_circuit_solution()
129
+ #
130
+ print(
131
+ devsim.get_contact_charge(
132
+ device=device, contact="top", equation="PotentialEquation"
133
+ )
134
+ )
135
+ print(
136
+ devsim.get_contact_charge(
137
+ device=device, contact="bot", equation="PotentialEquation"
138
+ )
139
+ )
140
+ #
141
+ devsim.solve(type="ac", frequency=1e10)
142
+ test_common.print_ac_circuit_solution()
143
+
144
+ devsim.solve(type="ac", frequency=1e15)
145
+ test_common.print_ac_circuit_solution()