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.
- devsim/__init__.py +17 -0
- devsim/devsim_py3.pyd +0 -0
- devsim/python_packages/Klaassen.py +336 -0
- devsim/python_packages/__init__.py +0 -0
- devsim/python_packages/fermi_physics.py +31 -0
- devsim/python_packages/model_create.py +262 -0
- devsim/python_packages/mos_physics.py +170 -0
- devsim/python_packages/pythonmesh.py +131 -0
- devsim/python_packages/ramp.py +101 -0
- devsim/python_packages/simple_dd.py +75 -0
- devsim/python_packages/simple_physics.py +463 -0
- devsim/umfpack/umfpack_lgpl.dll +0 -0
- devsim/umfpack/umfpack_loader.py +517 -0
- devsim/umfpack/umfshim.py +116 -0
- devsim-2.10.0.data/data/devsim_data/BUILD.md +94 -0
- devsim-2.10.0.data/data/devsim_data/CHANGES.md +773 -0
- devsim-2.10.0.data/data/devsim_data/CITATION.md +23 -0
- devsim-2.10.0.data/data/devsim_data/CODE_OF_CONDUCT.md +74 -0
- devsim-2.10.0.data/data/devsim_data/CONTRIBUTING.md +43 -0
- devsim-2.10.0.data/data/devsim_data/HOWTO.md +27 -0
- devsim-2.10.0.data/data/devsim_data/INSTALL.md +65 -0
- devsim-2.10.0.data/data/devsim_data/README.md +97 -0
- devsim-2.10.0.data/data/devsim_data/TEST.md +13 -0
- devsim-2.10.0.data/data/devsim_data/doc/devsim.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/doc/symdiff.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_2d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_3d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_common.py +399 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.geo +62 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.msh +65606 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.geo +183 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.msh +25808 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap.lay +1587 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap1d.py +155 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap2d.py +200 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/3dblock.geo +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d.py +94 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d_custom.py +159 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_2d.py +68 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_common.py +253 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_current.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_density.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_potential.lay +3272 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.msh +1477 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.py +55 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.msh +8557 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.py +74 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_equil.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_float128.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux2d.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux3d.py +54 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux_common.py +503 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/pythonmesh3d.py +61 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/ssac_diode.py +57 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/tran_diode.py +63 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.geo +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.msh +8599 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.py +96 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_create.py +174 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_kla.py +162 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/logElectrons.lay +1327 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/pythonmesh2d.py +100 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/test.lay +3385 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/times.txt +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/plotting/visualization.ipynb +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/arrhenius.py +24 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/deftest.py +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/modellist1.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/models1.py +41 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/ordered.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/parsetest.py +107 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/remove1.py +8 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/subexpression1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/table.py +7 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/undefined1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/utf8.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.geo +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.lay +1469 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.msh +13596 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.py +177 -0
- devsim-2.10.0.data/data/devsim_data/setup.cfg +23 -0
- devsim-2.10.0.data/data/devsim_data/setup.py +58 -0
- devsim-2.10.0.data/data/devsim_data/testing/3dtetmesh.msh +281 -0
- devsim-2.10.0.data/data/devsim_data/testing/CMakeLists.txt +175 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi.py +38 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap2.py +439 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap_mesh.py +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ1.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ2.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ3.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ4.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_2d.py +136 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_physics.py +302 -0
- devsim-2.10.0.data/data/devsim_data/testing/equation1.py +68 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf1.py +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf2.py +34 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest1.py +21 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest2.py +25 -0
- devsim-2.10.0.data/data/devsim_data/testing/gmsh_mos3d.geo +272 -0
- devsim-2.10.0.data/data/devsim_data/testing/info.py +11 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/laux1.py +232 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest.mc +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest_user.mc +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.msh +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.py +121 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.msh +70 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.py +210 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2d.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh3.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh4.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d.py +111 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_create.py +207 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart.py +69 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart2.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res.py +51 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res_2d.py +101 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest1.py +53 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest2.py +110 -0
- devsim-2.10.0.data/data/devsim_data/testing/pythonmesh1d.py +202 -0
- devsim-2.10.0.data/data/devsim_data/testing/res1.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res2.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res3.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/rundifftest.py +62 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap.py +145 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_edge.py +199 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_element.py +214 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_edge.py +148 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_element.py +167 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_circ.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_res.py +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/symdiff1.py +54 -0
- devsim-2.10.0.data/data/devsim_data/testing/test_common.py +435 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc_extended.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ2.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ3.py +125 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_rc.py +157 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.msh +47 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh2.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/utf8_2.py +126 -0
- devsim-2.10.0.dist-info/METADATA +121 -0
- devsim-2.10.0.dist-info/RECORD +157 -0
- devsim-2.10.0.dist-info/WHEEL +5 -0
- devsim-2.10.0.dist-info/licenses/LICENSE +202 -0
- devsim-2.10.0.dist-info/licenses/NOTICE +241 -0
- devsim-2.10.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,199 @@
|
|
|
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
|
+
xmin = -25
|
|
13
|
+
x1 = -24.975
|
|
14
|
+
x2 = -2
|
|
15
|
+
x3 = 2
|
|
16
|
+
x4 = 24.975
|
|
17
|
+
xmax = 25.0
|
|
18
|
+
|
|
19
|
+
ymin = 0.0
|
|
20
|
+
y1 = 0.1
|
|
21
|
+
y2 = 0.2
|
|
22
|
+
y3 = 0.8
|
|
23
|
+
y4 = 0.9
|
|
24
|
+
ymax = 50.0
|
|
25
|
+
|
|
26
|
+
devsim.create_2d_mesh(mesh=device)
|
|
27
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=ymin, ps=0.1)
|
|
28
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y1, ps=0.1)
|
|
29
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y2, ps=0.1)
|
|
30
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y3, ps=0.1)
|
|
31
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y4, ps=0.1)
|
|
32
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=ymax, ps=5.0)
|
|
33
|
+
|
|
34
|
+
device = device
|
|
35
|
+
region = "air"
|
|
36
|
+
|
|
37
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=xmin, ps=5)
|
|
38
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x1, ps=2)
|
|
39
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x2, ps=0.05)
|
|
40
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x3, ps=0.05)
|
|
41
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x4, ps=2)
|
|
42
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=xmax, ps=5)
|
|
43
|
+
|
|
44
|
+
devsim.add_2d_region(
|
|
45
|
+
mesh=device, material="gas", region="air", yl=ymin, yh=ymax, xl=xmin, xh=xmax
|
|
46
|
+
)
|
|
47
|
+
devsim.add_2d_region(
|
|
48
|
+
mesh=device, material="metal", region="m1", yl=y1, yh=y2, xl=x1, xh=x4
|
|
49
|
+
)
|
|
50
|
+
devsim.add_2d_region(
|
|
51
|
+
mesh=device, material="metal", region="m2", yl=y3, yh=y4, xl=x2, xh=x3
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# must be air since contacts don't have any equations
|
|
55
|
+
devsim.add_2d_contact(
|
|
56
|
+
mesh=device, name="bot", region="air", yl=y1, yh=y2, xl=x1, xh=x4, material="metal"
|
|
57
|
+
)
|
|
58
|
+
devsim.add_2d_contact(
|
|
59
|
+
mesh=device, name="top", region="air", yl=y3, yh=y4, xl=x2, xh=x3, material="metal"
|
|
60
|
+
)
|
|
61
|
+
devsim.finalize_mesh(mesh=device)
|
|
62
|
+
devsim.create_device(mesh=device, device=device)
|
|
63
|
+
|
|
64
|
+
###
|
|
65
|
+
### Set parameters on the region
|
|
66
|
+
###
|
|
67
|
+
devsim.set_parameter(
|
|
68
|
+
device=device, region=region, name="Permittivity", value=3.9 * 8.85e-14
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
###
|
|
72
|
+
### Create the Potential solution variable
|
|
73
|
+
###
|
|
74
|
+
devsim.node_solution(device=device, region=region, name="Potential")
|
|
75
|
+
|
|
76
|
+
###
|
|
77
|
+
### Creates the Potential@n0 and Potential@n1 edge model
|
|
78
|
+
###
|
|
79
|
+
devsim.edge_from_node_model(device=device, region=region, node_model="Potential")
|
|
80
|
+
|
|
81
|
+
###
|
|
82
|
+
### Electric field on each edge, as well as its derivatives with respect to
|
|
83
|
+
### the potential at each node
|
|
84
|
+
###
|
|
85
|
+
devsim.edge_model(
|
|
86
|
+
device=device,
|
|
87
|
+
region=region,
|
|
88
|
+
name="ElectricField",
|
|
89
|
+
equation="(Potential@n0 - Potential@n1)*EdgeInverseLength",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
devsim.edge_model(
|
|
93
|
+
device=device,
|
|
94
|
+
region=region,
|
|
95
|
+
name="ElectricField:Potential@n0",
|
|
96
|
+
equation="EdgeInverseLength",
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
devsim.edge_model(
|
|
100
|
+
device=device,
|
|
101
|
+
region=region,
|
|
102
|
+
name="ElectricField:Potential@n1",
|
|
103
|
+
equation="-EdgeInverseLength",
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
###
|
|
107
|
+
### Model the D Field
|
|
108
|
+
###
|
|
109
|
+
devsim.edge_model(
|
|
110
|
+
device=device, region=region, name="DField", equation="Permittivity*ElectricField"
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
devsim.edge_model(
|
|
114
|
+
device=device,
|
|
115
|
+
region=region,
|
|
116
|
+
name="DField:Potential@n0",
|
|
117
|
+
equation="diff(Permittivity*ElectricField, Potential@n0)",
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
devsim.edge_model(
|
|
121
|
+
device=device,
|
|
122
|
+
region=region,
|
|
123
|
+
name="DField:Potential@n1",
|
|
124
|
+
equation="-DField:Potential@n0",
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
###
|
|
128
|
+
### Create the bulk equation
|
|
129
|
+
###
|
|
130
|
+
devsim.equation(
|
|
131
|
+
device=device,
|
|
132
|
+
region=region,
|
|
133
|
+
name="PotentialEquation",
|
|
134
|
+
variable_name="Potential",
|
|
135
|
+
edge_model="DField",
|
|
136
|
+
variable_update="default",
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# the topbias is a circuit node, and we want to prevent it from being overridden by a parameter
|
|
140
|
+
devsim.set_parameter(device=device, region=region, name="botbias", value=0.0)
|
|
141
|
+
|
|
142
|
+
for name, equation in (
|
|
143
|
+
("topnode_model", "Potential - topbias"),
|
|
144
|
+
("topnode_model:Potential", "1"),
|
|
145
|
+
("topnode_model:topbias", "-1"),
|
|
146
|
+
("botnode_model", "Potential - botbias"),
|
|
147
|
+
("botnode_model:Potential", "1"),
|
|
148
|
+
):
|
|
149
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
150
|
+
|
|
151
|
+
# attached to circuit node
|
|
152
|
+
devsim.contact_equation(
|
|
153
|
+
device=device,
|
|
154
|
+
contact="top",
|
|
155
|
+
name="PotentialEquation",
|
|
156
|
+
node_model="topnode_model",
|
|
157
|
+
edge_charge_model="DField",
|
|
158
|
+
circuit_node="topbias",
|
|
159
|
+
)
|
|
160
|
+
# attached to ground
|
|
161
|
+
devsim.contact_equation(
|
|
162
|
+
device=device,
|
|
163
|
+
contact="bot",
|
|
164
|
+
name="PotentialEquation",
|
|
165
|
+
node_model="botnode_model",
|
|
166
|
+
edge_charge_model="DField",
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
#
|
|
170
|
+
# Voltage source
|
|
171
|
+
#
|
|
172
|
+
devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0, acreal=1.0)
|
|
173
|
+
devsim.circuit_element(name="R1", n1="topbias", n2=1, value=1e3)
|
|
174
|
+
|
|
175
|
+
#
|
|
176
|
+
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
|
|
177
|
+
test_common.print_circuit_solution()
|
|
178
|
+
#
|
|
179
|
+
print(
|
|
180
|
+
devsim.get_contact_charge(
|
|
181
|
+
device=device, contact="top", equation="PotentialEquation"
|
|
182
|
+
)
|
|
183
|
+
)
|
|
184
|
+
print(
|
|
185
|
+
devsim.get_contact_charge(
|
|
186
|
+
device=device, contact="bot", equation="PotentialEquation"
|
|
187
|
+
)
|
|
188
|
+
)
|
|
189
|
+
#
|
|
190
|
+
devsim.solve(type="ac", frequency=1e-3)
|
|
191
|
+
test_common.print_ac_circuit_solution()
|
|
192
|
+
devsim.solve(type="ac", frequency=1e10)
|
|
193
|
+
test_common.print_ac_circuit_solution()
|
|
194
|
+
devsim.solve(type="ac", frequency=1e15)
|
|
195
|
+
test_common.print_ac_circuit_solution()
|
|
196
|
+
|
|
197
|
+
# devsim.element_model(device=device, region=region, name="EDField", equation="DField")
|
|
198
|
+
# for i in devsim.get_element_model_values(device=device, region=region, name="EDField"):
|
|
199
|
+
# print(i)
|
|
@@ -0,0 +1,214 @@
|
|
|
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
|
+
xmin = -25
|
|
14
|
+
x1 = -24.975
|
|
15
|
+
x2 = -2
|
|
16
|
+
x3 = 2
|
|
17
|
+
x4 = 24.975
|
|
18
|
+
xmax = 25.0
|
|
19
|
+
|
|
20
|
+
ymin = 0.0
|
|
21
|
+
y1 = 0.1
|
|
22
|
+
y2 = 0.2
|
|
23
|
+
y3 = 0.8
|
|
24
|
+
y4 = 0.9
|
|
25
|
+
ymax = 50.0
|
|
26
|
+
|
|
27
|
+
devsim.create_2d_mesh(mesh=device)
|
|
28
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=ymin, ps=0.1)
|
|
29
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y1, ps=0.1)
|
|
30
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y2, ps=0.1)
|
|
31
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y3, ps=0.1)
|
|
32
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=y4, ps=0.1)
|
|
33
|
+
devsim.add_2d_mesh_line(mesh=device, dir="y", pos=ymax, ps=5.0)
|
|
34
|
+
|
|
35
|
+
device = device
|
|
36
|
+
region = "air"
|
|
37
|
+
|
|
38
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=xmin, ps=5)
|
|
39
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x1, ps=2)
|
|
40
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x2, ps=0.05)
|
|
41
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x3, ps=0.05)
|
|
42
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=x4, ps=2)
|
|
43
|
+
devsim.add_2d_mesh_line(mesh=device, dir="x", pos=xmax, ps=5)
|
|
44
|
+
|
|
45
|
+
devsim.add_2d_region(
|
|
46
|
+
mesh=device, material="gas", region="air", yl=ymin, yh=ymax, xl=xmin, xh=xmax
|
|
47
|
+
)
|
|
48
|
+
devsim.add_2d_region(
|
|
49
|
+
mesh=device, material="metal", region="m1", yl=y1, yh=y2, xl=x1, xh=x4
|
|
50
|
+
)
|
|
51
|
+
devsim.add_2d_region(
|
|
52
|
+
mesh=device, material="metal", region="m2", yl=y3, yh=y4, xl=x2, xh=x3
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# must be air since contacts don't have any equations
|
|
56
|
+
devsim.add_2d_contact(
|
|
57
|
+
mesh=device, name="bot", region="air", yl=y1, yh=y2, xl=x1, xh=x4, material="metal"
|
|
58
|
+
)
|
|
59
|
+
devsim.add_2d_contact(
|
|
60
|
+
mesh=device, name="top", region="air", yl=y3, yh=y4, xl=x2, xh=x3, material="metal"
|
|
61
|
+
)
|
|
62
|
+
devsim.finalize_mesh(mesh=device)
|
|
63
|
+
devsim.create_device(mesh=device, device=device)
|
|
64
|
+
|
|
65
|
+
###
|
|
66
|
+
### Set parameters on the region
|
|
67
|
+
###
|
|
68
|
+
devsim.set_parameter(
|
|
69
|
+
device=device, region=region, name="Permittivity", value=3.9 * 8.85e-14
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
###
|
|
73
|
+
### Create the Potential solution variable
|
|
74
|
+
###
|
|
75
|
+
devsim.node_solution(device=device, region=region, name="Potential")
|
|
76
|
+
|
|
77
|
+
###
|
|
78
|
+
### Creates the Potential@n0 and Potential@n1 edge model
|
|
79
|
+
###
|
|
80
|
+
devsim.edge_from_node_model(device=device, region=region, node_model="Potential")
|
|
81
|
+
|
|
82
|
+
###
|
|
83
|
+
### Electric field on each edge, as well as its derivatives with respect to
|
|
84
|
+
### the potential at each node
|
|
85
|
+
###
|
|
86
|
+
devsim.edge_model(
|
|
87
|
+
device=device,
|
|
88
|
+
region=region,
|
|
89
|
+
name="ElectricField",
|
|
90
|
+
equation="(Potential@n0 - Potential@n1)*EdgeInverseLength",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
devsim.edge_model(
|
|
94
|
+
device=device,
|
|
95
|
+
region=region,
|
|
96
|
+
name="ElectricField:Potential@n0",
|
|
97
|
+
equation="EdgeInverseLength",
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
devsim.edge_model(
|
|
101
|
+
device=device,
|
|
102
|
+
region=region,
|
|
103
|
+
name="ElectricField:Potential@n1",
|
|
104
|
+
equation="-EdgeInverseLength",
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
###
|
|
108
|
+
### Model the D Field
|
|
109
|
+
###
|
|
110
|
+
devsim.element_model(
|
|
111
|
+
device=device, region=region, name="DField", equation="Permittivity*ElectricField"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
devsim.element_model(
|
|
115
|
+
device=device,
|
|
116
|
+
region=region,
|
|
117
|
+
name="DField:Potential@en0",
|
|
118
|
+
equation="diff(Permittivity*ElectricField, Potential@n0)",
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
devsim.element_model(
|
|
122
|
+
device=device,
|
|
123
|
+
region=region,
|
|
124
|
+
name="DField:Potential@en1",
|
|
125
|
+
equation="-DField:Potential@en0",
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
devsim.element_model(
|
|
129
|
+
device=device, region=region, name="DField:Potential@en2", equation="0"
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
###
|
|
133
|
+
### Create the bulk equation
|
|
134
|
+
###
|
|
135
|
+
devsim.equation(
|
|
136
|
+
device=device,
|
|
137
|
+
region=region,
|
|
138
|
+
name="PotentialEquation",
|
|
139
|
+
variable_name="Potential",
|
|
140
|
+
element_model="DField",
|
|
141
|
+
variable_update="default",
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
# the topbias is a circuit node, and we want to prevent it from being overridden by a parameter
|
|
145
|
+
devsim.set_parameter(device=device, region=region, name="botbias", value=0.0)
|
|
146
|
+
|
|
147
|
+
for name, equation in (
|
|
148
|
+
("topnode_model", "Potential - topbias"),
|
|
149
|
+
("topnode_model:Potential", "1"),
|
|
150
|
+
("topnode_model:topbias", "-1"),
|
|
151
|
+
("botnode_model", "Potential - botbias"),
|
|
152
|
+
("botnode_model:Potential", "1"),
|
|
153
|
+
):
|
|
154
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
155
|
+
|
|
156
|
+
# attached to circuit node
|
|
157
|
+
devsim.contact_equation(
|
|
158
|
+
device=device,
|
|
159
|
+
contact="top",
|
|
160
|
+
name="PotentialEquation",
|
|
161
|
+
node_model="topnode_model",
|
|
162
|
+
element_charge_model="DField",
|
|
163
|
+
circuit_node="topbias",
|
|
164
|
+
)
|
|
165
|
+
# attached to ground
|
|
166
|
+
devsim.contact_equation(
|
|
167
|
+
device=device,
|
|
168
|
+
contact="bot",
|
|
169
|
+
name="PotentialEquation",
|
|
170
|
+
node_model="botnode_model",
|
|
171
|
+
element_charge_model="DField",
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
#
|
|
175
|
+
# Voltage source
|
|
176
|
+
#
|
|
177
|
+
devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0, acreal=1.0)
|
|
178
|
+
devsim.circuit_element(name="R1", n1="topbias", n2=1, value=1e3)
|
|
179
|
+
|
|
180
|
+
#
|
|
181
|
+
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
|
|
182
|
+
#
|
|
183
|
+
print(
|
|
184
|
+
devsim.get_contact_charge(
|
|
185
|
+
device=device, contact="top", equation="PotentialEquation"
|
|
186
|
+
)
|
|
187
|
+
)
|
|
188
|
+
print(
|
|
189
|
+
devsim.get_contact_charge(
|
|
190
|
+
device=device, contact="bot", equation="PotentialEquation"
|
|
191
|
+
)
|
|
192
|
+
)
|
|
193
|
+
#
|
|
194
|
+
devsim.solve(type="ac", frequency=1e-3)
|
|
195
|
+
test_common.print_ac_circuit_solution()
|
|
196
|
+
devsim.solve(type="ac", frequency=1e10)
|
|
197
|
+
test_common.print_ac_circuit_solution()
|
|
198
|
+
devsim.solve(type="ac", frequency=1e15)
|
|
199
|
+
test_common.print_ac_circuit_solution()
|
|
200
|
+
|
|
201
|
+
# for i in devsim.get_element_model_values(device=device, region=region, name="DField"):
|
|
202
|
+
# print(i)
|
|
203
|
+
#
|
|
204
|
+
# ec = devsim.get_edge_model_values(device=device, region=region, name="EdgeCouple")
|
|
205
|
+
# devsim.element_model(device=device, region=region, name="eindex", equation="edge_index")
|
|
206
|
+
# ei = [int(x) for x in devsim.get_element_model_values(device=device, region=region, name="eindex")]
|
|
207
|
+
# eec = devsim.get_element_model_values(device=device, region=region, name="ElementEdgeCouple")
|
|
208
|
+
# ec_compare=[0.0]*len(ec)
|
|
209
|
+
# for q, v in zip(ei, eec):
|
|
210
|
+
# #print(q,v)
|
|
211
|
+
# ec_compare[q] += v
|
|
212
|
+
#
|
|
213
|
+
# for q,v in zip(ec, ec_compare):
|
|
214
|
+
# print(q,v)
|
|
@@ -0,0 +1,148 @@
|
|
|
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 = "test"
|
|
10
|
+
region = "bulk"
|
|
11
|
+
devsim.load_devices(file="3dtetmesh.msh")
|
|
12
|
+
# c=3.9*8.85e-14*(6e-2*6e-2)/6e-2
|
|
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
|
+
print(
|
|
129
|
+
devsim.get_contact_charge(
|
|
130
|
+
device=device, contact="top", equation="PotentialEquation"
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
print(
|
|
134
|
+
devsim.get_contact_charge(
|
|
135
|
+
device=device, contact="bot", equation="PotentialEquation"
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
#
|
|
139
|
+
devsim.solve(type="ac", frequency=1e-3)
|
|
140
|
+
test_common.print_ac_circuit_solution()
|
|
141
|
+
devsim.solve(type="ac", frequency=1e10)
|
|
142
|
+
test_common.print_ac_circuit_solution()
|
|
143
|
+
devsim.solve(type="ac", frequency=1e15)
|
|
144
|
+
test_common.print_ac_circuit_solution()
|
|
145
|
+
|
|
146
|
+
# devsim.element_model(device=device, region=region, name="EDField", equation="DField")
|
|
147
|
+
# for i in devsim.get_element_model_values(device=device, region=region, name="EDField"):
|
|
148
|
+
# print(i)
|