DEVSIM Manual
Release 2.10.0
DEVSIM LLC
Con en s
Con en s i
Lis o Figu es ii
Lis o Tables iii
1 F on ma e 1
1.1 Con ac ........................................... 1
1.2 Copy igh .......................................... 1
1.3 Ci ing his wo k ....................................... 1
1.4 Con ibu ing ......................................... 1
1.5 Documen a ion license ................................... 2
1.6 Documen a ion sou ce ................................... 2
1.7 So wa e license ...................................... 2
1.8 Thi d pa y licenses .................................... 2
1.9 Disclaime .......................................... 2
1.10 T adema k .......................................... 2
2 Release no es 3
2.1 In oduc ion ......................................... 3
2.2 Ve sion 2.10.0 ....................................... 3
2.2.1 Reg ession esul s ................................. 3
2.2.2 A ailable pla o m builds .............................. 3
macOS ....................................... 3
Windows ...................................... 4
Linux ........................................ 4
2.2.3 Py hon Ve sion ................................... 4
2.2.4 Con ac No mal Model ............................... 4
2.2.5 Documen a ion ................................... 4
2.3 Ve sion 2.9.1 ........................................ 4
2.4 Ve sion 2.9.0 ........................................ 5
2.4.1 Windows Py hon suppo ............................. 5
2.4.2 VTK w i e ..................................... 5
2.4.3 Clang build on Windows .............................. 5
2.5 Ve sion 2.8.4 ........................................ 5
2.5.1 Se ializa ion o equa ion command ........................ 5
2.5.2 Simula ion Ma ix .................................. 5
i
2.5.3 macOS Build .................................... 5
2.6 Ve sion 2.8.3 ........................................ 6
2.6.1 Linux suppo .................................... 6
2.6.2 Clang o ma .................................... 6
2.6.3 Ge equa ion command .............................. 6
2.6.4 Excep ion p opaga ion ............................... 6
2.7 Ve sion 2.8.2 ........................................ 6
2.7.1 Documen a ion e ac o .............................. 6
2.8 Ve sion 2.8.1 ........................................ 6
2.8.1 Help iles ...................................... 6
2.8.2 Da abase command emo al ........................... 7
2.9 Ve sion 2.8.0 ........................................ 7
2.9.1 Py hon sc ip s ................................... 7
2.9.2 Da a ou pu ..................................... 7
Reduc ion in da a ile sizes ............................ 7
FLOOPS da a ile ou pu ............................. 8
2.9.3 Pla o m suppo .................................. 8
Windows build issue ................................ 8
Cen os 7 end o li e ................................ 8
2.10 P e ious eleases ..................................... 8
3 Ge ing s a ed 9
3.1 In oduc ion ......................................... 9
3.2 Ge ing help ......................................... 9
3.3 Suppo ed pla o ms .................................... 10
3.4 Ins all Py hon ........................................ 10
3.4.1 C ea e i ual en i onmen ............................ 10
Anaconda ...................................... 10
Using en ..................................... 11
3.5 Ins all DEVSIM ....................................... 11
3.5.1 Ins all ........................................ 11
3.5.2 Tes ......................................... 11
3.5.3 Running DEVSIM ................................. 12
3.6 Building om sou ce .................................... 12
3.7 Ins all ex e nal so wa e ools ............................... 12
3.7.1 Meshing ....................................... 12
Gmsh ........................................ 12
O he meshe s ................................... 12
3.7.2 Visualiza ion .................................... 13
3.7.3 Ma h lib a ies .................................... 13
BLAS and LAPACK ................................ 13
In el MKL Pa diso ................................ 13
4 Use in e ace 14
4.1 S a ing DEVSIM ...................................... 14
4.2 Di ec o y s uc u e ..................................... 14
4.3 Py hon language ...................................... 15
4.3.1 In oduc ion ..................................... 15
ii
4.3.2 DEVSIM commands ................................ 15
4.3.3 Unicode suppo .................................. 15
4.4 E o handling ........................................ 15
4.4.1 Excep ions ..................................... 15
4.4.2 Fa al e o s ..................................... 15
4.4.3 Floa ing poin excep ions ............................. 16
4.4.4 Sol e e o s .................................... 16
4.4.5 Example ....................................... 16
4.5 Ve bosi y .......................................... 16
4.6 Command help ....................................... 17
4.7 Pa alleliza ion ........................................ 17
4.7.1 Model e alua ion .................................. 17
4.7.2 Long ope a ions .................................. 17
4.7.3 Ex e nal ma h lib a ies ............................... 17
4.8 Rese simula o ....................................... 18
4.9 A ay ype inpu and ou pu ................................ 18
5 Equa ion and models 19
5.1 O e iew .......................................... 19
5.1.1 S uc u es ...................................... 23
5.2 Bulk models ......................................... 23
5.2.1 Node models .................................... 23
5.2.2 Edge models .................................... 24
5.2.3 Elemen edge models ............................... 25
5.2.4 Model de i a i es .................................. 26
5.2.5 Con e sions be ween model ypes ........................ 26
5.2.6 Equa ion assembly ................................. 27
5.3 In e ace ........................................... 27
5.3.1 In e ace models .................................. 27
5.3.2 In e ace model de i a i es ............................ 29
5.3.3 In e ace equa ion assembly ........................... 29
5.4 Con ac ........................................... 30
5.4.1 Con ac models ................................... 30
5.4.2 Con ac model de i a i es ............................. 30
5.4.3 Con ac equa ion assembly ............................ 31
5.5 Cus om ma ix assembly .................................. 31
5.6 Cylind ical coo dina e sys ems .............................. 32
5.7 No es ............................................ 33
5.7.1 In e ace ....................................... 33
In e ace equa ion coupling ............................ 33
In e ace and con ac su ace a ea ........................ 33
Skip nodes sha ed wi h con ac .......................... 33
5.7.2 Elemen assembly ................................. 33
5.7.3 Edge olume model ................................ 34
5.7.4 Elemen pai om edge model .......................... 34
6 Pa ame e s 35
6.1 Pa ame e s ......................................... 35
iii
6.2 En i onmen a iables ................................... 36
6.3 No es ............................................ 37
7 Ci cui s 38
7.1 O e iew .......................................... 38
7.2 Ci cui elemen s ...................................... 38
7.3 Connec ing de ices .................................... 38
7.4 Clea ing ci cui ....................................... 39
8 Meshing 40
8.1 1D meshe ......................................... 40
8.2 2D meshe ......................................... 41
8.3 Using an ex e nal meshe ................................. 42
8.3.1 Gmsh ........................................ 42
8.3.2 Cus om mesh loading using sc ip ing ...................... 43
8.4 Loading and sa ing esul s ................................ 43
8.5 Mesh p ocessing ...................................... 43
8.6 No es ............................................ 43
8.6.1 Con ac s ...................................... 43
Con ac ma e ial .................................. 43
C ea e con ac s om in e ace .......................... 43
8.6.2 De ice and mesh dele ion commands ...................... 44
8.6.3 Pe iodic bounda y condi ions ........................... 44
9 Sol e and nume ics 45
9.1 O e iew .......................................... 45
9.2 Solu ion me hods ...................................... 45
9.2.1 DC analysis ..................................... 45
9.2.2 AC analysis ..................................... 46
9.2.3 Noise and sensi i i y analysis ........................... 46
9.2.4 T ansien analysis ................................. 46
9.3 Ex ended p ecision ..................................... 47
9.3.1 Pla o m dependence ............................... 47
9.3.2 How o con ol ................................... 47
9.3.3 Kahan summa ion in ex ended p ecision mode ................. 47
9.4 Floa ing poin excep ions ................................. 47
9.4.1 FPE checking du ing ex e nal sol e ....................... 47
9.4.2 Addi ional In o ma ion ............................... 48
9.5 Sol e and ma h lib a y selec ion ............................. 48
9.5.1 A ailable lib a ies .................................. 48
In el Ma h Ke nel Lib a y ............................. 48
UMFPACK 5.1 sol e ................................ 48
Cus om sol e ................................... 48
Supe LU ....................................... 48
9.5.2 Au oma ic di ec sol e selec ion ......................... 49
9.5.3 BLAS/LAPACK lib a y selec ion .......................... 49
9.5.4 De aul ma h sea ch pa h ............................. 50
9.5.5 De e mine loaded ma h lib a ies ......................... 50
i
9.6 Cus om di ec sol e .................................... 50
9.7 Diagnos ics ......................................... 50
9.7.1 P oblem node iden i ica ion ............................ 50
9.7.2 Con e gence in o ma ion ............................. 51
9.8 Symbolic ac o iza ion euse ................................ 51
9.9 No es ............................................ 51
9.9.1 Con e gence es s ................................. 51
9.9.2 Simula ion ma ix .................................. 52
9.9.3 Ge ma ix and hs o ex e nal use ........................ 52
9.9.4 T ansien analysis ................................. 52
10 SYMDIFF 53
10.1 O e iew .......................................... 53
10.2 Syn ax ............................................ 53
10.2.1 Va iables and numbe s .............................. 53
10.2.2 Basic exp essions ................................. 54
10.2.3 Func ions ...................................... 55
10.2.4 Commands ..................................... 57
10.2.5 Use unc ions ................................... 57
10.2.6 Mac o assignmen ................................. 58
10.3 In oking SYMDIFF om DEVSIM ............................. 59
10.3.1 Equa ion pa se .................................. 59
10.3.2 E alua ing ex e nal ma h ............................. 59
10.3.3 Models ....................................... 60
11 Visualiza ion and pos p ocessing 61
11.1 In oduc ion ......................................... 61
11.2 Visualiza ion so wa e ................................... 61
11.2.1 O e iew ...................................... 61
11.2.2 Using Pa aView ................................... 61
11.2.3 Using VisI ..................................... 62
11.3 Reducing ile sizes ..................................... 62
11.4 Pos p ocessing ....................................... 62
11.4.1 Index in o ma ion .................................. 62
11.4.2 Elemen node lis .................................. 62
12 Examples 63
12.1 Included examples ..................................... 63
12.2 Tes sc ip s ......................................... 65
12.3 Rela ed p ojec s ...................................... 65
12.3.1 Sou ce code .................................... 65
12.3.2 Examples ...................................... 66
12.3.3 Reg ession esul s ................................. 66
12.4 Mobile app ......................................... 66
12.5 Thi d pa y lib a ies ..................................... 67
13 Simple Examples 68
13.1 Capaci o .......................................... 68
13.1.1 O e iew ...................................... 68
13.1.2 1D capaci o .................................... 68
Equa ions ...................................... 68
C ea ing he mesh ................................. 69
Se ing de ice pa ame e s ............................. 69
C ea ing he models ................................ 69
Con ac bounda y condi ions ........................... 71
Se ing he bounda y condi ions ......................... 71
Running he simula ion .............................. 72
13.1.3 2D capaci o .................................... 72
De ining he mesh ................................. 72
Se ing up he models ............................... 74
Fields o isualiza ion ............................... 75
Running he simula ion .............................. 76
13.2 Diode ............................................ 78
13.2.1 O e iew ...................................... 78
13.2.2 1D diode ...................................... 78
Using he py hon packages ............................ 78
C ea ing he mesh ................................. 78
Physical models and pa ame e s ......................... 79
Plo ing he esul .................................. 81
14 Command Re e ence 84
14.1 Ci cui commands ..................................... 84
14.2 Equa ion commands .................................... 86
14.3 Geome y commands ................................... 90
14.4 Ma e ial commands .................................... 91
14.5 Meshing commands .................................... 93
14.6 Model commands ..................................... 99
14.7 Sol e commands .....................................114
Bibliog aphy 116
Index 117
i
Lis o Figu es
5.1 Mesh elemen s in 2D .................................... 20
5.2 Edge model cons uc s in 2D ............................... 21
5.3 Elemen edge model cons uc s in 2D .......................... 22
5.4 In e ace cons uc s in 2D. In e ace node pai s a e loca ed a each •. The
Su aceA ea model is used o in eg a e lux e m models. ............... 28
5.5 Con ac cons uc s in 2D. ................................. 30
12.1 Simula ion esul o sol ing o he magne ic po en ial and ield. The colo ing is by
he Z componen o he magne ic po en ial, and he s eam aces a e o compo-
nen s o magne ic ield. .................................. 64
13.1 Capaci ance simula ion esul . The colo ing is by Po en ial, and he s eam aces
a e o componen s o Elec icField........................... 77
13.2 Ca ie densi y e sus posi ion in 1D diode. ....................... 81
13.3 Po en ial and elec ic ield e sus posi ion in 1D diode. ................. 82
13.4 Elec on and hole cu en and ecombina ion. ...................... 83
ii
Lis o Tables
1.1 Con ac ........................................... 1
2.1 Added documen a ion iles ................................ 7
3.1 Cu en pla o ms o DEVSIM ................................ 10
3.2 Py hon dis ibu ions .................................... 10
4.1 Di ec o y s uc u e o DEVSIM ............................... 14
5.1 Node models de ined on each egion o a de ice .................... 24
5.2 Edge models de ined on each egion o a de ice .................... 25
5.3 Elemen edge models de ined on each egion o a de ice ............... 25
5.4 Requi ed de i a i es o equa ion assembly. model is he name o he model being
e alua ed, and a iable is one o he solu ion a iables being sol ed a each node . 26
5.5 Requi ed de i a i es o in e ace equa ion assembly. The node model name
nodemodel and i s de i a i es nodemodel: a iable a e su ixed wi h @ 0 and @ 1
o deno e which egion on he in e ace is being e e ed o .............. 27
6.1 Pa ame e s con olling p og am beha io ........................ 36
6.2 En i onmen con olling p og am beha io ........................ 36
10.1 Basic exp essions in ol ing una y, bina y, and logical ope a o s ............ 54
10.2 P ede ined unc ions .................................... 55
10.3 E o unc ions ....................................... 56
10.4 Fe mi In eg al unc ions .................................. 56
10.5 Gauss-Fe mi In eg al unc ions .............................. 56
10.6 Commands ......................................... 57
10.7 Commands o use unc ions ............................... 57
11.1 Open sou ce isualiza ion ools .............................. 61
12.1 Examples Dis ibu ed wi h DEVSIM ............................ 63
13.1 Py hon package iles .................................... 78
iii
DEVSIM Manual, Release 2.10.0
Table 2.1: Added documen a ion iles
File Pu pose
BUILD.md Building om sou ce
CODE_OF_CONDUCT.md Code o conduc
TEST.md Tes ing ins uc ions
2.8.2 Da abase command emo al
The ma e ial da abase has been emo ed.
•de sim.c ea e_db
•de sim.open_db
•de sim.close_db
•de sim.sa e_db
•de sim.add_db_en y
•de sim.ge _db_en y
This ea u e was only being used in he bioapp1 examples, and hose es s ha e been upda ed.
This also emo es he bina y dependence on SQLi e.
2.9 Ve sion 2.8.0
2.9.1 Py hon sc ip s
Based on a con ibu ion by [@simbilod](h ps://gi hub.com/simbilod), all o he Py hon sc ip s ha e
been e o ma ed. The build sys em was also upda ed o en o ce Py hon sc ip modi ica ions a e
p ope ly o ma ed when submi ed o he p ojec .
2.9.2 Da a ou pu
Reduc ion in da a ile sizes
Based on a con ibu ion by [@simbilod](h ps://gi hub.com/simbilod)de sim.w i e_de ices()
(page 98) now suppo s educing he ile size o da a iles by allowing use s o speci y a call-
back unc ion o educe da a usage. In his example, only he Ne Doping ield is w i en o he
Tecplo da a ile.
de sim.w i e_de ices(
ile="mesh2d_ educed. ec",
ype=" ecplo ",
(con inues on nex page)
2.9. Ve sion 2.8.0 7
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
include_ es =lambda x: x in ("Ne Doping",),
)
FLOOPS da a ile ou pu
The loops op ion o de sim.w i e_de ices() (page 98) has been emo ed.
2.9.3 Pla o m suppo
Windows build issue
Du ing es ing, i was ound he Visual S udio 2022 builds we e ailing a es ela ed o h eading.
This was ound o be a p oblem wi h e sion 17.10, bu no e sion 17.9. This a ec s he build
au oma ion, bu should no a ec he bina y eleases.
Cen os 7 end o li e
This is he las e sion o suppo Cen os 7 be o e i s end o li e on June 30, 2024. A e his da e
we will be mo ing o he AlmaLinux 8 based manylinux_2_28.
2.10 P e ious eleases
Fo olde elease no es, please e e o he Ve sion 2.8.1 manual loca ed a h ps://doi.o g/10.5281/
zenodo.12211919. The la es e sion is a ailable om h ps://doi.o g/10.5281/zenodo.4583208.
2.10. P e ious eleases 8
Chap e 3
Ge ing s a ed
3.1 In oduc ion
DEVSIM is a echnology compu e -aided design (TCAD) so wa e o semiconduc o de ice simu-
la ion. While gea ed owa d his applica ion, i may be used whe e he con ol olume app oach
is app op ia e o sol ing sys ems o pa ial-di e en ial equa ions (PDE’s) on a s a ic mesh. A -
e in oducing DEVSIM, he es o he manual discusses he key componen s o he sys em, and
ins uc ions o hei use.
The p ima y goal o DEVSIM is o gi e he use as much lexibili y and con ol as possible. In his
ega d, ew models a e coded in o he p og am bina y. They a e implemen ed in human- eadable
sc ip s ha can be modi ied i necessa y.
DEVSIM has a sc ip ing language in e ace (Use in e ace (page 14)). This p o ides con ol s uc-
u es and language syn ax in a consis en and in ui i e manne . The use is p o ided an en i-
onmen whe e hey can implemen new models on hei own. This is wi hou equi ing ex ensi e
endo suppo o use o compiled p og amming languages.
SYMDIFF (SYMDIFF (page 53)) is he symbolic exp ession pa se used o allow he o mula ion
o de ice equa ions in e ms o models and pa ame e s. Using symbolic di e en ia ion, he e-
qui ed pa ial de i a i es can be gene a ed, o p o ided by he use . DEVSIM hen assembles hese
equa ions o e he mesh.
3.2 Ge ing help
Please see Con ac (page 1) o p ojec con ac in o ma ion. The mos esponsi e me hod is o
con ac he online o um a h ps:// o um.de sim.o g. Addi ional in o ma ion, wi h links o documen-
a ion is a ailable a h ps://de sim.o g. Addi ional documen a ion iles eleased wi h he simula o
a e p esen ed a h ps://pypi.o g/p ojec /de sim/.
9
DEVSIM Manual, Release 2.10.0
3.3 Suppo ed pla o ms
DEVSIM is compiled and es ed on he pla o ms in Table 3.1.
Table 3.1: Cu en pla o ms o DEVSIM
Pla o m A chi ec u e OS Ve sion
Mic oso Windows x64 Mic oso Windows 10
Linux x86_64, aa ch64 Red Ha En e p ise Linux 8 (AlmaLinux 8
compa ible)
Apple macOS a m64 macOS 14.7.6 (Sonoma)
These a e he minimum suppo ed pla o ms, and also expec ed o wo k on newe e sions o
hese ope a ing sys ems. I you equi e a e sion on a di e en so wa e pla o m, please con ac
us Con ac (page 1).
3.4 Ins all Py hon
APy hon e sion o 3.7 o highe is needed o un DEVSIM. This equi emen is o en me by he
de aul ins alla ions o he abo e sys ems. In addi ion, i is possible o download o he Py hon
e sions online. Popula dis ibu ions o Py hon a e lis ed in Table 3.2.
Table 3.2: Py hon dis ibu ions
Vendo Pa h Websi e
Anaconda $CONDA_PREFIX h ps://www.anaconda.com
Py hon.o g $VIRTUAL_ENV h ps://py hon.o g
3.4.1 C ea e i ual en i onmen
C ea ing a i ual en i onmen is needed so DEVSIM may necessa y ma h lib a ies, as discussed
in De aul ma h sea ch pa h (page 50). The numpy package is also ecommended o ensu e ha
needed ma h lib a ies a e a ailable.
Anaconda
Using he conda package manage in an Anaconda, a i ual en i onmen is c ea ed using.
conda c ea e -n den py hon numpy
conda ac i a e den
whe e den is he name o he en i onmen . I you a e using a x64 o x86_64 based sys em, you
may ins all he In el Ma h Ke nel Lib a y wi h he Pa diso Sol e .
3.3. Suppo ed pla o ms 10
DEVSIM Manual, Release 2.10.0
conda ins all mkl
Using en
Fo o he Py hon dis ibu ions, he equisi e packages may be ins alled by using a en based
i ual en i onmen .
py hon3 -m en den
sou ce den /bin/ac i a e
pip ins all numpy
whe e den is he name o di ec o y con aining he en i onmen . I you a e using a x64 o x86_64
based sys em, you may ins all he In el Ma h Ke nel Lib a y wi h he Pa diso Sol e .
pip ins all mkl
3.5 Ins all DEVSIM
3.5.1 Ins all
DEVSIM is a ailable om PyPI (h ps://pypi.o g/p ojec /de sim/) using pip. To ins all his package
o you pla o m:
pip ins all de sim
Please see he de sim_da a/INSTALL.md ile in he dis ibu ion o mo e in o ma ion. This iles
may be ound in he p e ix di ec o y o you chosen en i onmen lis ed in Table 3.2.
3.5.2 Tes
To ensu e a p ope ins alla ion, please ype he ollowing a a Py hon p omp .
>>> impo de sim
Sea ching DEVSIM_MATH_LIBS="libopenblas.dylib:liblapack.dylib:libblas.dylib"
Loading "libopenblas.dylib": ALL BLAS/LAPACK LOADED
Skipping liblapack.dylib
Skipping libblas.dylib
loading UMFPACK 5.1 as di ec sol e
No e ha he e will be an e o i no ma h lib a ies a e a ailable.
>>> impo de sim
Sea ching DEVSIM_MATH_LIBS="libopenblas.so:liblapack.so:libblas.so"
Loading "libopenblas.so": MISSING DLL
(con inues on nex page)
3.5. Ins all DEVSIM 11
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
Loading "liblapack.so": MISSING DLL
Loading "libblas.so": MISSING DLL
E o loading ma h lib a ies. Please ins all a sui able BLAS/LAPACK lib a y and␣
,→se DEVSIM_MATH_LIBS. Al e na i ely, ins all he In el MKL.
libblas.so: canno open sha ed objec ile: No such ile o di ec o y
T aceback (mos ecen call las ):
File "<s din>", line 1, in <module>
File "/home/use / en /lib/py hon3.8/si e-packages/de sim/__ini __.py", line 8,␣
,→in <module>
om .de sim_py3 impo *
Run imeE o : Issues ini ializing DEVSIM.
3.5.3 Running DEVSIM
See Use in e ace (page 14) o ins uc ions on how o in oke DEVSIM.
3.6 Building om sou ce
Building om sou ce is possible, and is use ul when you wan o ex end he simula o , use com-
pile op imiza ions, o po o a new pla o m. See he BUILD.md ile in he p ojec iles o mo e
in o ma ion.
3.7 Ins all ex e nal so wa e ools
3.7.1 Meshing
Gmsh
Gmsh [2] is a ailable om h ps://gmsh.in o.DEVSIM is able o impo iangula o e ahed al
meshes om his applica ion. Mo e in o ma ion is in Gmsh (page 42).
O he meshe s
I is also possible o impo o he mesh o ma s by w i ing a con e e in Py hon, as desc ibed in
Cus om mesh loading using sc ip ing (page 43).
3.6. Building om sou ce 12
DEVSIM Manual, Release 2.10.0
3.7.2 Visualiza ion
See Visualiza ion so wa e (page 61) o a lis ing o a ailable meshing ools, which a e known o
wo k wi h DEVSIM.
3.7.3 Ma h lib a ies
BLAS and LAPACK
These a e he basic linea algeb a ou ines used in DEVSIM and hei selec ion is desc ibed in
BLAS/LAPACK lib a y selec ion (page 49).
In el MKL Pa diso
This lib a y may be ins alled and selec ed using he ins uc ions in A ailable lib a ies (page 48).
3.7. Ins all ex e nal so wa e ools 13
Chap e 4
Use in e ace
4.1 S a ing DEVSIM
Re e o Suppo ed pla o ms (page 10) o ins uc ions on how o ins all DEVSIM. Once ins alled,
DEVSIM may be in oked using he ollowing command
de sim is loaded by calling
impo de sim
om Py hon.
Many o he examples in he dis ibu ion ely on he py hon_packages module, which is a ailable
by using:
impo de sim.py hon_packages
4.2 Di ec o y s uc u e
ADEVSIM di ec o y is c ea ed wi h he ollowing sub di ec o ies lis ed in Di ec o y s uc u e o
DEVSIM (page 14).
Table 4.1: Di ec o y s uc u e o DEVSIM
de sim_da a con ains p ojec documen a ion iles
de sim_da a/doc p oduc documen a ion
de sim_da a/examples example sc ip s
de sim_da a/ es ing addi ional examples used o es ing
This may be ound using he i ual en i onmen pa h speci ied in Table 3.2.
14
DEVSIM Manual, Release 2.10.0
4.3 Py hon language
4.3.1 In oduc ion
Py hon is he sc ip ing language employed as he ex in e ace o DEVSIM. Documen a ion and
u o ials o he language a e a ailable om [1]. A pape discussing he gene al bene i s o using
sc ip ing languages may be ound in [5].
4.3.2 DEVSIM commands
All o commands a e in he de sim namespace. In o de o in oke a command, he command
should be p e ixed wi h de sim., o he ollowing may be placed a he beginning o he sc ip :
om de sim impo *
4.3.3 Unicode suppo
In e nally, DEVSIM uses UTF-8 encoding, and expec s model equa ions and sa ed mesh iles o be
w i en using his encoding. Ca e should be aken when using non-ASCII cha ac e s in names o
isualiza ion using he ools in Visualiza ion and pos p ocessing (page 61), as his cha ac e se
may no be suppo ed in hese hi d-pa y ools.
4.4 E o handling
4.4.1 Excep ions
When a syn ax e o occu s in a Py hon sc ip an excep ion may be h own. I i is uncaugh , hen
DEVSIM will e mina e. An excep ion ha is h own by DEVSIM is o he ype de sim.e o . I may
be caugh , and a message may be ex ac ed o de e mine he issue.
4.4.2 Fa al e o s
When DEVSIM en e s a s a e in which i may no eco e . The in e p e e will h ow a de sim.e o
excep ion wi h a message DEVSIM FATAL. A his poin DEVSIM may en e an inconsis en s a e, so
i is sugges ed no o a emp o con inue sc ip execu ion i his occu s.
In a e si ua ions, he p og am may beha e in an e a ic manne , p in a message, such as
UNEXPECTED o e mina e ab up ly. Please epo his using he con ac in o ma ion in Con ac
(page 1).
4.3. Py hon language 15
DEVSIM Manual, Release 2.10.0
4.4.3 Floa ing poin excep ions
Du ing model e alua ion, DEVSIM will a emp o de ec loa ing poin issues and e u n an e o
wi h some diagnos ic in o ma ion p in ed o he sc een, such as he symbolic exp ession being
e alua ed. Floa ing poin e o s may be cha ac e ized as in alid, di ision by ze o, and nume ical
o e low. This is conside ed o be a a al e o .
4.4.4 Sol e e o s
When using he de sim.sol e() (page 114), he sol e may no con e ge and a message will be
p in ed and an excep ion may be h own. The solu ion will be es o ed o i s p e ious alue be o e
he simula ion began. This excep ion may be caugh and he bias condi ions may be changed so
he simula ion may be con inued.
4.4.5 Example
Mo e help ul excep ion in o ma ion e u ned o Py hon i he e o is conside ed a al. This can
be used o decide i he simula ion can be es a ed. No e ha i his occu s du ing a sol e, i is
necessa y o he use o es o e he p e ious ci cui and de ice solu ions i a es a is desi ed. In
addi ion, model e alua ion is ese so ha no alse cyclic dependencies a e epo ed a e an e o .
In his example code below, he p e iously DEVSIM FATAL e o s ing will now p o ide he con ex
ha a loa ing poin excep ion occu ed and be handled in Py hon.
y:
sel .sol e()
excep e o as msg:
m = s (msg)
i 'Con e gence ailu e'in m:
sel .se _ app(las _bias)
eli ' loa ing poin excep ion'in m:
sel .se _ app(las _bias)
sel . es o e_callback(sel .is_ci cui )
else:
aise
4.5 Ve bosi y
The se _pa ame e () may be used o se he e bosi y globally, pe de ice, o pe egion. Se ing
he debug_le el pa ame e o in o esul s in he de aul le el o in o ma ion o he sc een. Se ing
his op ion o e bose o any o he name esul s in mo e in o ma ion o he sc een which may be
use ul o debugging.
The ollowing example se s he de aul le el o debugging o he en i e simula ion, excep ha he
ga e egion will ha e addi ional debugging in o ma ion.
4.5. Ve bosi y 16
DEVSIM Manual, Release 2.10.0
5.1.1 S uc u es
De ices Ade ice e e s o a disc e e s uc u e being simula ed. I is composed o he ollowing
ypes o objec s.
Regions A egion de ines a po ion o he de ice o a speci ic ma e ial. Each egion has i s own
sys em o equa ions being sol ed.
In e aces An in e ace connec s wo egions oge he . A he in e aces, equa ions a e speci ied
o accoun o how he lux in each de ice egion c osses he egion bounda y.
Con ac s Acon ac speci ies he bounda y condi ions equi ed o de ice simula ion. I also
speci ies how e minal cu en s a e a e in eg a ed in o an ex e nal ci cui .
5.2 Bulk models
5.2.1 Node models
Node models may be speci ied in e ms o o he node models, ma hema ical unc ions, and pa-
ame e s on he de ice. The simples model is he node solu ion, and i ep esen s he solu ion
a iables being sol ed o . Node models au oma ically c ea ed o a egion a e lis ed in Node
models de ined on each egion o a de ice (page 24).
In his example, we p esen an implemen a ion o Shockley Read Hall ecombina ion [4].
USRH="-Elec onCha ge*(Elec ons*Holes - n_i^2)/( aup*(Elec ons + n1)
+ aun*(Holes + p1))")
dUSRHdn="simpli y(di (%s , Elec ons))" %USRH
dUSRHdp="simpli y(di (%s , Holes))" %USRH
de sim.node_model(de ice='MyDe ice', egion='MyRegion',
name="USRH", equa ion=USRH)
de sim.node_model(de ice='MyDe ice', egion='MyRegion',
name="USRH:Elec ons", equa ion=dUSRHdn)
de sim.node_model(de ice='MyDe ice', egion='MyRegion',
name="USRH:Holes", equa ion=dUSRHdp)
The i s model speci ied, USRH, is he ecombina ion model i sel . The de i a i es wi h espec o
elec ons and holes a e USRH:Elec ons and USRH:Holes, espec i ely. In his pa icula example
Elec ons and Holes ha e al eady been de ined as solu ion a iables. The emaining a iables in
he equa ion ha e al eady been speci ied as pa ame e s.
The di unc ion ells he equa ion pa se o ake he de i a i e o he o iginal exp ession, wi h
espec o he a iable speci ied as he second a gumen . Du ing equa ion assembly, hese de i a-
i es a e equi ed in o de o con e ge upon a solu ion. The simpli y unc ion ells he exp ession
pa se o a emp o simpli y he exp ession as much as possible.
5.2. Bulk models 23
DEVSIM Manual, Release 2.10.0
Table 5.1: Node models de ined on each egion o a de ice
Node Model Desc ip ion
A Con ac Node E alua es o 1 i node is a con ac node, o he wise 0
NodeVolume The olume o he node. Used o olume in eg a ion o node
models on nodes in mesh
NSu aceNo mal_x The su ace no mal o poin s on he in e ace (2D and 3D)
NSu aceNo mal_y The su ace no mal o poin s on he in e ace (2D and 3D)
NSu aceNo mal_z The su ace no mal o poin s on he in e ace (3D)
Su aceA ea The su ace a ea o a node on in e ace nodes, o he wise 0
Con ac Su aceA ea The su ace a ea o a node on con ac nodes, o he wise 0
Con ac NSu aceNo mal_x The su ace no mal o poin s on he con ac (2D and 3D)
Con ac NSu aceNo mal_y The su ace no mal o poin s on he con ac (2D and 3D)
Con ac NSu aceNo mal_z The su ace no mal o poin s on he con ac (3D)
coo dina e_index Coo dina e index o he node on he de ice
node_index Index o he node in he egion
xx posi ion o he node
yy posi ion o he node
zz posi ion o he node
5.2.2 Edge models
Edge models may be speci ied in e ms o o he edge models, ma hema ical unc ions, and pa-
ame e s on he de ice. In addi ion, edge models may e e ence node models de ined on he ends
o he edge. As depic ed in Edge model cons uc s in 2D (page 21), edge models a e wi h espec
o he wo nodes on he edge, n0 and n1.
Fo example, o calcula e he elec ic ield on he edges in he egion, he ollowing scheme is
employed:
de sim.edge_model(de ice="de ice", egion=" egion", name="Elec icField",
equa ion="(Po en ial@n0 - Po en ial@n1)*EdgeIn e seLeng h")
de sim.edge_model(de ice="de ice", egion=" egion",
name="Elec icField:Po en ial@n0", equa ion="EdgeIn e seLeng h")
de sim.edge_model(de ice="de ice", egion=" egion",
name="Elec icField:Po en ial@n1", equa ion="-EdgeIn e seLeng h")
In his example, EdgeIn e seLeng h is a buil -in model o he in e se leng h be ween nodes on
an edge. Po en ial@n0 and Po en ial@n1 is he Po en ial node solu ion on he nodes a he
end o he edge. These edge quan i ies a e c ea ed using he de sim.edge_ om_node_model()
(page 102). In addi ion, he de sim.edge_a e age_model() (page 102) can be used o c ea e
edge models in e ms o node model quan i ies.
Edge models au oma ically c ea ed o a egion a e lis ed in Edge models de ined on each egion
o a de ice (page 25).
5.2. Bulk models 24
DEVSIM Manual, Release 2.10.0
Table 5.2: Edge models de ined on each egion o a de ice
Edge Model Desc ip ion
EdgeCouple The leng h o he pe pendicula bisec o o an elemen edge.
Used o pe o m su ace in eg a ion o edge models on edges
in mesh.
EdgeNodeVolume The olume o each node on an edge. Used o pe o m olume
in eg a ion o edge models on edges in mesh.
EdgeIn e seLeng h In e se o he EdgeLeng h.
EdgeLeng h The dis ance be ween he wo nodes o an edge
edge_index Index o he edge on he egion
uni x x componen o he uni ec o along an edge
uni y y componen o he uni ec o along an edge (2D and 3D)
uni z z componen o he uni ec o along an edge (3D only)
5.2.3 Elemen edge models
Elemen edge models a e used when he edge quan i i es canno be speci ied en i ely in e ms
o he quan i ies on bo h nodes o he edge, such as when he ca ie mobili y is dependen on
he no mal elec ic ield. In 2D, elemen edge models a e e alua ed on each iangle edge. As
depic ed in Elemen edge model cons uc s in 2D (page 22), edge models a e wi h espec o he
h ee nodes on each iangle edge and a e deno ed as en0,en1, and en2. De i a i es a e wi h
espec o each node on he iangle.
In 3D, elemen edge models a e e alua ed on each e ahed on edge. De i a i es a e wi h espec
o he nodes on bo h iangles on he e ahed on edge. Elemen edge models au oma ically c e-
a ed o a egion a e lis ed in Elemen edge models de ined on each egion o a de ice (page 25).
As an al e na i e o ea ing in eg a ing he elemen edge model wi h espec o
Elemen EdgeCouple, he in eg a ion may be pe o med wi h espec o Elemen NodeVolume. See
de sim.equa ion() (page 87) o mo e in o ma ion.
Table 5.3: Elemen edge models de ined on each egion o
a de ice
Elemen Edge Model Desc ip ion
Elemen EdgeCouple The leng h o he pe pendicula bisec o o an edge. Used o
pe o m su ace in eg a ion o elemen edge model on elemen
edge in he mesh.
Elemen NodeVolume The node olume a ei he end o each elemen edge.
5.2. Bulk models 25
DEVSIM Manual, Release 2.10.0
5.2.4 Model de i a i es
To con e ge upon he solu ion, de i a i es a e equi ed wi h espec o each o he solu ion a i-
ables in he sys em. DEVSIM will look o he equi ed de i a i es. Fo a model model, he de i a-
i es wi h espec o solu ion a iable a iable a e p esen ed in Requi ed de i a i es o equa ion
assembly. model is he name o he model being e alua ed, and a iable is one o he solu ion
a iables being sol ed a each node (page 26).
Table 5.4: Requi ed de i a i es o equa ion assembly.
model is he name o he model being e alua ed, and
a iable is one o he solu ion a iables being sol ed a
each node
Model Type De i a i es Requi ed
Node Model model: a iable
Edge Model model: a iable@n0,model: a iable@n1
Elemen Edge Model model: a iable@en0,model: a iable@en1,
model: a iable@en2,model: a iable@en3 (3D)
5.2.5 Con e sions be ween model ypes
The de sim.edge_ om_node_model() (page 102) is used o c ea e edge models e e ing o he
nodes connec ing he edge. Fo example, he edge models Po en ial@n0 and Po en ial@n1 e e
o he Po en ial node model on each end o he edge.
The de sim.edge_a e age_model() (page 102) c ea es an edge model which is ei he he a i h-
me ic mean, geome ic mean, g adien , o nega i e o he g adien o he node model on each
edge.
When an edge model is e e ed o in an elemen edge model exp ession, he edge alues a e
implici y con e ed in o elemen edge alues du ing exp ession e alua ion. In addi ion, de i a i es
o he edge model wi h espec o he nodes o an elemen edge a e equi ed, hey a e con e ed as
well. Fo example, edgemodel: a iable@n0 and edgemodel: a iable@n1 a e implici ly con e ed
o edgemodel: a iable@en0 and edgemodel: a iable@en1, espec i ely.
The de sim.elemen _ om_edge_model() (page 104) is used o c ea e di ec ional componen s o
an edge model o e an en i e elemen . The de i a i e op ion is used wi h his command o c ea e
he de i a i es wi h espec o a speci ic node model. The de sim.elemen _ om_node_model()
(page 105) is used o c ea e elemen edge models e e ing o each node on he elemen o he
elemen edge.
5.2. Bulk models 26
DEVSIM Manual, Release 2.10.0
5.2.6 Equa ion assembly
Bulk equa ions a e speci ied in e ms o he node, edge, and elemen edge models using he
de sim.equa ion() (page 87). Node models a e in eg a ed wi h espec o he node olume.
Edge models a e in eg a ed wi h he pe pendicula bisec o s along he edge on o he nodes on
ei he end.
Elemen edge models a e ea ed as lux e ms and a e in eg a ed wi h espec o
Elemen EdgeCouple using he elemen _model op ion. Al e na i ely, hey may be ea ed as sou ce
e ms and a e in eg a ed wi h espec o Elemen NodeVolume using he olume_node0_model and
olume_node1_model op ion.
In his example, we a e speci ying he Po en ial Equa ion in he egion o consis o a lux e m
named Po en ialEdgeFlux and o no ha e any node olume e ms.
de sim.equa ion(de ice="de ice", egion=" egion", name="Po en ialEqua ion",
a iable_name="Po en ial", edge_model="Po en ialEdgeFlux",
a iable_upda e="log_damp" )
In addi ion, he solu ion a iable coupled wi h his equa ion is Po en ial and i will be upda ed
using loga i hmic damping.
Table 5.5: Requi ed de i a i es o in e ace equa ion as-
sembly. The node model name nodemodel and i s de i a-
i es nodemodel: a iable a e su ixed wi h @ 0 and @ 1 o
deno e which egion on he in e ace is being e e ed o
Model Type Model Name De i a i es Requi ed
Node Model ( egion 0) nodemodel@ 0 nodemodel: a iable@ 0
Node Model ( egion 1) nodemodel@ 1 nodemodel: a iable@ 1
In e ace Node Model inodemodel inodemodel: a iable@ 0,
inodemodel: a iable@ 1
5.3 In e ace
5.3.1 In e ace models
In e ace cons uc s in 2D. In e ace node pai s a e loca ed a each bulle . The Su aceA ea model
is used o in eg a e lux e m models. (page 28) depic s an in e ace in DEVSIM. I is a collec ion o
o e lapping nodes exis ing in wo egions, 0 and 1.
In e ace models a e node models speci ic o he in e ace being conside ed. They a e unique om
bulk node models, in he sense ha hey may e e o node models on bo h sides o he in e ace.
They a e speci ied using he de sim.in e ace_model() (page 109). In e ace models may e e
o node models o pa ame e s on ei he side o he in e ace using he syn ax nodemodel@ 0 and
nodemodel@ 1 o e e o he node model in he i s and second egions o he in e ace. The
naming con en ion o node models, in e ace node models, and hei de i a i es a e shown in
5.3. In e ace 27
DEVSIM Manual, Release 2.10.0
1
0
Su aceA ea
Fig. 5.4: In e ace cons uc s in 2D. In e ace node pai s a e loca ed a each •. The Su aceA ea
model is used o in eg a e lux e m models.
5.3. In e ace 28
DEVSIM Manual, Release 2.10.0
Requi ed de i a i es o in e ace equa ion assembly. The node model name nodemodel and i s
de i a i es nodemodel: a iable a e su ixed wi h @ 0 and @ 1 o deno e which egion on he
in e ace is being e e ed o (page 27).
de sim.in e ace_model(de ice="de ice", in e ace="in e ace",
name="con inuousPo en ial", equa ion="Po en ial@ 0-Po en ial@ 1")
5.3.2 In e ace model de i a i es
Fo a gi en in e ace model, model, he de i a i es wi h espec o he a iable a iable in he
egions a e
•model: a iable@ 0
•model: a iable@ 1
de sim.in e ace_model(de ice="de ice", in e ace="in e ace",
name="con inuousPo en ial:Po en ial@ 0", equa ion="1")
de sim.in e ace_model(de ice="de ice", in e ace="in e ace",
name="con inuousPo en ial:Po en ial@ 1", equa ion="-1")
5.3.3 In e ace equa ion assembly
The e a e h ee ypes o in e ace equa ions conside ed in DEVSIM. They a e bo h ac i a ed using
he de sim.in e ace_equa ion() (page 90).
In he i s o m, con inuous, he equa ions o he nodes on bo h sides o he in e ace a e in e-
g a ed wi h espec o hei olumes and added in o he same equa ion. An addi ional equa ion
is hen speci ied o ela e he a iables on bo h sides. In his example, con inui y in he po en ial
solu ion ac oss he in e ace is en o ced, using he con inuousPo en ial model de ined in he
p e ious sec ion.
de sim.in e ace_equa ion(de ice="de ice", in e ace="in e ace", name=
,→"Po en ialEqua ion",
in e ace_model="con inuousPo en ial", ype="con inuous")
In he second o m, lux e m, a lux e m is in eg a ed o e he su ace a ea o he in e ace and
added o he i s egion, and sub ac ed om he second.
In he hi d o m, hyb id, equa ions o nodes on bo h sides o he in e ace a e added in o he
equa ion o he node in he i s egion. The equa ion o he node on he second in e ace is
in eg a ed in he second egion, and he lux e m is sub ac ed in he second egion.
5.3. In e ace 29
DEVSIM Manual, Release 2.10.0
5.4 Con ac
ci cui _node
Fig. 5.5: Con ac cons uc s in 2D.
5.4.1 Con ac models
Con ac cons uc s in 2D. (page 30) depic s how a con ac is ea ed in a simula ion. I is a collec-
ion o nodes on a egion. Du ing assembly, he speci ied models o m an equa ion, which eplaces
he equa ion applied o hese nodes o a bulk node.
Con ac models a e equi alen o node and edge models, and a e speci ied using he de sim.
con ac _node_model() (page 99) and he de sim.con ac _edge_model() (page 99), espec-
i ely. The key di e ence is ha he models a e only e alua ed on he con ac nodes o he
con ac speci ied.
5.4.2 Con ac model de i a i es
The de i a i es a e equi alen o he discussion in Model de i a i es (page 26). I ex e nal ci cui
bounda y condi ions a e being used, he model model de i a i e wi h espec o he ci cui node
node name should be speci ied as model:node.
5.4. Con ac 30
DEVSIM Manual, Release 2.10.0
5.4.3 Con ac equa ion assembly
The de sim.con ac _equa ion() (page 86) is used o speci y he bounda y condi ions on he
con ac nodes. The models speci ied eplace he models speci ied o bulk equa ions o he same
name. Fo example, he node model speci ied o he con ac equa ion is assembled on he con ac
nodes, ins ead o he node model speci ied o he bulk equa ion. Con ac equa ion models no
speci ied a e no assembled, e en i he model exis s on he bulk equa ion o he egion a ached
o he con ac .
As an example
de sim.con ac _equa ion(de ice="de ice", con ac ="con ac ", name="Po en ialEqua ion
,→",
node_model="con ac _bc", edge_cha ge_model="DField")
Cu en models e e o he ins an aneous cu en lowing in o he de ice. Cha ge models e e o
he ins an aneous cha ge a he con ac .
Du ing a ansien , small-signal o ac simula ion, he ime de i a i e is aken so ha he ne cu en
in o a ci cui node is
I( ) = i( )+ ∂q( )
∂
whe e iis he in eg a ed cu en and qis he in eg a ed cha ge.
5.5 Cus om ma ix assembly
The de sim.cus om_equa ion() (page 87) command is used o egis e callbacks o be called
du ing ma ix and igh hand side assembly. The Py hon p ocedu e should expec o ecei e wo
a gumen s and e u n wo lis s and a boolean alue. Fo example a p ocedu e named myassemble
egis e ed wi h
de sim.cus om_equa ion(name=" es 1", p ocedu e="myassemble")
expec s wo a gumen s
de myassemble(wha , imemode):
.
.
.
e u n c , , T ue
whe e wha may be passed as one o
MATRIXONLY
RHS
MATRIXANDRHS
and imemode may be passed as one o
5.5. Cus om ma ix assembly 31
DEVSIM Manual, Release 2.10.0
DC
TIME
When imemode is DC, he ime-independen pa o he equa ion is e u ned. When imemode
is TIME, he ime-de i a i e pa o he equa ion is e u ned. The simula o will scale he ime-
de i a i e e ms wi h he p ope equency o ime scale.
The e u n alue om he p ocedu e mus e u n wo lis s and a boolean alue o he o m
[1 1 1.0 2 2 1.0 1 2 -1.0 2 1 -1.0 2 2 1.0], [1 1.0 2 1.0 2 -1.0], T ue
whe e he leng h o he i s lis is di isible by 3 and con ains he ow, column, and alue o be
assembled in o he ma ix. The second lis is di isible by 2 and con ains he igh hand side
en ies. Ei he lis may be emp y.
The boolean alue deno es whe he he ma ix and igh hand side en ies should be ow pe mu-
a ed. A alue o T ue should be used o assembling bulk equa ions, and a alue o False should
be used o assembling con ac and in e ace bounda y condi ions.
The de sim.ge _ci cui _equa ion_numbe () (page 85) may be used o ge he equa ion num-
be s co esponding o ci cui node names. The de sim.ge _equa ion_numbe s() (page 89) may
be used o ind he equa ion numbe co esponding o each node index in a egion.
The ma ix and igh hand side en ies should be scaled by he NodeVolume i hey a e assembled
in o loca ions in a de ice egion as olume in eg a ion.
5.6 Cylind ical coo dina e sys ems
In 2D, models ep esen ing he edge couples, su ace a eas and node olumes may be gene a ed
using he ollowing commands:
•de sim.cylind ical_edge_couple() (page 99)
•de sim.cylind ical_node_ olume() (page 100)
•de sim.cylind ical_su ace_a ea() (page 100)
In o de o change he in eg a ion om he de aul models o cylind ical models, he ollowing
pa ame e s may be se
se _pa ame e (name="node_ olume_model",
alue="Cylind icalNodeVolume")
se _pa ame e (name="edge_couple_model",
alue="Cylind icalEdgeCouple")
se _pa ame e (name="edge_node0_ olume_model",
alue="Cylind icalEdgeNodeVolume@n0")
se _pa ame e (name="edge_node1_ olume_model",
alue="Cylind icalEdgeNodeVolume@n1")
se _pa ame e (name="elemen _edge_couple_model",
alue="Elemen Cylind icalEdgeCouple")
se _pa ame e (name="elemen _node0_ olume_model",
(con inues on nex page)
5.6. Cylind ical coo dina e sys ems 32
DEVSIM Manual, Release 2.10.0
The ci cui node names may be used in any model exp ession on he egions and in e aces.
Howe e , he simula o will only ake de i a i es wi h espec o ci cui nodes names on models
used o compose he con ac equa ion.
7.4 Clea ing ci cui
The de sim.dele e_ci cui () (page 85) command may be used o emo e he ci cui com-
ple ely.
7.4. Clea ing ci cui 39
Chap e 8
Meshing
8.1 1D meshe
DEVSIM has an in e nal 1D meshe and he p ope sequence o commands ollow in his example.
de sim.c ea e_1d_mesh(mesh="cap")
de sim.add_1d_mesh_line(mesh="cap", pos=0, ps=0.1, ag=" op")
de sim.add_1d_mesh_line(mesh="cap", pos=0.5, ps=0.1, ag="mid")
de sim.add_1d_mesh_line(mesh="cap", pos=1, ps=0.1, ag="bo ")
de sim.add_1d_con ac (mesh="cap", name=" op", ag=" op", ma e ial="me al")
de sim.add_1d_con ac (mesh="cap", name="bo ", ag="bo ", ma e ial="me al")
de sim.add_1d_in e ace(mesh="cap", name="MySiOx", ag="mid")
de sim.add_1d_ egion(mesh="cap", ma e ial="Si", egion="MySiRegion",
ag1=" op", ag2="mid")
de sim.add_1d_ egion(mesh="cap", ma e ial="Ox", egion="MyOxRegion",
ag1="mid", ag2="bo ")
de sim. inalize_mesh(mesh="cap")
de sim.c ea e_de ice(mesh="cap", de ice="de ice")
The de sim.c ea e_1d_mesh() (page 96) is i s used o ini ialize he speci ica ion o a new mesh
by he name speci ied wi h he command op ion. The de sim.add_1d_mesh_line() (page 93) is
used o speci y he end poin s o he 1D s uc u e, as well as he loca ion o poin s whe e he
spacing changes. The command is used o c ea e e e ence labels used o speci ying he con ac s,
in e aces and egions.
The de sim.add_1d_con ac () (page 93), de sim.add_1d_in e ace() (page 93) and de sim.
add_1d_ egion() (page 93) a e used o speci y he con ac s, in e aces and egions o he de ice.
Once he meshing commands ha e been comple ed, he de sim. inalize_mesh() (page 98) is
called o c ea e a mesh s uc u e and hen de sim.c ea e_de ice() (page 96) is used o c ea e
a de ice using he mesh.
40
DEVSIM Manual, Release 2.10.0
8.2 2D meshe
Simila o he 1D meshe , he 2D meshe uses a sequence o non- e mina ing mesh lines a e
speci ied in bo h he x and y di ec ions o speci y a mesh s uc u e. As opposed o using ags, he
egions a e speci ied using de sim.add_2d_ egion() (page 95) as box coo dina es on he mesh
coo dina es. The con ac s and in e aces a e speci ied using boxes, howe e i is bes o ensu e
he he in e aces and con ac s encompass only one line o poin s.
de sim.c ea e_2d_mesh(mesh="cap")
de sim.add_2d_mesh_line(mesh="cap",di ="y", pos=-0.001, ps=0.001)
de sim.add_2d_mesh_line(mesh="cap",di ="x", pos=xmin, ps=0.1)
de sim.add_2d_mesh_line(mesh="cap",di ="x", pos=xmax, ps=0.1)
de sim.add_2d_mesh_line(mesh="cap",di ="y", pos=ymin, ps=0.1)
de sim.add_2d_mesh_line(mesh="cap",di ="y", pos=ymax, ps=0.1)
de sim.add_2d_mesh_line(mesh="cap",di ="y", pos=+1.001, ps=0.001)
de sim.add_2d_ egion(mesh="cap", ma e ial="gas", egion="gas1", yl=-.001, yh=0.0)
de sim.add_2d_ egion(mesh="cap", ma e ial="gas", egion="gas2", yl=1.0, yh=1.001)
de sim.add_2d_ egion(mesh="cap", ma e ial="Oxide", egion=" 0", xl=xmin, xh=xmax,
yl=ymid1, yh=ymin)
de sim.add_2d_ egion(mesh="cap", ma e ial="Silicon", egion=" 1", xl=xmin, xh=xmax,
yl=ymid2, yh=ymid1)
de sim.add_2d_ egion(mesh="cap", ma e ial="Silicon", egion=" 2", xl=xmin, xh=xmax,
yl=ymid2, yh=ymax)
de sim.add_2d_in e ace(mesh="cap", name="i0", egion0=" 0", egion1=" 1")
de sim.add_2d_in e ace(mesh="cap", name="i1", egion0=" 1", egion1=" 2",
xl=0, xh=1, yl=ymid2, yh=ymid2, bloa =1.0e-10)
de sim.add_2d_con ac (mesh="cap", name=" op", egion=" 0", yl=ymin, yh=ymin,
bloa =1.0e-10, ma e ial="me al")
de sim.add_2d_con ac (mesh="cap", name="bo ", egion=" 2", yl=ymax, yh=ymax,
bloa =1.0e-10, ma e ial="me al")
de sim. inalize_mesh(mesh="cap")
de sim.c ea e_de ice(mesh="cap", de ice="de ice")
In he cu en implemen a ion o he so wa e, i is necessa y o c ea e a egion on bo h sides o
he con ac in o de o c ea e a con ac using de sim.add_2d_con ac () (page 94) o an in e ace
using de sim.add_2d_in e ace() (page 94).
Once he meshing commands ha e been comple ed, he de sim. inalize_mesh() (page 98) is
called o c ea e a mesh s uc u e and hen de sim.c ea e_de ice() (page 96) is used o c ea e
a de ice using he mesh.
8.2. 2D meshe 41
DEVSIM Manual, Release 2.10.0
8.3 Using an ex e nal meshe
8.3.1 Gmsh
The Gmsh meshing so wa e (see Gmsh (page 12)) can be used o c ea e a 1D, 2D, o 3D mesh
sui able o use in DEVSIM.DEVSIM suppo s eading e sion 2.2 meshes om Gmsh. In o de o
w i e his o ma , i is necessa y o speci y he mesh o ma when w i ing ou a mesh ile. F om he
gmsh command line, use he - o ma msh2 op ion.
When c ea ing he mesh ile using he so wa e, use physical g oup names o map he di e ence
en i ies in he esul ing mesh ile o a g oup name.
In his example, a MOS s uc u e is ead in:
de sim.c ea e_gmsh_mesh( ile="gmsh_mos2d.msh", mesh="mos2d")
de sim.add_gmsh_ egion(mesh="mos2d" gmsh_name="bulk", egion="bulk",
ma e ial="Silicon")
de sim.add_gmsh_ egion(mesh="mos2d" gmsh_name="oxide", egion="oxide",
ma e ial="Silicon")
de sim.add_gmsh_ egion(mesh="mos2d" gmsh_name="ga e", egion="ga e",
ma e ial="Silicon")
de sim.add_gmsh_con ac (mesh="mos2d" gmsh_name="d ain_con ac ", egion="bulk",
name="d ain", ma e ial="me al")
de sim.add_gmsh_con ac (mesh="mos2d" gmsh_name="sou ce_con ac ", egion="bulk",
name="sou ce", ma e ial="me al")
de sim.add_gmsh_con ac (mesh="mos2d" gmsh_name="body_con ac ", egion="bulk",
name="body", ma e ial="me al")
de sim.add_gmsh_con ac (mesh="mos2d" gmsh_name="ga e_con ac ", egion="ga e",
name="ga e", ma e ial="me al")
de sim.add_gmsh_in e ace(mesh="mos2d" gmsh_name="ga e_oxide_in e ace",
egion0="ga e", egion1="oxide", name="ga e_oxide")
de sim.add_gmsh_in e ace(mesh="mos2d" gmsh_name="bulk_oxide_in e ace",
egion0="bulk", egion1="oxide", name="bulk_oxide")
de sim. inalize_mesh(mesh="mos2d")
de sim.c ea e_de ice(mesh="mos2d", de ice="mos2d")
Once he meshing commands ha e been comple ed, he de sim. inalize_mesh() (page 98) is
called o c ea e a mesh s uc u e and hen de sim.c ea e_de ice() (page 96) is used o c ea e
a de ice using he mesh.
8.3. Using an ex e nal meshe 42
DEVSIM Manual, Release 2.10.0
8.3.2 Cus om mesh loading using sc ip ing
I is also possible o a bi a ily load a mesh om a Py hon using he de sim.c ea e_gmsh_mesh()
(page 97). This is explained in he No es sec ion o he command. In addi ion, please see he
es ing/py honmesh1d sc ip o a simple demons a ion sc ip . These meshes may only con-
ain poin s, lines, iangles, and e ahed a. Hyb id meshes o uni o m meshes con aining o he
elemen s a e no suppo ed a his ime.
8.4 Loading and sa ing esul s
The de sim.w i e_de ices() (page 98) is used o c ea e an ASCII ile sui able o sa ing da a
o es a ing he simula ion la e . The de sim o ma encodes s uc u al in o ma ion, as well as
he commands necessa y o gene a ing he models and equa ions used in he simula ion. The
de sim_da a o ma is used o s o ing nume ical in o ma ion o use in o he p og ams o analysis.
The de sim.load_de ices() (page 98) is hen used o eload he de ice da a o es a ing he
simula ion.
8.5 Mesh p ocessing
See Examples (page 63) o examples in ol ing mesh p ocessing.
8.6 No es
8.6.1 Con ac s
Con ac ma e ial
Con ac s equi es a ma e ial se ing (e.g. me al). This is o in o ma ional pu poses. Con ac
models s ill look up pa ame e alues based on he egion hey a e loca ed.
C ea e con ac s om in e ace
The de sim.c ea e_con ac _ om_in e ace() (page 96) may be used o c ea e a con ac a
he loca ion o an in e ace. This is use ul when con ac bounda y condi ions a e needed o a
egion connec ed o he in e ace.
8.4. Loading and sa ing esul s 43
DEVSIM Manual, Release 2.10.0
8.6.2 De ice and mesh dele ion commands
The de sim.dele e_de ice() (page 98) command makes i possible o dele e de ices so hey
will no longe be sol ed in he simula ion. Any pa ame e s se on he de ice a e also emo ed
om he sys em.
The de sim.dele e_mesh() (page 98) command makes i possible o dele e meshes. Once a
mesh has been dele ed, i is no longe possible o c ea e de ices om i using he de sim.
c ea e_de ice() (page 96) command.
8.6.3 Pe iodic bounda y condi ions
The de sim.c ea e_in e ace_ om_nodes() (page 97) command makes i possible o c ea e
an in e ace wi h non coinciden nodes. This enables he use o pe iodic bounda y condi ions.
8.6. No es 44
Chap e 9
Sol e and nume ics
9.1 O e iew
DEVSIM o e s a ange o simula ion algo i hms.
DC The DC ope a ing poin analysis is use ul o pe o ming s eady-s a e simula ion o a di e en
bias condi ions.
AC A each DC ope a ing poin , a small-signal AC analysis may be pe o med. An AC sou ce is
p o ided h ough a ci cui and he esponse is hen simula ed. This is use ul o bo h quasi-s a ic
capaci ance simula ion, as well as RF simula ion.
Noise/Sensi i i y Noise analysis may be used o e alua e how in e nal noise sou ces a e ob-
se ed in he e minal cu en s o he de ice o ci cui . Using his me hod, i is also possible o
simula e how he de ice esponse changes when de ice pa ame e s a e changed.
T ansien DEVSIM is able o simula e he nonlinea ansien beha io o de ices, when he bias
condi ions change wi h ime.
9.2 Solu ion me hods
DEVSIM uses New on me hods o sol e he sys em o PDE’s. All o he analyses a e pe o med
using he de sim.sol e() (page 114).
9.2.1 DC analysis
A DC analysis is pe o med using he de sim.sol e() (page 114).
sol e( ype="dc", absolu e_e o =1.0e10, ela i e_e o =1e-7 maximum_i e a ions=30)
45
DEVSIM Manual, Release 2.10.0
9.2.2 AC analysis
An AC analysis is pe o med using he de sim.sol e() (page 114). A ci cui ol age sou ce is
equi ed o se he AC sou ce.
9.2.3 Noise and sensi i i y analysis
An noise analysis is pe o med using he de sim.sol e() (page 114) command. A ci cui node
is speci ied in o de o ind i s sensi i i y o changes in he bulk quan i ies o each de ice. I he
ci cui node is named V1.I. A noise simula ion is pe o med using:
sol e( ype="noise", equency=1e5, ou pu _node="V1.I")
Noise and sensi i i y analysis is pe o med using he de sim.sol e() (page 114). I he equa ion
begin sol ed is Po en ialEqua ion, he names o he scala impedance ield is hen:
•V1.I_Po en ialEqua ion_ eal
•V1.I_Po en ialEqua ion_imag
and he ec o impedance ields e alua ed on he nodes a e
•V1.I_Po en ialEqua ion_ eal_g adx
•V1.I_Po en ialEqua ion_imag_g adx
•V1.I_Po en ialEqua ion_ eal_g ady (2D and 3D)
•V1.I_Po en ialEqua ion_imag_g ady (2D and 3D)
•V1.I_Po en ialEqua ion_ eal_g adz (3D only)
•V1.I_Po en ialEqua ion_imag_g adz (3D only)
9.2.4 T ansien analysis
T ansien analysis is pe o med using he de sim.sol e() (page 114). DEVSIM suppo s ime-
in eg a ion o he de ice PDE’s. The h ee me hods a e suppo ed a e:
• BDF1
• TRBDF
• BDF2
9.2. Solu ion me hods 46
DEVSIM Manual, Release 2.10.0
9.3 Ex ended p ecision
9.3.1 Pla o m dependence
Ex ended p ecision is a ailable on all bina ies. Fo Linux x86_64, his uses he 128-bi
p ecision a ailable wi h he GCC compile s. On o he pla o ms, x64,a m64,aa ch64, he
cpp_bin_ loa _quad ype is used om he boos lib a ies, and is simila o 128-bi p ecision.
9.3.2 How o con ol
The ollowing new pa ame e s a e a ailable:
•ex ended_sol e , ex ended p ecision ma ix o New on and linea sol e
•ex ended_model, ex ended p ecision model e alua ion
•ex ended_equa ion, ex ended p ecision equa ion assembly
De aul geome ic models, a e also calcula ed wi h ex ended p ecision.
de sim.se _pa ame e (name ="ex ended_sol e ", alue=T ue)
de sim.se _pa ame e (name ="ex ended_model", alue=T ue)
de sim.se _pa ame e (name ="ex ended_equa ion", alue=T ue)
9.3.3 Kahan summa ion in ex ended p ecision mode
The kahan3 and kahan4 unc ions use he Kahan summa ion algo i hm o ex ended p ecision
model e alua ion. Wi h his change, be e han 128-bi loa ing p ecision is a ailable when ex-
ended p ecision is enabled.
de sim.se _pa ame e (name = "ex ended_model", alue=T ue)
The es ing/kahan_ loa 128.py sc ip demons a es his.
9.4 Floa ing poin excep ions
9.4.1 FPE checking du ing ex e nal sol e
On a m64 and aa ch64 pla o ms, he so wa e does no check o loa ing poin excep ions (FPEs)
du ing usage o he di ec sol e . Du ing es ing, i was disco e ed ha FPEs we e occu ing du ing
ac o iza ion o bo h he Supe LU and he UMFPACK 5.1. Remo ing his check allows mo e o he
es s o un h ough o comple ion.
9.3. Ex ended p ecision 47
DEVSIM Manual, Release 2.10.0
9.4.2 Addi ional In o ma ion
Please see Floa ing poin excep ions (page 16).
9.5 Sol e and ma h lib a y selec ion
9.5.1 A ailable lib a ies
In el Ma h Ke nel Lib a y
A speci ic e sion is no equi ed when loading he In el Ma h Ke nel Lib a y. This me hod is
he de aul o x64 and x86_64 sys ems. Ins uc ions o ins alling in a Py hon i ual en i onmen
a e gi en in C ea e i ual en i onmen (page 10).
UMFPACK 5.1 sol e
The UMFPACK 5.1 sol e is now a ailable as a sha ed lib a y dis ibu ed wi h he so wa e. I is
licensed unde he e ms o he LGPL 2.1 and ou e sion is hos ed he e:
h ps://gi hub.com/de sim/um pack_lgpl
Please no e ha his e sion uses a scheme o de ec he BLAS/LAPACK lib a ies being used by
DEVSIM, as desc ibed in BLAS/LAPACK lib a y selec ion (page 49).
In o de o use his lib a y, a shim sc ip is p o ided o load UMFPACK 5.1 and se i as he sol e .
Please see his example:
py hon -mde sim.um pack.um shim ssac_cap.py
Cus om sol e
Please see Cus om di ec sol e (page 50) o mo e in o ma ion.
Supe LU
Supe LU is no longe a ailable as a sol e in he bina y dis ibu ions o DEVSIM. I is a ailable o
cus om applica ions, which would equi e a cus om build o he so wa e.
9.5. Sol e and ma h lib a y selec ion 48
DEVSIM Manual, Release 2.10.0
I is impo an o no e since alues a e based on double p ecision a i hme ic, es ing o
equali y wi h alues o he han 0.0 may yield unexpec ed esul s.
10.2.3 Func ions
Table 10.2: P ede ined unc ions
Func ion Desc ip ion
acosh(exp1) In e se Hype bolic Cosine
asinh(exp1) In e se Hype bolic Sine
a anh(exp1) In e se Hype bolic Tangen
cosh(exp1) Hype bolic Cosine
sinh(exp1) Hype bolic Sine
anh(exp1) Hype bolic Tangen
B(exp1) Be noulli Func ion
dBdx(exp1) de i a i e o Be noulli unc ion
do 2d(exp1x, exp1y, exp2x,
exp2y)
exp1x*exp2x+exp1y*exp2y
exp(exp1) exponen
i else( es , exp1, exp2) i es is ue, hen e alua e exp1, o he wise exp2
i ( es , exp) i es is ue, hen e alua e exp, o he wise 0
log(exp1) na u al log
max(exp1, exp2) maximum o he wo a gumen s
min(exp1, exp2) minimum o he wo a gumen s
pow(exp1, exp2) ake exp1 o he powe o exp2
sgn(exp1) sign unc ion
s ep(exp1) uni s ep unc ion
kahan3(exp1, exp2, exp3) Ex ended p ecision addi ion o a gumen s
kahan4(exp1, exp2, exp3, exp4) Ex ended p ecision addi ion o a gumen s
ec_max maximum o all he alues o e he en i e egion o in e -
ace
ec_min minimum o all he alues o e he en i e egion o in e -
ace
ec_sum sum o all he alues o e he en i e egion o in e ace
10.2. Syn ax 55
DEVSIM Manual, Release 2.10.0
Table 10.3: E o unc ions
Func ion Desc ip ion
e c(exp1) complemen a y e o unc ion
de cdx(exp1) de i a i e o complemen a y e o unc ion
e c_in (exp1) in e se complemen a y e o unc ion
de c_in dx(exp1) de i a i e o in e se complemen a y e o unc ion
e (exp1) e o unc ion
de dx(exp1) de i a i e e o unc ion
e _in (exp1) in e se e o unc ion
de _in dx(exp1) de i a i e o in e se e o unc ion
Table 10.4: Fe mi In eg al unc ions
Func ion Desc ip ion
Fe mi(exp1) Fe mi In eg al
dFe midx(exp1) de i a i e o Fe mi In eg al
In Fe mi(exp1) in e se o he Fe mi In eg al
dIn Fe midx(exp1) de i a i e o In Fe mi In eg al
Table 10.5: Gauss-Fe mi In eg al unc ions
g i(exp1, exp2) Gauss-Fe mi In eg al
dg idx(exp1, exp2) De i a i e o Gauss-Fe mi In eg al wi h espec o i s
a gumen
ig i(exp1, exp2) In e se Gauss-Fe mi In eg al
dig idx(exp1, exp2) De i a i e o In e se Gauss-Fe mi In eg al wi h espec
o i s a gumen
In P ede ined unc ions (page 55) a e he buil in unc ions o SYMDIFF. No e ha he pow unc ion
uses he ,ope a o o sepa a e a gumen s. In addi ion an exp ession like pow(a,b+y) is equi alen
o an exp ession like a^(b+y). Bo h exp and log a e p o ided since many de i a i e exp essions
can be exp essed in e ms o hese wo unc ions. I is possible o nes exp essions wi hin unc-
ions and ice- e sa. E o unc ions (page 56) lis s he e o unc ions, de i a i es, and in e ses.
Fe mi In eg al unc ions (page 56) lis s he Fe mi unc ions, and a e based on he Joyce-Dixon Ap-
p oxima ion [3]. The Gauss-Fe mi unc ions a e lis ed in Gauss-Fe mi In eg al unc ions (page 56),
based on [6].
10.2. Syn ax 56
DEVSIM Manual, Release 2.10.0
10.2.4 Commands
Table 10.6: Commands
Command Desc ip ion
di (obj1, a ) Take de i a i e o obj1 wi h espec o a iable a
expand(obj) Expand ou all mul iplica ions in o a sum o p oduc s
help P in desc ip ion o commands
scale(obj) Ge cons an ac o
sign(obj) Ge sign as 1o -1
simpli y(obj) Simpli y as much as possible
subs (obj1,obj2,obj3) subs i u e obj3 o obj2 in o obj1
unscaled al(obj) Ge alue wi hou cons an scaling
unsigned al(obj) Ge unsigned alue
Commands a e shown in Commands (page 57). While hey appea o ha e he same o m as
unc ions, hey a e special in he sense ha hey manipula e exp essions and a e ne e p esen in
he exp ession which esul s. Fo example, no e he esul o he ollowing command
>di (a*b, b)
a
10.2.5 Use unc ions
Table 10.7: Commands o use unc ions
Command Desc ip ion
clea (name) Clea s he name o a use unc ion
decla e(name(a g1, a g2,
...))
decla e unc ion name aking dummy a gumen s a g1,a g2,
. . . . De i a i es assumed o be 0
de ine(name(a g1, a g2,
...), obj1, obj2, ...)
decla e unc ion name aking a gumen s a g1,a g2, . . . ha -
ing co esponding de i a i es obj1,obj2, . . .
Commands o speci ying and manipula ing use unc ions a e lis ed in Commands o use unc-
ions (page 57). They a e used in o de o de ine new use unc ion, as well as he de i a i es o
he unc ions wi h espec o he use a iables. Fo example, he ollowing exp ession de ines a
unc ion named which akes one a gumen .
> de ine( (x), 0.5*x)
The lis a e he unc ion p o oype is used o de ine he de i a i es wi h espec o each o he
independen a iables. Once de ined, he unc ion may be used in any o he exp ession. In
addi ions he any exp ession can be used as an a gumen s. Fo example:
10.2. Syn ax 57
DEVSIM Manual, Release 2.10.0
> di ( (x*y),x)
((0.5 * (x * y)) * y)
> simpli y((0.5 * (x * y)) * y)
(0.5 * x * (y^2))
The chain ule is applied o ensu e ha he de i a i e is co ec . This can be exp essed as
∂
∂x (u, ,...) = ∂u
∂x·∂
∂u (u, ,...)+ ∂
∂x·∂
∂ (u, ,...)+...
The decla e command is equi ed when he de i a i es o wo use unc ions a e based on one
ano he . Fo example:
> decla e(cos(x))
cos(x)
> de ine(sin(x),cos(x))
sin(x)
> de ine(cos(x),-sin(x))
cos(x)
When decla ed, a unc ions de i a i es a e se o 0, unless speci ied wi h a de ine command. I is
now possible o use hese exp essions as desi ed.
> di (sin(cos(x)),x)
(cos(cos(x)) * (-sin(x)))
> simpli y(cos(cos(x)) * (-sin(x)))
(-cos(cos(x)) * sin(x))
10.2.6 Mac o assignmen
The use o mac o assignmen allows he subs i u ion o exp essions in o new exp essions. E e y
ime a command is success ully used, he esul ing exp ession is assigned o a special mac o
de ini ion, $_.
In his example, he esul o he each command is subs i u ed in o he nex .
> a+b
(a + b)
> $_-b
((a + b) - b)
> simpli y($_)
a
In addi ion o he de aul mac o de ini ion, i is possible o speci y a a iable iden i ie by using he
$cha ac e ollowed by an alphanume ic s ing beginning wi h a le e . In addi ion o le e s and
numbe s, a _cha ac e may be used as well. A mac o which has no p e iously assigned will
implici ly use 0as i s alue.
This example demons a es he use o mac o assignmen .
10.2. Syn ax 58
DEVSIM Manual, Release 2.10.0
> $a1 = a + b
(a + b)
> $a2 = a - b
(a - b)
> simpli y($a1+$a2)
(2 * a)
10.3 In oking SYMDIFF om DEVSIM
10.3.1 Equa ion pa se
The de sim.symdi () (page 112) should be used when de ining new unc ions o he pa se .
Since you do no speci y egions o in e aces, i conside s all s ings as being independen a i-
ables, as opposed o models. Model commands (page 99) p esen s commands which ha e he
concep s o models. A ;should be used o sepa a e each s a emen .
This is a sample in oca ion om DEVSIM
%symdi (exp ="subs (dog * ca , dog, bea )")
(bea *ca )
10.3.2 E alua ing ex e nal ma h
The de sim. egis e _ unc ion() (page 111) is used o e alua e unc ions decla ed o de ined
wi hin SYMDIFF.APy hon p ocedu e may hen be used aking he same numbe o a gumen s. Fo
example:
om ma h impo cos
om ma h impo sin
symdi (exp ="decla e(sin(x))")
symdi (exp ="de ine(cos(x), -sin(x))")
symdi (exp ="de ine(sin(x), cos(x))")
egis e _ unc ion(name="cos", na gs=1)
egis e _ unc ion(name="sin", na gs=1)
The cos and sin unc ion may hen be used o model e alua ion. Fo imp o ed e iciency, i is
possible o c ea e p ocedu es w i en in C o C++ and load hem in o Py hon.
10.3. In oking SYMDIFF om DEVSIM 59
DEVSIM Manual, Release 2.10.0
10.3.3 Models
When used wi hing he model commands discussed in Model commands (page 99), DEVSIM has
been ex ended o ecognize model names in he exp essions. In his si ua ion, he de i a i e o a
model named, model, wi h espec o ano he model, a iable, is hen model: a iable.
Du ing he elemen assembly p ocess, DEVSIM e alua es all models o an equa ion oge he . While
he exp essions in models and hei de i a i es a e independen , he so wa e uses a caching
scheme o ensu e ha edundan calcula ions a e no pe o med. I is ecommended, howe e , ha
use s de eloping hei own models in es iga e c ea ing in e media e models in o de o imp o e
hei unde s anding o he equa ions ha hey wish o be assembled.
10.3. In oking SYMDIFF om DEVSIM 60
Chap e 11
Visualiza ion and pos p ocessing
11.1 In oduc ion
DEVSIM is able o c ea e iles o isualiza ion ools. In o ma ion abou acqui ing hese ools a e
p esen ed in Ins all ex e nal so wa e ools (page 12).
11.2 Visualiza ion so wa e
11.2.1 O e iew
The ools in Table 11.1 can ead he ile Tecplo and VTK Fo ma s.
Table 11.1: Open sou ce isualiza ion ools
Pa aView isualiza ion ool a ailable a h ps://pa a iew.o g.
VisI isualiza ion ool a ailable om h ps:// isi -da .gi hub.
io/ isi -websi e/
11.2.2 Using Pa aView
The de sim.w i e_de ices() (page 98) is used o c ea e an ASCII ile sui able o use in
Pa aView. Edge quan i ies a e in e pola ed on o he node posi ions in he esul ing s uc u e.
Elemen edge quan i ies a e in e pola ed on o he cen e s o each iangle o e ahed on in he
mesh.
w i e_de ices( ile="mos_2d_dd", ype=" k")
One u ile pe de ice egion will be c ea ed, as well as a m ile which may be used o load all
o he de ice egions in o Pa aView.
61
DEVSIM Manual, Release 2.10.0
11.2.3 Using VisI
VisI suppo s eading he Tecplo and Pa aView o ma s. When using he k op ion on he
de sim.w i e_de ices() (page 98), a ile wi h a isi ilename ex ension is c ea ed o load he
iles c ea ed o Pa aView.
11.3 Reducing ile sizes
Based on a con ibu ion by [@simbilod](h ps://gi hub.com/simbilod)de sim.w i e_de ices()
(page 98) now suppo s educing he ile size o da a iles by allowing use s o speci y a call-
back unc ion o educe da a usage. In his example, only he Ne Doping ield is w i en o he
Tecplo da a ile.
de sim.w i e_de ices(
ile="mesh2d_ educed. ec",
ype=" ecplo ",
include_ es =lambda x: x in ("Ne Doping",),
)
11.4 Pos p ocessing
DEVSIM has se e al commands o ge ing in o ma ion on he mesh. Those ela ed o pos p o-
cessing a e desc ibed in Model commands (page 99) and Geome y commands (page 90).
See Loading and sa ing esul s (page 43) o in o ma ion abou loading and sa ing mesh in o ma-
ion o a ile.
11.4.1 Index in o ma ion
The coo dina e_index and node_index a e de aul node models c ea ed on a egion (Table 5.1}).
The edge_index is a de aul edge models c ea ed on a egion Table 5.2.
11.4.2 Elemen node lis
The de sim.ge _elemen _node_lis () (page 90) e ie es a lis o nodes o e e y elemen on a
egion,con ac ,o in e ace.
11.3. Reducing ile sizes 62
Chap e 12
Examples
12.1 Included examples
The ollowing example di ec o ies a e con ained in he dis ibu ion. Some o hem a e desc ibed
in Simple Examples (page 68).
Table 12.1: Examples Dis ibu ed wi h DEVSIM
Di ec o y Desc ip ion
capaci ance These a e 1D and 2D capaci o simula ions, using he in e nal
meshe . A desc ip ion o hese examples is p esen ed in Capaci-
o (page 68).
diode This is a collec ion o 1D, 2D, and 3D diode s uc u es using he
in e nal meshe , as well as Gmsh. These examples a e discussed
in Diode (page 78).
bioapp1 This is a biosenso applica ion.
ec o _po en ial This is a 2D magne ic ield simula ion sol ing o he magne ic
po en ial. The simula ion sc ip is ec o _po en ial/ wowi e.py
A simula ion esul o wo wi es conduc ing cu en is shown in
Fig. 12.1.
mobili y This is an ad anced example using elec ic ield dependenden
mobili y models.
plo ing Example using a Py hon no ebook. The e is 3D isualiza ion using
py is a.
63
DEVSIM Manual, Release 2.10.0
x
y
-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
F ame 001 30 Jul 2011 wowi e
Fig. 12.1: Simula ion esul o sol ing o he magne ic po en ial and ield. The colo ing is by he Z
componen o he magne ic po en ial, and he s eam aces a e o componen s o magne ic ield.
12.1. Included examples 64
DEVSIM Manual, Release 2.10.0
Con ac bounda y condi ions
We hen c ea e he con ac models and equa ions. We use he Py hon o loop cons uc and
a iable subs i u ions o c ea e a unique model o each con ac , con ac 1_bc and con ac 2_bc.
###
### Con ac models and equa ions
###
o cin ("con ac 1","con ac 2"):
con ac _node_model(de ice=de ice, con ac =c, name="%s _bc" %c,
equa ion="Po en ial - %s _bias" %c)
con ac _node_model(de ice=de ice, con ac =c, name="%s _bc:Po en ial" %c,
equa ion="1")
con ac _equa ion(de ice=de ice, con ac =c, name="Po en ialEqua ion",
node_model="%s _bc" %c, edge_cha ge_model="DField")
In his example, he con ac bias is applied h ough pa ame e s named con ac 1_bias and
con ac 2_bias. When applying he bounda y condi ions h ough ci cui nodes, models wi h e-
spec o hei names and hei de i a i es would be equi ed.
Se ing he bounda y condi ions
###
### Se he con ac
###
se _pa ame e (de ice=de ice, egion= egion, name="con ac 1_bias", alue=1.0e-0)
se _pa ame e (de ice=de ice, egion= egion, name="con ac 2_bias", alue=0.0)
###
### Sol e
###
sol e( ype="dc", absolu e_e o =1.0, ela i e_e o =1e-10, maximum_i e a ions=30)
###
### P in he cha ge on he con ac s
###
o cin ("con ac 1","con ac 2"):
p in ("con ac : %s cha ge: %1.5e "
%(c, ge _con ac _cha ge(de ice=de ice, con ac =c, equa ion="Po en ialEqua ion
,→")))
13.1. Capaci o 71
DEVSIM Manual, Release 2.10.0
Running he simula ion
We un he simula ion and see he esul s.
con ac 2
( egion: MyRegion)
(con ac : con ac 1)
(con ac : con ac 2)
Region "MyRegion" on de ice "MyDe ice" has equa ions 0:10
De ice "MyDe ice" has equa ions 0:10
numbe o equa ions 11
I e a ion: 0
De ice: "MyDe ice" RelE o : 1.00000e+00 AbsE o : 1.00000e+00
Region: "MyRegion" RelE o : 1.00000e+00 AbsE o : 1.00000e+00
Equa ion: "Po en ialEqua ion" RelE o : 1.00000e+00 AbsE o : 1.00000e+00
I e a ion: 1
De ice: "MyDe ice" RelE o : 2.77924e-16 AbsE o : 1.12632e-16
Region: "MyRegion" RelE o : 2.77924e-16 AbsE o : 1.12632e-16
Equa ion: "Po en ialEqua ion" RelE o : 2.77924e-16 AbsE o : 1.12632e-16
con ac : con ac 1 cha ge: 3.45150e-13
con ac : con ac 2 cha ge: -3.45150e-13
Which co esponds o ou expec ed esul o 3.451510−13 F/cm2 o a homogenous capaci o .
13.1.3 2D capaci o
This example is called cap2d.py and is loca ed in he examples/capaci ance di ec o y dis ibu ed
wi h DEVSIM. This ile uses he same physics as he 1D example, bu wi h a 2D s uc u e. The mesh
is buil using he DEVSIM in e nal meshe . An ai egion exis s wi h wo elec odes in he simula ion
domain.
De ining he mesh
om de sim impo *
de ice="MyDe ice"
egion="MyRegion"
xmin=-25
x1 =-24.975
x2 =-2
x3 =2
x4 =24.975
xmax=25.0
ymin=0.0
(con inues on nex page)
13.1. Capaci o 72
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
y1 =0.1
y2 =0.2
y3 =0.8
y4 =0.9
ymax=50.0
c ea e_2d_mesh(mesh=de ice)
add_2d_mesh_line(mesh=de ice, di ="y", pos=ymin, ps=0.1)
add_2d_mesh_line(mesh=de ice, di ="y", pos=y1 , ps=0.1)
add_2d_mesh_line(mesh=de ice, di ="y", pos=y2 , ps=0.1)
add_2d_mesh_line(mesh=de ice, di ="y", pos=y3 , ps=0.1)
add_2d_mesh_line(mesh=de ice, di ="y", pos=y4 , ps=0.1)
add_2d_mesh_line(mesh=de ice, di ="y", pos=ymax, ps=5.0)
de ice=de ice
egion="ai "
add_2d_mesh_line(mesh=de ice, di ="x", pos=xmin, ps=5)
add_2d_mesh_line(mesh=de ice, di ="x", pos=x1 , ps=2)
add_2d_mesh_line(mesh=de ice, di ="x", pos=x2 , ps=0.05)
add_2d_mesh_line(mesh=de ice, di ="x", pos=x3 , ps=0.05)
add_2d_mesh_line(mesh=de ice, di ="x", pos=x4 , ps=2)
add_2d_mesh_line(mesh=de ice, di ="x", pos=xmax, ps=5)
add_2d_ egion(mesh=de ice, ma e ial="gas" , egion="ai ", yl=ymin, yh=ymax,␣
,→xl=xmin, xh=xmax)
add_2d_ egion(mesh=de ice, ma e ial="me al", egion="m1" , yl=y1 , yh=y2 , xl=x1␣
,→, xh=x4)
add_2d_ egion(mesh=de ice, ma e ial="me al", egion="m2" , yl=y3 , yh=y4 , xl=x2␣
,→, xh=x3)
# mus be ai since con ac s don' ha e any equa ions
add_2d_con ac (mesh=de ice, name="bo ", egion="ai ", ma e ial="me al", yl=y1,␣
,→yh=y2, xl=x1, xh=x4)
add_2d_con ac (mesh=de ice, name=" op", egion="ai ", ma e ial="me al", yl=y3,␣
,→yh=y4, xl=x2, xh=x3)
inalize_mesh(mesh=de ice)
c ea e_de ice(mesh=de ice, de ice=de ice)
13.1. Capaci o 73
DEVSIM Manual, Release 2.10.0
Se ing up he models
###
### Se pa ame e s on he egion
###
se _pa ame e (de ice=de ice, egion= egion, name="Pe mi i i y", alue=3.9*8.85e-
,→14)
###
### C ea e he Po en ial solu ion a iable
###
node_solu ion(de ice=de ice, egion= egion, name="Po en ial")
###
### C ea es he Po en ial@n0 and Po en ial@n1 edge model
###
edge_ om_node_model(de ice=de ice, egion= egion, node_model="Po en ial")
###
### Elec ic ield on each edge, as well as i s de i a i es wi h espec o
### he po en ial a each node
###
edge_model(de ice=de ice, egion= egion, name="Elec icField",
equa ion="(Po en ial@n0 - Po en ial@n1)*EdgeIn e seLeng h")
edge_model(de ice=de ice, egion= egion, name="Elec icField:Po en ial@n0",
equa ion="EdgeIn e seLeng h")
edge_model(de ice=de ice, egion= egion, name="Elec icField:Po en ial@n1",
equa ion="-EdgeIn e seLeng h")
###
### Model he D Field
###
edge_model(de ice=de ice, egion= egion, name="DField",
equa ion="Pe mi i i y*Elec icField")
edge_model(de ice=de ice, egion= egion, name="DField:Po en ial@n0",
equa ion="di (Pe mi i i y*Elec icField, Po en ial@n0)")
edge_model(de ice=de ice, egion= egion, name="DField:Po en ial@n1",
equa ion="-DField:Po en ial@n0")
###
### C ea e he bulk equa ion
###
(con inues on nex page)
13.1. Capaci o 74
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
equa ion(de ice=de ice, egion= egion, name="Po en ialEqua ion",
a iable_name="Po en ial", edge_model="DField",
a iable_upda e="de aul ")
###
### Con ac models and equa ions
###
o cin (" op","bo "):
con ac _node_model(de ice=de ice, con ac =c, name="%s _bc" %c,
equa ion="Po en ial - %s _bias" %c)
con ac _node_model(de ice=de ice, con ac =c, name="%s _bc:Po en ial" %c,
equa ion="1")
con ac _equa ion(de ice=de ice, con ac =c, name="Po en ialEqua ion",
node_model="%s _bc" %c, edge_cha ge_model="DField")
###
### Se he con ac
###
se _pa ame e (de ice=de ice, name=" op_bias", alue=1.0e-0)
se _pa ame e (de ice=de ice, name="bo _bias", alue=0.0)
edge_model(de ice=de ice, egion="m1", name="Elec icField", equa ion="0")
edge_model(de ice=de ice, egion="m2", name="Elec icField", equa ion="0")
node_model(de ice=de ice, egion="m1", name="Po en ial", equa ion="bo _bias;")
node_model(de ice=de ice, egion="m2", name="Po en ial", equa ion=" op_bias;")
sol e( ype="dc", absolu e_e o =1.0, ela i e_e o =1e-10, maximum_i e a ions=30,
sol e _ ype="di ec ")
Fields o isualiza ion
Be o e w i ing he mesh ou o isualiza ion, he elemen _ om_edge_model is used o calcula e
he elec ic ield a each iangle cen e in he mesh. The componen s a e he Elec icField_x
and Elec icField_y.
elemen _ om_edge_model(edge_model="Elec icField", de ice=de ice, egion= egion)
p in (ge _con ac _cha ge(de ice=de ice, con ac =" op", equa ion="Po en ialEqua ion
,→"))
p in (ge _con ac _cha ge(de ice=de ice, con ac ="bo ", equa ion="Po en ialEqua ion
(con inues on nex page)
13.1. Capaci o 75
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
,→"))
w i e_de ices( ile="cap2d.msh", ype="de sim")
w i e_de ices( ile="cap2d.da ", ype=" ecplo ")
Running he simula ion
C ea ing Region ai
C ea ing Region m1
C ea ing Region m2
Adding 8281 nodes
Adding 23918 edges wi h 22990 duplica es emo ed
Adding 15636 iangles wi h 0 duplica e emo ed
Adding 334 nodes
Adding 665 edges wi h 331 duplica es emo ed
Adding 332 iangles wi h 0 duplica e emo ed
Adding 162 nodes
Adding 321 edges wi h 159 duplica es emo ed
Adding 160 iangles wi h 0 duplica e emo ed
Con ac bo in egion ai wi h 334 nodes
Con ac op in egion ai wi h 162 nodes
Region "ai " on de ice "MyDe ice" has equa ions 0:8280
Region "m1" on de ice "MyDe ice" has no equa ions.
Region "m2" on de ice "MyDe ice" has no equa ions.
De ice "MyDe ice" has equa ions 0:8280
numbe o equa ions 8281
I e a ion: 0
De ice: "MyDe ice" RelE o : 1.00000e+00 AbsE o : 1.00000e+00
Region: "ai " RelE o : 1.00000e+00 AbsE o : 1.00000e+00
Equa ion: "Po en ialEqua ion" RelE o : 1.00000e+00 AbsE o : 1.00000e+00
I e a ion: 1
De ice: "MyDe ice" RelE o : 1.25144e-12 AbsE o : 1.73395e-13
Region: "ai " RelE o : 1.25144e-12 AbsE o : 1.73395e-13
Equa ion: "Po en ialEqua ion" RelE o : 1.25144e-12 AbsE o : 1.73395e-13
3.35017166004e-12
-3.35017166004e-12
A isualiza ion o he esul s is shown in Capaci ance simula ion esul . The colo ing is by Po en ial,
and he s eam aces a e o componen s o Elec icField. (page 77).
13.1. Capaci o 76
DEVSIM Manual, Release 2.10.0
x
y
-6 -4 -2 0 2 4 6
0
2
4
6
8
10
F ame 001 25 Jul 2011 MyDe ice
Fig. 13.1: Capaci ance simula ion esul . The colo ing is by Po en ial, and he s eam aces a e
o componen s o Elec icField.
13.1. Capaci o 77
DEVSIM Manual, Release 2.10.0
13.2 Diode
13.2.1 O e iew
The diode examples a e loca ed in he examples/diode. They demons a e he use o packages
loca ed in he py hon_packages di ec o y o simula e d i -di usion using he Scha e e -Gummel
me hod [9].
13.2.2 1D diode
Using he py hon packages
Fo hese examples, py hon modules a e p o ided o supply he app op ia e model and pa ame e
se ings. A lis ing is shown in Py hon package iles (page 78). The de sim.py hon_packages
module is pa o he dis ibu ion. The example iles in he DEVSIM dis ibu ion se he pa h p ope ly
when loading modules.
Table 13.1: Py hon package iles
model_c ea e C ea ion o models and hei de i a i es
amp Ramping bias and au oma ic s epping
simple_dd Func ions o calcula ing bulk elec on and hole cu en
simple_physics Func ions o se ing up de ice physics
Fo his example, diode_1d.py, he ollowing line is used o impo he ele an physics.
om de sim impo *
om simple_physics impo *
C ea ing he mesh
This c ea es a mesh 10−5cm long wi h a junc ion loca ed a he midpoin . The name o he de ice
is MyDe ice wi h a single egion names MyRegion. The con ac s on ei he end a e called op and
bo .
de c ea eMesh(de ice, egion):
c ea e_1d_mesh(mesh="dio")
add_1d_mesh_line(mesh="dio", pos=0, ps=1e-7, ag=" op")
add_1d_mesh_line(mesh="dio", pos=0.5e-5, ps=1e-9, ag="mid")
add_1d_mesh_line(mesh="dio", pos=1e-5, ps=1e-7, ag="bo ")
add_1d_con ac (mesh="dio", name=" op", ag=" op", ma e ial="me al")
add_1d_con ac (mesh="dio", name="bo ", ag="bo ", ma e ial="me al")
add_1d_ egion (mesh="dio", ma e ial="Si", egion= egion, ag1=" op", ag2="bo
,→")
inalize_mesh(mesh="dio")
(con inues on nex page)
13.2. Diode 78
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
c ea e_de ice(mesh="dio", de ice=de ice)
de ice="MyDe ice"
egion="MyRegion"
c ea eMesh(de ice, egion)
Physical models and pa ame e s
####
#### Se pa ame e s o 300 K
####
Se SiliconPa ame e s(de ice, egion, 300)
se _pa ame e (de ice=de ice, egion= egion, name=" aun", alue=1e-8)
se _pa ame e (de ice=de ice, egion= egion, name=" aup", alue=1e-8)
####
#### Ne Doping
####
C ea eNodeModel(de ice, egion, "Accep o s","1.0e18*s ep(0.5e-5-x)")
C ea eNodeModel(de ice, egion, "Dono s","1.0e18*s ep(x-0.5e-5)")
C ea eNodeModel(de ice, egion, "Ne Doping","Dono s-Accep o s")
p in _node_ alues(de ice=de ice, egion= egion, name="Ne Doping")
####
#### C ea e Po en ial, Po en ial@n0, Po en ial@n1
####
C ea eSolu ion(de ice, egion, "Po en ial")
####
#### C ea e po en ial only physical models
####
C ea eSiliconPo en ialOnly(de ice, egion)
####
#### Se up he con ac s applying a bias
####
o iin ge _con ac _lis (de ice=de ice):
se _pa ame e (de ice=de ice, name=Ge Con ac BiasName(i), alue=0.0)
C ea eSiliconPo en ialOnlyCon ac (de ice, egion, i)
####
#### Ini ial DC solu ion
(con inues on nex page)
13.2. Diode 79
DEVSIM Manual, Release 2.10.0
(con inued om p e ious page)
####
sol e( ype="dc", absolu e_e o =1.0, ela i e_e o =1e-12, maximum_i e a ions=30)
####
#### d i di usion solu ion a iables
####
C ea eSolu ion(de ice, egion, "Elec ons")
C ea eSolu ion(de ice, egion, "Holes")
####
#### c ea e ini ial guess om dc only solu ion
####
se _node_ alues(de ice=de ice, egion= egion,
name="Elec ons", ini _ om="In insicElec ons")
se _node_ alues(de ice=de ice, egion= egion,
name="Holes", ini _ om="In insicHoles")
###
### Se up equa ions
###
C ea eSiliconD i Di usion(de ice, egion)
o iin ge _con ac _lis (de ice=de ice):
C ea eSiliconD i Di usionA Con ac (de ice, egion, i)
###
### D i di usion simula ion a equilib ium
###
sol e( ype="dc", absolu e_e o =1e10, ela i e_e o =1e-10, maximum_i e a ions=30)
####
#### Ramp he bias o 0.5 Vol s
####
=0.0
while <0.51:
se _pa ame e (de ice=de ice, name=Ge Con ac BiasName(" op"), alue= )
sol e( ype="dc", absolu e_e o =1e10, ela i e_e o =1e-10, maximum_
,→i e a ions=30)
P in Cu en s(de ice, " op")
P in Cu en s(de ice, "bo ")
+= 0.1
####
#### W i e ou he esul
####
w i e_de ices( ile="diode_1d.da ", ype=" ecplo ")
13.2. Diode 80
DEVSIM Manual, Release 2.10.0
•node_model (s , op ional ) – Name o he node model being in eg a ed
a each node a his con ac
de sim.cus om_equa ion(name,p ocedu e)
Cus om equa ion assembly. See Cus om ma ix assembly (page 31) o a desc ip ion o how
he unc ion should be s uc u ed.
Pa ame e s
•name (s ) – Name o he cus om equa ion being c ea ed
•p ocedu e (s ) – The p ocedu e o be called
de sim.dele e_con ac _equa ion(de ice,con ac ,name)
This command dele es an equa ion om a con ac .
Pa ame e s
•de ice (s ) – The selec ed de ice
•con ac (s ) – Con ac on which o apply his command
•name (s ) – Name o he con ac equa ion being dele ed
de sim.dele e_equa ion(de ice, egion,name)
This command dele es an equa ion om a egion.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he equa ion being dele ed
de sim.dele e_in e ace_equa ion(de ice,in e ace,name)
This command dele es an equa ion om an in e ace.
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
•name (s ) – Name o he in e ace equa ion being dele ed
de sim.equa ion(de ice, egion,name, a iable_name,node_model,edge_model,
edge_ olume_model, ime_node_model,elemen _model,
olume_node0_model, olume_node1_model, a iable_upda e)
Speci y an equa ion o sol e on a de ice
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he equa ion being c ea ed
14.2. Equa ion commands 87
DEVSIM Manual, Release 2.10.0
• a iable_name (s ) – Name o he node solu ion being sol ed
•node_model (s , op ional ) – Name o he node model being in eg a ed
a each node in he de ice olume
•edge_model (s , op ional ) – Name o he edge model being in eg a ed
o e each edge in he de ice olume
•edge_ olume_model (s , op ional ) – Name o he edge model being
in eg a ed o e he olume o each edge in he de ice olume
• ime_node_model (s , op ional ) – Name o he ime dependen
node_model being in eg a ed a each node in he de ice olume
•elemen _model (s , op ional ) – Name o he elemen model being in-
eg a ed o e each edge in he de ice olume
• olume_node0_model (s , op ional ) – Name o he elemen model be-
ing in eg a ed o e he olume o node 0 o each edge on he con ac
• olume_node1_model (s , op ional ) – Name o he elemen model be-
ing in eg a ed o e he olume o node 1 o each edge on he con ac
• a iable_upda e ({'de aul ','log_damp','posi i e'}) – upda e
ype o ci cui a iable
No es
The in eg a ion a iables can be changed in 2D o cylind ical coo dina e sys ems by se ing
he app op ia e pa ame e s as desc ibed in Cylind ical coo dina e sys ems (page 32).
In o de o se he node olumes o in eg a ion o he edge_ olume_model, i is possible o
do some hing like his:
de sim.edge_model(de ice=”de ice”, egion=” egion”,
name=”EdgeNodeVolume”, equa ion=”0.5*Su aceA ea*EdgeLeng h”)
de sim.se _pa ame e (name=”edge_node0_ olume_model”,
alue=”EdgeNodeVolume”) de sim.se _pa ame e (name=”edge_node1_ olume_model”,
alue=”EdgeNodeVolume”)
de sim.ge _con ac _equa ion_command(de ice,con ac ,name)
This command ge s he op ions used when c ea ing his con ac equa ion.
Pa ame e s
•de ice (s ) – The selec ed de ice
•con ac (s ) – Con ac on which o apply his command
•name (s ) – Name o he con ac equa ion being command op ions e-
u ned
de sim.ge _con ac _equa ion_lis (de ice,con ac )
This command ge s a lis o equa ions on he speci ied con ac .
14.2. Equa ion commands 88
DEVSIM Manual, Release 2.10.0
Pa ame e s
•de ice (s ) – The selec ed de ice
•con ac (s ) – Con ac on which o apply his command
de sim.ge _equa ion_command(de ice, egion,name)
This command ge s he op ions used when c ea ing his equa ion.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he equa ion being command op ions e u ned
de sim.ge _equa ion_lis (de ice, egion)
This command ge s a lis o equa ions on he speci ied egion.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
de sim.ge _equa ion_numbe s(de ice, egion,equa ion, a iable)
Re u ns a lis o he equa ion numbe s co esponding o each node in a egion. Values a e
only alid when du ing he cou se o a sol e.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•equa ion (s , op ional ) – Name o he equa ion
• a iable (s , op ional ) – Name o he a iable
de sim.ge _in e ace_equa ion_command(de ice,in e ace,name)
This command ge s he op ions used when c ea ing his in e ace equa ion.
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
•name (s ) – Name o he in e ace equa ion being command op ions e-
u ned
de sim.ge _in e ace_equa ion_lis (de ice,in e ace)
This command ge s a lis o equa ions on he speci ied in e ace.
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
14.2. Equa ion commands 89
DEVSIM Manual, Release 2.10.0
de sim.in e ace_equa ion(de ice,in e ace,name,name0,name1,in e ace_model, ype)
Command o speci y an equa ion a an in e ace
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
•name (s ) – Name o he in e ace equa ion being c ea ed
•name0 (s , op ional ) – Name o he equa ion coupling in egion 0 being
c ea ed (de aul ‘name’)
•name1 (s , op ional ) – Name o he equa ion coupling in egion 1 being
c ea ed (de aul ‘name’)
•in e ace_model (s ) – When speci ied, he bulk equa ions on bo h
sides o he in e ace a e in eg a ed oge he . This model is hen used
o speci y how nodal quan i ies on bo h sides o he in e ace a e balanced
• ype ({'con inuous',' lux e m','hyb id'} equi ed ) – Speci ies
he ype o bounda y condi ion
14.3 Geome y commands
Commands o ge ing in o ma ion abou he de ice s uc u e.
de sim.ge _con ac _lis (de ice)
Ge s a lis o con ac s on a de ice.
Pa ame e s
de ice (s ) – The selec ed de ice
de sim.ge _de ice_lis ()
Ge s a lis o de ices on he simula ion.
de sim.ge _elemen _node_lis (de ice, egion,con ac ,in e ace, eo de )
Ge s a lis o nodes o each elemen on a de ice, egion, con ac , o in e ace.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•con ac (s , op ional ) – I speci ied, ge s he elemen nodes o he
con ac on he speci ied egion
•in e ace (s , op ional ) – I speci ied, ge s he elemen nodes o he
in e ace on he speci ied egion
• eo de (bool , op ional ) – I speci ied, eo de s he elemen nodes in
a manne compa ible in meshing so wa e (de aul False)
14.3. Geome y commands 90
DEVSIM Manual, Release 2.10.0
de sim.ge _in e ace_lis (de ice)
Ge s a lis o in e aces on a de ice.
Pa ame e s
de ice (s ) – The selec ed de ice
de sim.ge _ egion_lis (de ice,con ac ,in e ace)
Ge s a lis o egions on a de ice, con ac , o in e ace.
Pa ame e s
•de ice (s ) – The selec ed de ice
•con ac (s , op ional ) – I speci ied, ge s he name o he egion be-
longing o his con ac on he de ice
•in e ace (s , op ional ) – I speci ied, ge s he name o he egions
belonging o his in e ace on he de ice
de sim. ese _de sim()
Rese s all da a o clean es a .
14.4 Ma e ial commands
Commands o manipula ing pa ame e s and ma e ial p ope ies
de sim.ge _dimension(de ice)
Ge he dimension o he de ice
Pa ame e s
de ice (s , op ional ) – The selec ed de ice
de sim.ge _ma e ial(de ice, egion,con ac )
Re u ns he ma e ial o he speci ied egion
Pa ame e s
•de ice (s , op ional ) – The selec ed de ice
• egion (s , op ional ) – The selec ed egion
•con ac (s , op ional ) – Con ac on which o apply his command
de sim.ge _pa ame e (de ice, egion,name)
Ge a pa ame e on a egion, de ice, o globally.
Pa ame e s
•de ice (s , op ional ) – The selec ed de ice
• egion (s , op ional ) – The selec ed egion
•name (s ) – Name o he pa ame e name being e ie ed
14.4. Ma e ial commands 91
DEVSIM Manual, Release 2.10.0
No es
No e ha he de ice and egion op ions a e op ional. I he egion is no speci ied, he
pa ame e is e ie ed o he en i e de ice. I he de ice is no speci ied, he pa ame e is
e ie ed o all de ices. I he pa ame e is no ound on he egion, i is e ie ed on he
de ice. I i is no ound on he de ice, i is e ie ed o e all de ices.
de sim.ge _pa ame e _lis (de ice, egion)
Ge lis o pa ame e names on egion, de ice, o globally
Pa ame e s
•de ice (s , op ional ) – The selec ed de ice
• egion (s , op ional ) – The selec ed egion
No es
No e ha he de ice and egion op ions a e op ional. I he egion is no speci ied, he
pa ame e is e ie ed o he en i e de ice. I he de ice is no speci ied, he pa ame e is
e ie ed o all de ices. Unlike he de sim.ge Pa ame e (), pa ame e names on he he
de ice a e no e ie ed i hey do no exis on he egion. Simila ly, he pa ame e names
o e all de ices a e no e ie ed i hey do no exis on he de ice.
de sim.se _ma e ial(de ice, egion,con ac ,ma e ial)
Se s he new ma e ial o a egion
Pa ame e s
•de ice (s , op ional ) – The selec ed de ice
• egion (s , op ional ) – The selec ed egion
•con ac (s , op ional ) – Con ac on which o apply his command
•ma e ial (s ) – New ma e ial name
de sim.se _pa ame e (de ice, egion,name, alue)
Se a pa ame e on egion, de ice, o globally
Pa ame e s
•de ice (s , op ional ) – The selec ed de ice
• egion (s , op ional ) – The selec ed egion
•name (s ) – Name o he pa ame e name being e ie ed
• alue (any ) – alue o se o he pa ame e
14.4. Ma e ial commands 92
DEVSIM Manual, Release 2.10.0
No es
No e ha he de ice and egion op ions a e op ional. I he egion is no speci ied, he
pa ame e is se o he en i e de ice. I he de ice is no speci ied, he pa ame e is se o
all de ices.
14.5 Meshing commands
Commands o eading and w i ing meshes
de sim.add_1d_con ac (ma e ial,mesh,name, ag)
Add a con ac o a 1D mesh
Pa ame e s
•ma e ial (s ) – ma e ial o he con ac being c ea ed
•mesh (s ) – Mesh o add he con ac o
•name (s ) – Name o he con ac being c ea ed
• ag (s ) – Tex label o he posi ion o add he con ac
de sim.add_1d_in e ace(mesh, ag,name)
Add an in e ace o a 1D mesh
Pa ame e s
•mesh (s ) – Mesh o add he in e ace o
• ag (s ) – Tex label o he posi ion o add he in e ace
•name (s ) – Name o he in e ace being c ea ed
de sim.add_1d_mesh_line(mesh, ag,pos,ns,ps)
Add a mesh line o a 1D mesh
Pa ame e s
•mesh (s ) – Mesh o add he line o
• ag (s , op ional ) – Tex label o he posi ion
•pos (s ) – Posi ion o he mesh poin
•ns (Floa , op ional ) – Spacing om his poin in he nega i e di ec ion
(de aul ps alue)
•ps (Floa ) – Spacing om his poin in he posi i e di ec ion
de sim.add_1d_ egion(mesh, ag1, ag2, egion,ma e ial)
Add a egion o a 1D mesh
Pa ame e s
•mesh (s ) – Mesh o add he line o
14.5. Meshing commands 93
DEVSIM Manual, Release 2.10.0
• ag1 (s ) – Tex label o he posi ion bounding he egion being added
• ag2 (s ) – Tex label o he posi ion bounding he egion being added
• egion (s ) – Name o he egion being c ea ed
•ma e ial (s ) – Ma e ial o he egion being c ea ed
de sim.add_2d_con ac (name,ma e ial,mesh, egion,xl,xh,yl,yh,bloa )
Add an in e ace o a 2D mesh
Pa ame e s
•name (s ) – Name o he con ac being c ea ed
•ma e ial (s ) – ma e ial o he con ac being c ea ed
•mesh (s ) – Mesh o add he con ac o
• egion (s ) – Name o he egion included in he con ac
•xl (Floa , op ional ) – x posi ion o co ne o bounding box (de aul
-MAXDOUBLE)
•xh (Floa , op ional ) – x posi ion o co ne o bounding box (de aul
+MAXDOUBLE)
•yl (Floa , op ional ) – y posi ion o co ne o bounding box (de aul
-MAXDOUBLE)
•yh (Floa , op ional ) – y posi ion o co ne o bounding box (de aul
+MAXDOUBLE)
•bloa (Floa , op ional ) – Ex end bounding box by his amoun when
sea ch o mesh o include in egion (de aul 1e-10)
de sim.add_2d_in e ace(mesh,name, egion0, egion1,xl,xh,yl,yh,bloa )
Add an in e ace o a 2D mesh
Pa ame e s
•mesh (s ) – Mesh o add he in e ace o
•name (s ) – Name o he in e ace being c ea ed
• egion0 (s ) – Name o he egion included in he in e ace
• egion1 (s ) – Name o he egion included in he in e ace
•xl (Floa , op ional ) – x posi ion o co ne o bounding box (de aul
-MAXDOUBLE)
•xh (Floa , op ional ) – x posi ion o co ne o bounding box (de aul
+MAXDOUBLE)
•yl (Floa , op ional ) – y posi ion o co ne o bounding box (de aul
-MAXDOUBLE)
14.5. Meshing commands 94
DEVSIM Manual, Release 2.10.0
•yh (Floa , op ional ) – y posi ion o co ne o bounding box (de aul
+MAXDOUBLE)
•bloa (Floa , op ional ) – Ex end bounding box by his amoun when
sea ch o mesh o include in egion (de aul 1e-10)
de sim.add_2d_mesh_line(mesh,pos,ns,ps)
Add a mesh line o a 2D mesh
Pa ame e s
•mesh (s ) – Mesh o add he line o
•pos (s ) – Posi ion o he mesh poin
•ns (Floa ) – Spacing om his poin in he nega i e di ec ion
•ps (Floa ) – Spacing om his poin in he posi i e di ec ion
de sim.add_2d_ egion(mesh, egion,ma e ial,xl,xh,yl,yh,bloa )
Add a egion o a 2D mesh
Pa ame e s
•mesh (s ) – Mesh o add he egion o
• egion (s ) – Name o he egion being c ea ed
•ma e ial (s ) – Ma e ial o he egion being c ea ed
•xl (Floa , op ional ) – x posi ion o co ne o bounding box (de aul
-MAXDOUBLE)
•xh (Floa , op ional ) – x posi ion o co ne o bounding box (de aul
+MAXDOUBLE)
•yl (Floa , op ional ) – y posi ion o co ne o bounding box (de aul
-MAXDOUBLE)
•yh (Floa , op ional ) – y posi ion o co ne o bounding box (de aul
+MAXDOUBLE)
•bloa (Floa , op ional ) – Ex end bounding box by his amoun when
sea ch o mesh o include in egion (de aul 1e-10)
de sim.add_gmsh_con ac (gmsh_name,ma e ial,mesh,name, egion)
C ea e a mesh o impo a Gmsh mesh
Pa ame e s
•gmsh_name (s ) – physical g oup name in he Gmsh ile
•ma e ial (s ) – ma e ial o he con ac being c ea ed
•mesh (s ) – name o he mesh being gene a ed
•name (s ) – name o he con ac begin c ea ed
• egion (s ) – egion ha he con ac is a ached o
14.5. Meshing commands 95
DEVSIM Manual, Release 2.10.0
de sim.add_gmsh_in e ace(gmsh_name,mesh,name, egion0, egion1)
C ea e an in e ace o an impo ed Gmsh mesh
Pa ame e s
•gmsh_name (s ) – physical g oup name in he Gmsh ile
•mesh (s ) – name o he mesh being gene a ed
•name (s ) – name o he in e ace begin c ea ed
• egion0 (s ) – i s egion ha he in e ace is a ached o
• egion1 (s ) – second egion ha he in e ace is a ached o
de sim.add_gmsh_ egion(gmsh_name,mesh, egion,ma e ial)
C ea e a egion o an impo ed Gmsh mesh
Pa ame e s
•gmsh_name (s ) – physical g oup name in he Gmsh ile
•mesh (s ) – name o he mesh being gene a ed
• egion (s ) – name o he egion begin c ea ed
•ma e ial (s ) – ma e ial o he egion being c ea ed
de sim.c ea e_1d_mesh(mesh)
C ea e a mesh o c ea e a 1D de ice
Pa ame e s
mesh (s ) – name o he 1D mesh being c ea ed
de sim.c ea e_2d_mesh(mesh)
C ea e a mesh o c ea e a 2D de ice
Pa ame e s
mesh (s ) – name o he 2D mesh being c ea ed
de sim.c ea e_con ac _ om_in e ace(de ice, egion,in e ace,ma e ial,name)
C ea es a con ac on a de ice om an exis ing in e ace
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•in e ace (s ) – In e ace on which o apply his command
•ma e ial (s ) – ma e ial o he con ac being c ea ed
•name (s ) – name o he con ac begin c ea ed
de sim.c ea e_de ice(mesh,de ice)
C ea e a de ice om a mesh
Pa ame e s
14.5. Meshing commands 96
DEVSIM Manual, Release 2.10.0
de sim.edge_ om_node_model(de ice, egion,node_model)
Fo a node model, c ea es an 2 edge models e e ing o he node model alue a bo h ends
o he edge.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•node_model (s ) – The node model om which we a e c ea ing he edge
model
No es
Fo example, o calcula e elec ic ield:
de sim.edge_ om_node_model(de ice=de ice, egion= egion,
node_model=”Po en ial”)
de sim.edge_model(de ice, egion,name,equa ion,display_ ype)
C ea es an edge model based on an equa ion
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he edge model being c ea ed
•equa ion (s ) – Equa ion used o desc ibe he edge model being c ea ed
•display_ ype ({'scala ','nodisplay',' ec o '}) – Op ion o ou -
pu display in g aphical iewe
No es
The ec o op ion uses an a e aging scheme o he edge alues p ojec ed in he di ec ion
o each edge. Fo a gi en model, model, he gene a ed componen s in he isualiza ion iles
is:
•model_x_onNode
•model_y_onNode
•model_z_onNode (3D)
This a e aging scheme does no p oduce accu a e esul s, and i is ecommended o use
he de sim.elemen _ om_edge_model() (page 104) o c ea e componen s be e sui ed o
isualiza ion. See Visualiza ion and pos p ocessing (page 61) o mo e in o ma ion abou
c ea ing da a iles o ex e nal isualiza ion p og ams.
14.6. Model commands 103
DEVSIM Manual, Release 2.10.0
de sim.edge_solu ion(de ice, egion,name)
C ea e node model whose alues a e se .
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he solu ion being c ea ed
de sim.elemen _ om_edge_model(de ice, egion,edge_model,de i a i e)
C ea es elemen edge models om an edge model
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•edge_model (s ) – The edge model om which we a e c ea ing he ele-
men model
•de i a i e (s , op ional ) – The a iable we a e aking wi h espec
o edge_model
No es
Fo an edge model emodel, c ea es an elemen models e e ing o he di ec ional compo-
nen s on each edge o he elemen :
•emodel_x
•emodel_y
I he de i a i e a iable op ion is speci ied, he emodel@n0 and emodel@n1 a e used o
c ea e:
•emodel_x: a iable@en0
•emodel_y: a iable@en0
•emodel_x: a iable@en1
•emodel_y: a iable@en1
•emodel_x: a iable@en2
•emodel_y: a iable@en2
in 2D o each node on a iangula elemen . and
•emodel_x: a iable@en0
•emodel_y: a iable@en0
•emodel_z: a iable@en0
•emodel_x: a iable@en1
14.6. Model commands 104
DEVSIM Manual, Release 2.10.0
•emodel_y: a iable@en1
•emodel_z: a iable@en1
•emodel_x: a iable@en2
•emodel_y: a iable@en2
•emodel_z: a iable@en2
•emodel_x: a iable@en3
•emodel_y: a iable@en3
•emodel_z: a iable@en3
in 3D o each node on a e ahed al elemen .
The su ix en0 e e s o he i s node on he edge o he elemen and en1 e e s o he second
node. en2 and en3 speci ies he de i a i es wi h espec he a iable a he nodes opposi e
he edges on he elemen being conside ed.
de sim.elemen _ om_node_model(de ice, egion,node_model)
C ea es elemen edge models om a node model
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•node_model (s ) – The node model om which we a e c ea ing he edge
model
No es
This command c ea es an elemen edge model om a node model so ha each co ne o
he elemen is ep esen ed. A node model, nmodel, would be be accessible as
•nmodel@en0
•nmodel@en1
•nmodel@en2
•nmodel@en3 (3D)
whe e en0, and en1 e e s o he nodes on he elemen ’s edge. In 2D, en2 e e s o he node
on he iangle node opposi e he edge. In 3D, en2 and en3 e e s o he nodes on he nodes
o he elemen edge on he e ahed al elemen .
de sim.elemen _model(de ice, egion,name,equa ion,display_ ype)
C ea e a model e alua ed on elemen edges.
Pa ame e s
•de ice (s ) – The selec ed de ice
14.6. Model commands 105
DEVSIM Manual, Release 2.10.0
• egion (s ) – The selec ed egion
•name (s ) – Name o he elemen edge model being c ea ed
•equa ion (s ) – Equa ion used o desc ibe he elemen edge model be-
ing c ea ed
•display_ ype ({'scala ','nodisplay'}) – Op ion o ou pu display in
g aphical iewe
de sim.elemen _pai _ om_edge_model(de ice, egion,edge_model,de i a i e)
C ea es elemen edge models om an edge model
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•edge_model (s ) – The edge model om which we a e c ea ing he ele-
men model
•de i a i e (s , op ional ) – The a iable we a e aking wi h espec
o edge_model
No es
Fo an edge model emodel, c ea es an elemen models e e ing o he di ec ional compo-
nen s on each edge o he elemen :
•emodel_node0_x
•emodel_node0_y
•emodel_node1_x
•emodel_node1_y
I he de i a i e a iable op ion is speci ied, he emodel@n0 and emodel@n1 a e used o
c ea e:
•emodel_node0_x: a iable@en0
•emodel_node0_y: a iable@en0
•emodel_node0_x: a iable@en1
•emodel_node0_y: a iable@en1
•emodel_node0_x: a iable@en2
•emodel_node0_y: a iable@en2
•emodel_node1_x: a iable@en0
•emodel_node1_y: a iable@en0
•emodel_node1_x: a iable@en1
14.6. Model commands 106
DEVSIM Manual, Release 2.10.0
•emodel_node1_y: a iable@en1
•emodel_node1_x: a iable@en2
•emodel_node1_y: a iable@en2
in 2D o each node on a iangula elemen . and
•emodel_node0_x: a iable@en0
•emodel_node0_y: a iable@en0
•emodel_node0_z: a iable@en0
•emodel_node0_x: a iable@en1
•emodel_node0_y: a iable@en1
•emodel_node0_z: a iable@en1
•emodel_node0_x: a iable@en2
•emodel_node0_y: a iable@en2
•emodel_node0_z: a iable@en2
•emodel_node0_x: a iable@en3
•emodel_node0_y: a iable@en3
•emodel_node0_z: a iable@en3
•emodel_node1_x: a iable@en0
•emodel_node1_y: a iable@en0
•emodel_node1_z: a iable@en0
•emodel_node1_x: a iable@en1
•emodel_node1_y: a iable@en1
•emodel_node1_z: a iable@en1
•emodel_node1_x: a iable@en2
•emodel_node1_y: a iable@en2
•emodel_node1_z: a iable@en2
•emodel_node1_x: a iable@en3
•emodel_node1_y: a iable@en3
•emodel_node1_z: a iable@en3
in 3D o each node on a e ahed al elemen .
The label node0 and node1 e e o he node on he edge o which he elemen ield a e age
was pe o med. Fo example, node0 signi ies ha all edges connec ed o node0 whe e used
o calcula e he elemen ield.
14.6. Model commands 107
DEVSIM Manual, Release 2.10.0
The su ix en0 e e s o he i s node on he edge o he elemen and en1 e e s o he second
node. en2 and en3 speci ies he de i a i es wi h espec he a iable a he nodes opposi e
he edges on he elemen being conside ed.
de sim.elemen _solu ion(de ice, egion,name)
C ea e node model whose alues a e se .
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he solu ion being c ea ed
de sim.ge _edge_model_lis (de ice, egion)
Re u ns a lis o he edge models on he de ice egion
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
de sim.ge _edge_model_ alues(de ice, egion,name)
Ge he edge model alues calcula ed a each edge.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he edge model alues being e u ned as a lis
de sim.ge _elemen _model_lis (de ice, egion)
Re u ns a lis o he elemen edge models on he de ice egion
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
de sim.ge _elemen _model_ alues(de ice, egion,name)
Ge elemen model alues a each elemen edge
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he elemen edge model alues being e u ned as
a lis
14.6. Model commands 108
DEVSIM Manual, Release 2.10.0
de sim.ge _in e ace_model_lis (de ice,in e ace)
Re u ns a lis o he in e ace models on he in e ace
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
de sim.ge _in e ace_model_ alues(de ice,in e ace,name)
Ge s in e ace model alues e alua ed a each in e ace node.
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
•name (s ) – Name o he in e ace model alues being e u ned as a lis
de sim.ge _node_model_lis (de ice, egion)
Re u ns a lis o he node models on he de ice egion
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
de sim.ge _node_model_ alues(de ice, egion,name)
Ge node model alues e alua ed a each node in a egion.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he node model alues being e u ned as a lis
de sim.in e ace_model(de ice,in e ace,equa ion)
C ea e an in e ace model om an equa ion.
Pa ame e s
•de ice (s ) – The selec ed de ice
•in e ace (s ) – In e ace on which o apply his command
•equa ion (s ) – Equa ion used o desc ibe he in e ace node model be-
ing c ea ed
de sim.in e ace_no mal_model(de ice, egion,in e ace)
C ea es edge models whose componen s a e based on di ec ion and dis ance o an in e ace
Pa ame e s
•de ice (s ) – The selec ed de ice
14.6. Model commands 109
DEVSIM Manual, Release 2.10.0
• egion (s ) – The selec ed egion
•in e ace (s ) – In e ace on which o apply his command
No es
This model c ea es he ollowing edge models:
•iname_dis ance
•iname_no mal_x (2D and 3D)
•iname_no mal_y (2D and 3D)
•iname_no mal_z (3D only)
whe e iname is he name o he in e ace. The no mals a e o he closes node on he
in e ace. The sign is owa d he in e ace.
de sim.node_model(de ice, egion,name,equa ion,display_ ype)
C ea e a node model om an equa ion.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he node model being c ea ed
•equa ion (s ) – Equa ion used o desc ibe he node model being c ea ed
•display_ ype ({'scala ','nodisplay'}) – Op ion o ou pu display in
g aphical iewe
de sim.node_solu ion(de ice, egion,name)
C ea e node model whose alues a e se .
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he solu ion being c ea ed
de sim.p in _edge_ alues(de ice, egion,name)
P in edge alues o debugging.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he edge model alues being p in ed o he sc een
14.6. Model commands 110
DEVSIM Manual, Release 2.10.0
de sim.p in _elemen _ alues(de ice, egion,name)
P in elemen alues o debugging.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he elemen edge model alues being p in ed o he
sc een
de sim.p in _node_ alues(de ice, egion,name)
P in node alues o debugging.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he node model alues being p in ed o he sc een
de sim. egis e _ unc ion(name,na gs,p ocedu e)
This command is used o egis e a new Py hon p ocedu e o e alua ion by SYMDIFF.
Pa ame e s
•name (s ) – Name o he unc ion
•na gs (s ) – Numbe o a gumen s o he unc ion
•p ocedu e (s ) – The p ocedu e o be called
de sim.se _edge_ alues(de ice, egion,name,ini _ om, alues)
Se edge model alues om ano he edge model, o a lis o alues.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he edge model being ini ialized
•ini _ om (s , op ional ) – Node model we a e using o ini ialize he
edge solu ion
• alues (lis , op ional ) – Lis o alues o each edge in he egion.
de sim.se _elemen _ alues(de ice, egion,name,ini _ om, alues)
Se elemen model alues om ano he elemen model, o a lis o alues.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he elemen model being ini ialized
14.6. Model commands 111
DEVSIM Manual, Release 2.10.0
•ini _ om (s , op ional ) – Node model we a e using o ini ialize he
elemen solu ion
• alues (lis , op ional ) – Lis o alues o each elemen in he egion.
de sim.se _node_ alue(de ice, egion,name,index, alue)
A uni o m alue is used i index is no speci ied. No e ha equa ion based node models will
lose his alue i hei equa ion is ecalcula ed.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he node model being whose alue is being se
•index (in ) – Index o node being se
• alue (Floa ) – Value o node being se
de sim.se _node_ alues(de ice, egion,name,ini _ om, alues)
Se node model alues om ano he node model, o a lis o alues.
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•name (s ) – Name o he node model being ini ialized
•ini _ om (s , op ional ) – Node model we a e using o ini ialize he
node solu ion
• alues (lis , op ional ) – Lis o alues o each node in he egion.
de sim.symdi (exp )
This command e u ns an exp ession. All s ings a e ea ed as independen a iables. I is
p ima ily used o de ining new unc ions o he pa se .
Pa ame e s
exp (s ) – Exp ession o send o SYMDIFF
de sim. ec o _elemen _model(de ice, egion,elemen _model)
C ea e ec o componen s om an elemen edge model
Pa ame e s
•de ice (s ) – The selec ed de ice
• egion (s ) – The selec ed egion
•elemen _model (s ) – The elemen model o which we a e calcula ing
he ec o componen s
14.6. Model commands 112
DEVSIM Manual, Release 2.10.0
V
ec o _elemen _model() (in module de sim),
112
ec o _g adien () (in module de sim), 113
W
w i e_de ices() (in module de sim), 98
Index 119