Skip to content

Commit dd10bf4

Browse files
committed
python formatting: autopep8 . --select E12
1 parent 948b4ab commit dd10bf4

File tree

10 files changed

+165
-165
lines changed

10 files changed

+165
-165
lines changed

dg_common.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def set_dg_parameters(device, region):
4141
# Edge Integration
4242
#
4343
em = (
44-
("b_n", "b_ne", "arithmetic", ()),
44+
("b_n", "b_ne", "arithmetic", ()),
4545
("b_p", "b_pe", "arithmetic", ()),
4646
)
4747
for e in em:
@@ -73,7 +73,7 @@ def setup_log_si(device, region):
7373
# log_n, log_p
7474
#
7575
em = (
76-
("d_l_n", "log(Electrons@n0/Electrons@n1)*EdgeInverseLength"),
76+
("d_l_n", "log(Electrons@n0/Electrons@n1)*EdgeInverseLength"),
7777
("d_l_n:Electrons@n0", "(Electrons@n0^(-1))*EdgeInverseLength"),
7878
("d_l_n:Electrons@n1", "-(Electrons@n1^(-1))*EdgeInverseLength"),
7979
("d_l_p", "log(Holes@n0/Holes@n1)*EdgeInverseLength"),
@@ -106,7 +106,7 @@ def setup_log_ox(device, region):
106106
# log_n, log_p
107107
#
108108
em = (
109-
# could use gradient model
109+
# could use gradient model
110110
("d_l_n", "EdgeInverseLength*(Le@n1 - Le@n0)/V_t_edge"),
111111
("d_l_n:Le@n0", "-EdgeInverseLength/V_t_edge"),
112112
("d_l_n:Le@n1", "EdgeInverseLength/V_t_edge"),
@@ -141,7 +141,7 @@ def setup_log_si_potential_only(device, region):
141141
# log_n, log_p
142142
#
143143
em = (
144-
# could use gradient model
144+
# could use gradient model
145145
#("d_l_n", "EdgeInverseLength*((Le@n1 - Le@n0)/V_t_edge)"),
146146
#("d_l_n", "EdgeInverseLength*((-V_t_edge*log(NIE_edge) + (Le@n1 - Le@n0))/V_t_edge)"),
147147
#("d_l_n", "EdgeInverseLength*((-V_t_edge*log(NIE_edge) + (Potential@n0 - Potential@n1))/V_t_edge)"),
@@ -204,10 +204,10 @@ def setup_dg_volume(device, region, normalized=False):
204204
# ("Lh_eqn:Lh", "1/b_p"),
205205
#)
206206
em = (
207-
# ("Le_eqn", "Le - AtOx*1e2"),
208-
("Le_eqn", "Le - AtOx*b_nox*SurfaceArea/(NodeVolume*x_np)"),
207+
# ("Le_eqn", "Le - AtOx*1e2"),
208+
("Le_eqn", "Le - AtOx*b_nox*SurfaceArea/(NodeVolume*x_np)"),
209209
("Le_eqn:Le", "1"),
210-
# ("Lh_eqn", "Lh"),
210+
# ("Lh_eqn", "Lh"),
211211
("Lh_eqn", "Lh - AtOx*b_pox*SurfaceArea/(NodeVolume*x_pp)"),
212212
("Lh_eqn:Lh", "1"),
213213
)
@@ -267,7 +267,7 @@ def setup_dg_ox(device, region):
267267

268268
def setup_dg_equation(device, region, e_name, v_name, e_m, e_v_m, n_m):
269269
equation(device=device, region=region, name=e_name, variable_name=v_name,
270-
edge_model=e_m, edge_volume_model=e_v_m, node_model=n_m, variable_update="default")
270+
edge_model=e_m, edge_volume_model=e_v_m, node_model=n_m, variable_update="default")
271271

272272
# TODO: generalize multiple contacts by testing existence
273273
def setup_dg_contact(device, contact, eq_name, v_name):
@@ -278,7 +278,7 @@ def setup_dg_contact(device, contact, eq_name, v_name):
278278
CreateContactNodeModel(device, contact, d, '1')
279279

280280
contact_equation(device=device , contact=contact, name=eq_name, variable_name=v_name,
281-
node_model=m)
281+
node_model=m)
282282

283283
def setup_dg_interface(device, interface, eq_name, v_name):
284284
model_name = CreateContinuousInterfaceModel(device, interface, v_name)

dg_physics.py

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#####
2828
def SetUniversalParameters(device, region):
2929
universal = {
30-
'q' : 1.6e-19, #, 'coul'),
30+
'q' : 1.6e-19, #, 'coul'),
3131
'k' : 1.3806503e-23, #, 'J/K'),
3232
'Permittivity_0' : 8.85e-14 #, 'F/cm^2')
3333
}
@@ -51,7 +51,7 @@ def SetSiliconParameters(device, region):
5151

5252
##D. B. M. Klaassen, J. W. Slotboom, and H. C. de Graaff, "Unified apparent bandgap narrowing in n- and p-type Silicon," Solid-State Electronics, vol. 35, no. 2, pp. 125-29, 1992.
5353
par = {
54-
'Permittivity' : 11.1*get_parameter(device=device, region=region, name='Permittivity_0'),
54+
'Permittivity' : 11.1*get_parameter(device=device, region=region, name='Permittivity_0'),
5555
'NC300' : 2.8e19, # '1/cm^3'
5656
'NV300' : 3.1e19, # '1/cm^3'
5757
'EG300' : 1.12, # 'eV'
@@ -90,7 +90,7 @@ def SetSiliconParameters(device, region):
9090
"n1" : 1e10,
9191
"p1" : 1e10,
9292
# TEMP
93-
# "T" : 300
93+
# "T" : 300
9494
}
9595

9696
for k, v in list(par.items()):
@@ -101,7 +101,7 @@ def CreateQuasiFermiLevels(device, region, electron_model, hole_model, variables
101101
Creates the models for the quasi-Fermi levels. Assuming Boltzmann statistics.
102102
'''
103103
eq = (
104-
('EFN', 'EC + V_t * log(%s/NC)' % electron_model, ('Potential', 'Electrons')),
104+
('EFN', 'EC + V_t * log(%s/NC)' % electron_model, ('Potential', 'Electrons')),
105105
('EFP', 'EV - V_t * log(%s/NV)' % hole_model, ('Potential', 'Holes')),
106106
)
107107
for (model, equation, variable_list) in eq:
@@ -118,16 +118,16 @@ def CreateDensityOfStates(device, region, variables):
118118
Neglects Bandgap narrowing.
119119
'''
120120
eq = (
121-
('NC', 'NC300 * (T/300)^1.5', ('T',)),
121+
('NC', 'NC300 * (T/300)^1.5', ('T',)),
122122
('NV', 'NV300 * (T/300)^1.5', ('T',)),
123-
# ('NTOT', 'Donors + Acceptors', ()),
123+
# ('NTOT', 'Donors + Acceptors', ()),
124124
# Band Gap Narrowing
125125
('DEG', '0', ()),
126126
#('DEG', 'V0.BGN * (log(NTOT/N0.BGN) + ((log(NTOT/N0.BGN)^2 + CON.BGN)^(0.5)))', ()),
127127
('EG', 'EG300 + EGALPH*((300^2)/(300+EGBETA) - (T^2)/(T+EGBETA)) - DEG', ('T')),
128128
('NIE', '((NC * NV)^0.5) * exp(-EG/(2*V_t))*exp(DEG)', ('T')),
129129
('EC', '-Potential - Affinity - DEG/2', ('Potential',)),
130-
# ('EV', 'Potential', ('Potential', 'T')),
130+
# ('EV', 'Potential', ('Potential', 'T')),
131131
('EV', 'EC - EG', ('Potential', 'T')),
132132
('EI', '0.5 * (EC + EV + V_t*log(NC/NV))', ('Potential', 'T')),
133133
)
@@ -145,7 +145,7 @@ def CreateBandEdgeModels(device, region, variables):
145145
# TODO; remember derivatives for these models
146146

147147
eq = (
148-
('EN', 'EC + Le', ('Potential', 'T', 'Le')),
148+
('EN', 'EC + Le', ('Potential', 'T', 'Le')),
149149
('EP', 'EV - Lh', ('Potential', 'T', 'Lh')),
150150
)
151151

@@ -164,7 +164,7 @@ def CreateBandEdgeModels(device, region, variables):
164164
edge_from_node_model(device=device, region=region, node_model="Lh")
165165

166166
eeq = (
167-
('ECdiff', '(Potential@n0-Potential@n1) + 0.5*(DEG@n0-DEG@n1)', ('T',)),
167+
('ECdiff', '(Potential@n0-Potential@n1) + 0.5*(DEG@n0-DEG@n1)', ('T',)),
168168
('EVdiff', 'kahan3(ECdiff, (EG@n0-EG@n1), 0.5*(DEG@n1-DEG@n0))', ('T',)),
169169
('ECdiff:Potential@n0', '1', ()),
170170
('ECdiff:Potential@n1', '-1', ()),
@@ -220,9 +220,9 @@ def CreateEField(device, region):
220220
Creates the EField and DField.
221221
'''
222222
edge_average_model(device=device, region=region, node_model="Potential",
223-
edge_model="EField", average_type="negative_gradient")
223+
edge_model="EField", average_type="negative_gradient")
224224
edge_average_model(device=device, region=region, node_model="Potential",
225-
edge_model="EField", average_type="negative_gradient", derivative="Potential")
225+
edge_model="EField", average_type="negative_gradient", derivative="Potential")
226226

227227
def CreateDField(device, region):
228228
CreateEdgeModel(device, region, "DField", "Permittivity * EField")
@@ -242,11 +242,11 @@ def CreateSiliconPotentialOnly(device, region):
242242

243243
# require NetDoping
244244
for i in (
245-
("IntrinsicElectrons", "NIE*exp(ifelse(((Potential-Le)/V_t) < 80, ((Potential-Le)/V_t), 80))"),
245+
("IntrinsicElectrons", "NIE*exp(ifelse(((Potential-Le)/V_t) < 80, ((Potential-Le)/V_t), 80))"),
246246
("IntrinsicHoles", "NIE*exp(ifelse(((-Potential-Lh)/V_t) < 80, ((-Potential-Lh)/V_t), 80))"),
247247
("IntrinsicCharge", "kahan3(IntrinsicHoles, -IntrinsicElectrons, NetDoping)"),
248248
("PotentialIntrinsicCharge", "-q * IntrinsicCharge")
249-
):
249+
):
250250
n = i[0]
251251
e = i[1]
252252
CreateNodeModel(device, region, n, e)
@@ -284,14 +284,14 @@ def CreateSiliconPotentialOnlyContact(device, region, contact, is_circuit=False)
284284

285285
if is_circuit:
286286
contact_equation(device=device, contact=contact, name="PotentialEquation", variable_name="Potential",
287-
node_model=contact_model_name, edge_model="",
288-
node_charge_model="contactcharge_node", edge_charge_model="DField",
289-
node_current_model="", edge_current_model="", circuit_node=GetContactBiasName(contact))
287+
node_model=contact_model_name, edge_model="",
288+
node_charge_model="contactcharge_node", edge_charge_model="DField",
289+
node_current_model="", edge_current_model="", circuit_node=GetContactBiasName(contact))
290290
else:
291291
contact_equation(device=device, contact=contact, name="PotentialEquation", variable_name="Potential",
292-
node_model=contact_model_name, edge_model="",
293-
node_charge_model="contactcharge_node", edge_charge_model="DField",
294-
node_current_model="", edge_current_model="")
292+
node_model=contact_model_name, edge_model="",
293+
node_charge_model="contactcharge_node", edge_charge_model="DField",
294+
node_current_model="", edge_current_model="")
295295

296296

297297
def CreateSRH(device, region, variables):
@@ -322,8 +322,8 @@ def CreateECE(device, region, Jn):
322322
CreateNodeModelDerivative(device, region, "NCharge", NCharge, "Electrons")
323323

324324
equation(device=device, region=region, name="ElectronContinuityEquation", variable_name="Electrons",
325-
time_node_model = "NCharge",
326-
edge_model=Jn, variable_update="positive", node_model="ElectronGeneration")
325+
time_node_model = "NCharge",
326+
edge_model=Jn, variable_update="positive", node_model="ElectronGeneration")
327327

328328
def CreateHCE(device, region, Jp):
329329
'''
@@ -334,8 +334,8 @@ def CreateHCE(device, region, Jp):
334334
CreateNodeModelDerivative(device, region, "PCharge", PCharge, "Holes")
335335

336336
equation(device=device, region=region, name="HoleContinuityEquation", variable_name="Holes",
337-
time_node_model = "PCharge",
338-
edge_model=Jp, variable_update="positive", node_model="HoleGeneration")
337+
time_node_model = "PCharge",
338+
edge_model=Jp, variable_update="positive", node_model="HoleGeneration")
339339

340340
def CreatePE(device, region):
341341
'''
@@ -347,8 +347,8 @@ def CreatePE(device, region):
347347
CreateNodeModelDerivative(device, region, "PotentialNodeCharge", pne, "Holes")
348348

349349
equation(device=device, region=region, name="PotentialEquation", variable_name="Potential",
350-
node_model="PotentialNodeCharge", edge_model="DField",
351-
time_node_model="", variable_update="log_damp")
350+
node_model="PotentialNodeCharge", edge_model="DField",
351+
time_node_model="", variable_update="log_damp")
352352

353353

354354
def CreateSiliconDriftDiffusion(device, region, mu_n="mu_n", mu_p="mu_p", Jn='Jn', Jp='Jp'):
@@ -385,21 +385,21 @@ def CreateSiliconDriftDiffusionContact(device, region, contact, Jn, Jp, is_circu
385385

386386
if is_circuit:
387387
contact_equation(device=device, contact=contact, name="ElectronContinuityEquation", variable_name="Electrons",
388-
node_model=contact_electrons_name,
389-
edge_current_model=Jn, circuit_node=GetContactBiasName(contact))
388+
node_model=contact_electrons_name,
389+
edge_current_model=Jn, circuit_node=GetContactBiasName(contact))
390390

391391
contact_equation(device=device, contact=contact, name="HoleContinuityEquation", variable_name="Holes",
392-
node_model=contact_holes_name,
393-
edge_current_model=Jp, circuit_node=GetContactBiasName(contact))
392+
node_model=contact_holes_name,
393+
edge_current_model=Jp, circuit_node=GetContactBiasName(contact))
394394

395395
else:
396396
contact_equation(device=device, contact=contact, name="ElectronContinuityEquation", variable_name="Electrons",
397-
node_model=contact_electrons_name,
398-
edge_current_model=Jn)
397+
node_model=contact_electrons_name,
398+
edge_current_model=Jn)
399399

400400
contact_equation(device=device, contact=contact, name="HoleContinuityEquation", variable_name="Holes",
401-
node_model=contact_holes_name,
402-
edge_current_model=Jp)
401+
node_model=contact_holes_name,
402+
edge_current_model=Jp)
403403

404404

405405
def CreateBernoulliString (Potential="Potential", scaling_variable="V_t", sign=-1):
@@ -416,7 +416,7 @@ def CreateBernoulliString (Potential="Potential", scaling_variable="V_t", sign=-
416416
'''
417417

418418
tdict = {
419-
"Potential" : Potential,
419+
"Potential" : Potential,
420420
"V_t" : scaling_variable
421421
}
422422
#### test for requisite models here
@@ -451,7 +451,7 @@ def CreateElectronCurrent(device, region, mu_n, Potential="Potential", sign=-1,
451451
raise NameError("Implement proper call")
452452

453453
tdict = {
454-
'Bern01' : Bern01,
454+
'Bern01' : Bern01,
455455
'vdiff' : vdiff,
456456
'mu_n' : mu_n,
457457
'V_t' : V_t
@@ -482,7 +482,7 @@ def CreateHoleCurrent(device, region, mu_p, Potential="Potential", sign=-1, Hole
482482
raise NameError("Implement proper call for " + Potential)
483483

484484
tdict = {
485-
'Bern01' : Bern01,
485+
'Bern01' : Bern01,
486486
'vdiff' : vdiff,
487487
'mu_p' : mu_p,
488488
'V_t' : V_t
@@ -500,11 +500,11 @@ def CreateAroraMobilityLF(device, region):
500500
Add T derivative dependence later
501501
'''
502502
models = (
503-
('Tn', 'T/300'),
503+
('Tn', 'T/300'),
504504
('mu_arora_n_node',
505-
'MUMN * pow(Tn, MUMEN) + (MU0N * pow(T, MU0EN))/(1 + pow((NTOT/(NREFN*pow(Tn, NREFNE))), ALPHA0N*pow(Tn, ALPHAEN)))'),
505+
'MUMN * pow(Tn, MUMEN) + (MU0N * pow(T, MU0EN))/(1 + pow((NTOT/(NREFN*pow(Tn, NREFNE))), ALPHA0N*pow(Tn, ALPHAEN)))'),
506506
('mu_arora_p_node',
507-
'MUMP * pow(Tn, MUMEP) + (MU0P * pow(T, MU0EP))/(1 + pow((NTOT/(NREFP*pow(Tn, NREFPE))), ALPHA0P*pow(Tn, ALPHAEP)))')
507+
'MUMP * pow(Tn, MUMEP) + (MU0P * pow(T, MU0EP))/(1 + pow((NTOT/(NREFP*pow(Tn, NREFPE))), ALPHA0P*pow(Tn, ALPHAEP)))')
508508
)
509509

510510
for k, v in models:
@@ -523,7 +523,7 @@ def CreateAroraMobilityLF(device, region):
523523
CreateElectronCurrent(device, region, mu_n = 'mu_arora_n_lf', Potential="EN", sign=1, ElectronCurrent="Jn_arora_lf", V_t="V_t_edge")
524524
CreateHoleCurrent(device, region, mu_p = 'mu_arora_p_lf', Potential="EP", sign=1, HoleCurrent="Jp_arora_lf", V_t="V_t_edge")
525525
return {
526-
'mu_n' : 'mu_arora_n_lf',
526+
'mu_n' : 'mu_arora_n_lf',
527527
'mu_p' : 'mu_arora_p_lf',
528528
'Jn' : 'Jn_arora_lf',
529529
'Jp' : 'Jp_arora_lf',
@@ -538,24 +538,24 @@ def CreateHFMobility(device, region, mu_n, mu_p, Jn, Jp):
538538
'''
539539

540540
tdict = {
541-
'Jn' : Jn,
541+
'Jn' : Jn,
542542
'mu_n' : mu_n,
543543
'Jp' : Jp,
544544
'mu_p' : mu_p
545545
}
546546
tlist = (
547-
("vsat_n", "VSATN0 * pow(T, VSATNE)" % tdict, ('T')),
547+
("vsat_n", "VSATN0 * pow(T, VSATNE)" % tdict, ('T')),
548548
("beta_n", "BETAN0 * pow(T, BETANE)" % tdict, ('T')),
549549
("Epar_n",
550-
"ifelse((%(Jn)s * EField) > 0, abs(EField), 1e-15)" % tdict, ('Potential')),
550+
"ifelse((%(Jn)s * EField) > 0, abs(EField), 1e-15)" % tdict, ('Potential')),
551551
("mu_n", "%(mu_n)s * pow(1 + pow((%(mu_n)s*Epar_n/vsat_n), beta_n), -1/beta_n)"
552-
% tdict, ('Electrons', 'Holes', 'Potential', 'T')),
552+
% tdict, ('Electrons', 'Holes', 'Potential', 'T')),
553553
("vsat_p", "VSATP0 * pow(T, VSATPE)" % tdict, ('T')),
554554
("beta_p", "BETAP0 * pow(T, BETAPE)" % tdict, ('T')),
555555
("Epar_p",
556-
"ifelse((%(Jp)s * EField) > 0, abs(EField), 1e-15)" % tdict, ('Potential')),
556+
"ifelse((%(Jp)s * EField) > 0, abs(EField), 1e-15)" % tdict, ('Potential')),
557557
("mu_p", "%(mu_p)s * pow(1 + pow(%(mu_p)s*Epar_p/vsat_p, beta_p), -1/beta_p)"
558-
% tdict, ('Electrons', 'Holes', 'Potential', 'T')),
558+
% tdict, ('Electrons', 'Holes', 'Potential', 'T')),
559559
)
560560

561561
variable_list = ('Electrons', 'Holes', 'Potential')
@@ -569,7 +569,7 @@ def CreateHFMobility(device, region, mu_n, mu_p, Jn, Jp):
569569
CreateElectronCurrent(device, region, mu_n='mu_n', Potential="Potential", sign=-1, ElectronCurrent="Jn", V_t="V_t_edge")
570570
CreateHoleCurrent( device, region, mu_p='mu_p', Potential="Potential", sign=-1, HoleCurrent="Jp", V_t="V_t_edge")
571571
return {
572-
'mu_n' : 'mu_n',
572+
'mu_n' : 'mu_n',
573573
'mu_p' : 'mu_p',
574574
'Jn' : 'Jn',
575575
'Jp' : 'Jp',
@@ -592,7 +592,7 @@ def CreateOxidePotentialOnly(device, region, update_type="default"):
592592
CreateEdgeModel(device, region, "PotentialEdgeFlux", dfield)
593593
CreateEdgeModelDerivatives(device, region, "PotentialEdgeFlux", dfield, "Potential")
594594
equation(device=device, region=region, name="PotentialEquation", variable_name="Potential",
595-
edge_model="PotentialEdgeFlux", variable_update=update_type)
595+
edge_model="PotentialEdgeFlux", variable_update=update_type)
596596

597597

598598
def CreateSiliconOxideInterface(device, interface):
@@ -618,7 +618,7 @@ def CreateOxideContact(device, region, contact):
618618
CreateEdgeModelDerivatives(device, region, contactcharge_edge, "Permittivity*EField", "Potential")
619619

620620
contact_equation(device=device , contact=contact, name="PotentialEquation", variable_name= "Potential",
621-
node_model=contact_model_name, edge_charge_model= contactcharge_edge)
621+
node_model=contact_model_name, edge_charge_model= contactcharge_edge)
622622

623623

624624

0 commit comments

Comments
 (0)