1 function [odata,it,res] = DDGOXgummelmap (imesh,Dsides,...
2 Simesh,Sinodes,Sielements,SiDsides,...
3 idata,toll,maxit,ptoll,pmaxit,verbose)
5 % [odata,it,res] = DDGOXgummelmap (imesh,Dsides,...
6 % Simesh,Sinodes,Sielements,SiDsides,...
7 % idata,toll,maxit,ptoll,pmaxit,verbose)
10 % This file is part of
12 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
13 % -------------------------------------------------------------------
14 % Copyright (C) 2004-2006 Carlo de Falco
18 % SECS2D is free software; you can redistribute it and/or modify
19 % it under the terms of the GNU General Public License as published by
20 % the Free Software Foundation; either version 2 of the License, or
21 % (at your option) any later version.
23 % SECS2D is distributed in the hope that it will be useful,
24 % but WITHOUT ANY WARRANTY; without even the implied warranty of
25 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 % GNU General Public License for more details.
28 % You should have received a copy of the GNU General Public License
29 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
31 clear DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
32 global DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
38 RREpattern = URREcyclingpattern(RREnnit,RRErank,maxit);
41 Nnodes = max(size(imesh.p));
42 Nelements = max(size(imesh.t));
43 SiNnodes = max(size(Simesh.p));
44 SiNelements = max(size(Simesh.t));
57 % Set list of nodes with Dirichelet BCs
58 Dnodes = Unodesonside(imesh,Dsides);
60 % Set list of nodes with Dirichelet BCs
61 SiDnodes = Unodesonside(Simesh,SiDsides);
67 fprintf(1,'*****************************************************************\n');
68 fprintf(1,'**** start of gummel iteration number: %d\n',i);
69 fprintf(1,'*****************************************************************\n');
74 fprintf(1,'solving non linear poisson equation\n');
75 if ((i>1)&(verbose>1))
76 DDGOXplotresults(imesh,Simesh,n(:,1)*idata.ns,p(:,1)*idata.ns,V(:,1)*idata.Vs,...
77 Fn(:,1)*idata.Vs,Fp(:,1)*idata.Vs,i,nrm(end),'poisson');
83 [V(:,2),n(:,2),p(:,2)] =...
84 DDGOXnlpoisson (imesh,Dsides,Sinodes,SiDnodes,Sielements,...
85 V(:,1),n(:,1),p(:,1),Fn(:,1),Fp(:,1),D,...
86 idata.l2,idata.l2ox,ptoll,pmaxit,verbose-1);
87 V(Dnodes,2) = idata.V(Dnodes);
90 fprintf (1,'***\nupdating electron qfl\n');
91 if ((i>1)&(verbose>1))
92 DDGOXplotresults(imesh,Simesh,n(:,2)*idata.ns,p(:,2)*idata.ns,...
93 V(:,2)*idata.Vs,Fn(:,1)*idata.Vs,Fp(:,1)*idata.Vs,i,nrm(end),'e- continuity');
97 mob = Ufielddepmob(Simesh,idata.un,Fn(:,1),idata.vsatn,idata.mubn);
99 n(:,3) =DDGOXelectron_driftdiffusion(Simesh,SiDsides,n(:,2),p(:,2),...
101 idata.tn,idata.tp,idata.ni,idata.ni);
102 Fn(:,2)=V(Sinodes,2) - log(n(:,3));
103 n(SiDnodes,3) = idata.n(SiDnodes);
104 Fn(SiDnodes,2) = idata.Fn(SiDnodes);
106 %%%% store result for RRE
108 Fnstore(:,RREpattern(i)) = Fn(:,2);
109 if RREpattern(i+1)==0 % Apply RRE extrapolation
111 fprintf(1,'\n**********\nRRE EXTRAPOLATION STEP\n**********\n');
113 Fn(:,2) = Urrextrapolation(Fnstore);
118 fprintf(1,'***\nupdating hole qfl\n');
119 if ((i>1)&(verbose>1))
120 DDGOXplotresults(imesh,Simesh,n(:,3)*idata.ns,p(:,2)*idata.ns,V(:,2)*idata.Vs,...
121 Fn(:,2)*idata.Vs,Fp(:,1)*idata.Vs,i,nrm(end),'h+ continuity');
125 mob = Ufielddepmob(Simesh,idata.up,Fp(:,1),idata.vsatp,idata.mubp);
126 p(:,3) =DDGOXhole_driftdiffusion(Simesh,SiDsides,n(:,3),p(:,2),...
128 idata.tn,idata.tp,idata.ni,idata.ni);
129 Fp(:,2)= V(Sinodes,2) + log(p(:,3));
130 p(SiDnodes,3) = idata.p(SiDnodes);
131 Fp(SiDnodes,2) = idata.Fp(SiDnodes);
134 fprintf(1,'checking for convergence\n');
137 nrfn= norm(Fn(:,2)-Fn(:,1),inf);
138 nrfp= norm (Fp(:,2)-Fp(:,1),inf);
139 nrv = norm (V(:,2)-V(:,1),inf);
140 nrm(i) = max([nrfn;nrfp;nrv]);
149 fprintf (1,' max(|phin_(k+1)-phinn_(k)| ,...\n |phip_(k+1)-phip_(k)| ,...\n |v_(k+1)- v_(k)| )= %g\n',nrm(i));
168 fprintf(1,'\n***********\nDD simulation over:\n # of Gummel iterations = %d\n\n',it);
176 odata.Fn = Fn(:,end);
177 odata.Fp = Fp(:,end);