/usr/share/octave/packages/secs2d-0.0.8/ThDDGOX/ThDDGOXeletiteration.m is in octave-secs2d 0.0.8-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | function [odata,nrm]=ThDDGOXeletiteration(imesh,Dsides,...
Simesh,Sinodes,Sielements,SiDsides,...
idata,toll,maxit,ptoll,pmaxit,verbose)
## function [odata,nrm]=ThDDGOXeletiteration(imesh,Dsides,...
## Simesh,Sinodes,Sielements,SiDsides,areaSi,SiPatch,...
## idata,toll,maxit,ptoll,pmaxit,verbose)
global DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
%%%%%%%%%%%%%%%
%% RRE param %%
RREnnit = [1,2];
RRErank = 7;
RREpattern = URREcyclingpattern(RREnnit,RRErank,maxit);
%%%%%%%%%%%%%%%
odata = idata;
V(:,1) = idata.V;
Fn(:,1) = idata.Fn;
Fp(:,1) = idata.Fp;
n(:,1) = idata.n;
p(:,1) = idata.p;
Tl = idata.Tl;
Tn = idata.Tn;
Tp = idata.Tp;
%% Set list of nodes with Dirichlet BCs
Dnodes = Unodesonside(imesh,Dsides);
SiDnodes = Unodesonside(Simesh,SiDsides);
SiNelements = columns(Simesh.t);
D = idata.D;
nrm = 1;
for ielet=1:maxit
if (verbose>=1)
fprintf(1,"*** start of inner iteration number: %d\n",ielet);
end
if (verbose>=1)
fprintf(1,"\t*** solving non linear poisson equation\n");
end
Fnshift = log(idata.ni) .* (1-Tn);
Fpshift = -log(idata.ni) .* (1-Tp);
[V(:,2),n(:,2),p(:,2)] = ThDDGOXnlpoisson (imesh,Dsides,Sinodes,SiDnodes,Sielements,...
V(:,1),Tn,Tp,...
n(:,1),p(:,1),Fn(:,1)+Fnshift,Fp(:,1)+Fpshift,D,...
idata.l2,idata.l2ox,ptoll,pmaxit,verbose-1);
V(Dnodes,2) = idata.V(Dnodes);
if (verbose>=1)
fprintf (1,"\t***\tupdating electron qfl\n");
end
odata.V = V(:,2);
odata.n = n(:,2);
odata.p = p(:,2);
mobn0 = idata.mobn0(imesh,Simesh,Sinodes,Sielements,odata);
mobp0 = idata.mobp0(imesh,Simesh,Sinodes,Sielements,odata);
mobn1 = idata.mobn1(imesh,Simesh,Sinodes,Sielements,odata);
mobp1 = idata.mobp1(imesh,Simesh,Sinodes,Sielements,odata);
n(:,3) = ThDDGOXelectron_driftdiffusion(Simesh,SiDnodes,n(:,2),p(:,2),...
V(Sinodes,2),Tn,mobn0,mobn1,...
idata.tn,idata.tp,idata.ni,idata.ni);
Fn(:,2)=V(Sinodes,2) - Tn .* log(n(:,3)) - Fnshift;
n(SiDnodes,3) = idata.n(SiDnodes);
Fn(SiDnodes,2) = idata.Fn(SiDnodes);
if (verbose>=1)
fprintf(1,"\t***\tupdating hole qfl\n");
end
p(:,3) = ThDDGOXhole_driftdiffusion(Simesh,SiDnodes,n(:,3),p(:,2),...
V(Sinodes,2),Tp,mobp0,mobp1,...
idata.tn,idata.tp,idata.ni,idata.ni);
Fp(:,2)= V(Sinodes,2) + Tp .* log(p(:,3)) - Fpshift;
p(SiDnodes,3) = idata.p(SiDnodes);
Fp(SiDnodes,2) = idata.Fp(SiDnodes);
## store result for RRE
if RREpattern(ielet)>0
Fermistore(:,RREpattern(ielet)) = [Fn(:,2);Fp(:,2)];
if RREpattern(ielet+1)==0 % Apply RRE extrapolation
if (verbose>=1)
fprintf(1,"\n\t**********\n\tRRE EXTRAPOLATION STEP\n\t**********\n\n");
end
Fermi = Urrextrapolation(Fermistore);
Fn(:,2) = Fermi(1:rows(Fn));
Fp(:,2) = Fermi(rows(Fn)+1:end);
end
end
if (verbose>=1)
fprintf(1,"*** checking for convergence: ");
end
nrfn= norm (Fn(:,2)-Fn(:,1),inf);
nrfp= norm (Fp(:,2)-Fp(:,1),inf);
nrv = norm (V(:,2)-V(:,1),inf);
nrm(ielet) = max([nrfn;nrfp;nrv]);
if (verbose>=1)
subplot(1,3,3);
semilogy(nrm)
%%title("max(|dV|,|dFn|,|dFp|)");
pause(.1)
end
if (verbose>=1)
fprintf (1," max(|dFn|,|dFp|,|dV| )= %g\n\n",...
nrm(ielet));
end
if (nrm(ielet)<toll)
break
end
V(:,1) = V(:,2);
n(:,1) = n(:,3);
p(:,1) = p(:,3);
Fn(:,1)= Fn(:,2);
Fp(:,1)= Fp(:,2);
end
if (verbose>0)
fprintf(1,"\n*** DD simulation over: # of electrical Gummel iterations = %d\n\n",ielet);
end
odata = idata;
odata.n = n(:,end);
odata.p = p(:,end);
odata.V = V(:,end);
odata.Fn = Fn(:,end);
odata.Fp = Fp(:,end);
|