/usr/share/octave/packages/secs2d-0.0.8/DDGOX/DDGOXgummelmap.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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | function [odata,it,res] = DDGOXgummelmap (imesh,Dsides,...
Simesh,Sinodes,Sielements,SiDsides,...
idata,toll,maxit,ptoll,pmaxit,verbose)
% [odata,it,res] = DDGOXgummelmap (imesh,Dsides,...
% Simesh,Sinodes,Sielements,SiDsides,...
% idata,toll,maxit,ptoll,pmaxit,verbose)
%
% This file is part of
%
% SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
% -------------------------------------------------------------------
% Copyright (C) 2004-2006 Carlo de Falco
%
%
%
% SECS2D is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% SECS2D is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
clear DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
global DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
%%%%%%%%%%%%%%%
%% RRE param %%
RREnnit = [1,0];
RRErank = 5;
RREpattern = URREcyclingpattern(RREnnit,RRErank,maxit);
%%%%%%%%%%%%%%%
Nnodes = max(size(imesh.p));
Nelements = max(size(imesh.t));
SiNnodes = max(size(Simesh.p));
SiNelements = max(size(Simesh.t));
V (:,1) = idata.V;
p (:,1) = idata.p;
n (:,1) = idata.n;
Fn(:,1) = idata.Fn;
Fp(:,1) = idata.Fp;
D = idata.D;
% Set list of nodes with Dirichelet BCs
Dnodes = Unodesonside(imesh,Dsides);
% Set list of nodes with Dirichelet BCs
SiDnodes = Unodesonside(Simesh,SiDsides);
nrm = 1;
for i=1:1:maxit
if (verbose>=1)
fprintf(1,'*****************************************************************\n');
fprintf(1,'**** start of gummel iteration number: %d\n',i);
fprintf(1,'*****************************************************************\n');
end
if (verbose>=1)
fprintf(1,'solving non linear poisson equation\n');
if ((i>1)&(verbose>1))
DDGOXplotresults(imesh,Simesh,n(:,1)*idata.ns,p(:,1)*idata.ns,V(:,1)*idata.Vs,...
Fn(:,1)*idata.Vs,Fp(:,1)*idata.Vs,i,nrm(end),'poisson');
end
end
[V(:,2),n(:,2),p(:,2)] =...
DDGOXnlpoisson (imesh,Dsides,Sinodes,SiDnodes,Sielements,...
V(:,1),n(:,1),p(:,1),Fn(:,1),Fp(:,1),D,...
idata.l2,idata.l2ox,ptoll,pmaxit,verbose-1);
V(Dnodes,2) = idata.V(Dnodes);
if (verbose>=1)
fprintf (1,'***\nupdating electron qfl\n');
if ((i>1)&(verbose>1))
DDGOXplotresults(imesh,Simesh,n(:,2)*idata.ns,p(:,2)*idata.ns,...
V(:,2)*idata.Vs,Fn(:,1)*idata.Vs,Fp(:,1)*idata.Vs,i,nrm(end),'e- continuity');
end
end
mob = Ufielddepmob(Simesh,idata.un,Fn(:,1),idata.vsatn,idata.mubn);
n(:,3) =DDGOXelectron_driftdiffusion(Simesh,SiDsides,n(:,2),p(:,2),...
V(Sinodes,2),mob,...
idata.tn,idata.tp,idata.ni,idata.ni);
Fn(:,2)=V(Sinodes,2) - log(n(:,3));
n(SiDnodes,3) = idata.n(SiDnodes);
Fn(SiDnodes,2) = idata.Fn(SiDnodes);
%%%% store result for RRE
if RREpattern(i)>0
Fnstore(:,RREpattern(i)) = Fn(:,2);
if RREpattern(i+1)==0 % Apply RRE extrapolation
if (verbose>=1)
fprintf(1,'\n**********\nRRE EXTRAPOLATION STEP\n**********\n');
end
Fn(:,2) = Urrextrapolation(Fnstore);
end
end
if (verbose>=1)
fprintf(1,'***\nupdating hole qfl\n');
if ((i>1)&(verbose>1))
DDGOXplotresults(imesh,Simesh,n(:,3)*idata.ns,p(:,2)*idata.ns,V(:,2)*idata.Vs,...
Fn(:,2)*idata.Vs,Fp(:,1)*idata.Vs,i,nrm(end),'h+ continuity');
end
end
mob = Ufielddepmob(Simesh,idata.up,Fp(:,1),idata.vsatp,idata.mubp);
p(:,3) =DDGOXhole_driftdiffusion(Simesh,SiDsides,n(:,3),p(:,2),...
V(Sinodes,2),mob,...
idata.tn,idata.tp,idata.ni,idata.ni);
Fp(:,2)= V(Sinodes,2) + log(p(:,3));
p(SiDnodes,3) = idata.p(SiDnodes);
Fp(SiDnodes,2) = idata.Fp(SiDnodes);
if (verbose>=1)
fprintf(1,'checking for convergence\n');
end
nrfn= norm(Fn(:,2)-Fn(:,1),inf);
nrfp= norm (Fp(:,2)-Fp(:,1),inf);
nrv = norm (V(:,2)-V(:,1),inf);
nrm(i) = max([nrfn;nrfp;nrv]);
if (verbose>1)
figure(2);
semilogy(nrm)
pause(.1)
end
if (verbose>=1)
fprintf (1,' max(|phin_(k+1)-phinn_(k)| ,...\n |phip_(k+1)-phip_(k)| ,...\n |v_(k+1)- v_(k)| )= %g\n',nrm(i));
end
if (nrm(i)<toll)
break
end
V(:,1) = V(:,end);
n(:,1) = n(:,end);
p(:,1) = p(:,end);
Fn(:,1)= Fn(:,end);
Fp(:,1)= Fp(:,end);
end
it = i;
res = nrm;
if (verbose>0)
fprintf(1,'\n***********\nDD simulation over:\n # of Gummel iterations = %d\n\n',it);
end
odata = idata;
odata.n = n(:,end);
odata.p = p(:,end);
odata.V = V(:,end);
odata.Fn = Fn(:,end);
odata.Fp = Fp(:,end);
|