1 function [odata,it,res] = DDGOXTgummelmap (imesh,Dsides,...
2 Simesh,Sinodes,Sielements,SiDsides,...
3 idata,nold,pold,weight,toll,maxit,ptoll,...
6 # function [odata,it,res] = DDGOXTgummelmap (imesh,Dsides,...
7 # Simesh,Sinodes,Sielements,SiDsides,...
8 # idata,oldn,oldp,weight,toll,maxit,ptoll,...
11 % This file is part of
13 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
14 % -------------------------------------------------------------------
15 % Copyright (C) 2004-2006 Carlo de Falco
19 % SECS2D is free software; you can redistribute it and/or modify
20 % it under the terms of the GNU General Public License as published by
21 % the Free Software Foundation; either version 2 of the License, or
22 % (at your option) any later version.
24 % SECS2D is distributed in the hope that it will be useful,
25 % but WITHOUT ANY WARRANTY; without even the implied warranty of
26 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 % GNU General Public License for more details.
29 % You should have received a copy of the GNU General Public License
30 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
32 clear DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
33 global DDGOXNLPOISSON_LAP DDGOXNLPOISSON_MASS DDGOXNLPOISSON_RHS DDG_RHS DDG_MASS
39 RREpattern = URREcyclingpattern(RREnnit,RRErank,maxit);
42 Nnodes = max(size(imesh.p));
43 Nelements = max(size(imesh.t));
44 SiNnodes = max(size(Simesh.p));
45 SiNelements = max(size(Simesh.t));
58 % Set list of nodes with Dirichelet BCs
59 Dnodes = Unodesonside(imesh,Dsides);
61 % Set list of nodes with Dirichelet BCs
62 SiDnodes = Unodesonside(Simesh,SiDsides);
68 fprintf(1,'*****************************************************************\n');
69 fprintf(1,'**** start of gummel iteration number: %d\n',i);
70 fprintf(1,'*****************************************************************\n');
75 fprintf(1,'solving non linear poisson equation\n');
80 [V(:,2),n(:,2),p(:,2)] =...
81 DDGOXnlpoisson (imesh,Dsides,Sinodes,SiDnodes,Sielements,...
82 V(:,1),n(:,1),p(:,1),Fn(:,1),Fp(:,1),D,...
83 idata.l2,idata.l2ox,ptoll,pmaxit,verbose-1);
84 V(Dnodes,2) = idata.V(Dnodes);
87 fprintf (1,'***\nupdating electron qfl\n');
90 mob = Ufielddepmob(Simesh,idata.un,Fn(:,1),idata.vsatn,idata.mubn);
92 n(:,3) =DDGOXTelectron_driftdiffusion(Simesh,SiDsides,[n(:,2),nold],[p(:,2),pold],...
94 idata.tn,idata.tp,idata.ni,idata.ni,weight);
95 Fn(:,2)=V(Sinodes,2) - log(n(:,3));
96 n(SiDnodes,3) = idata.n(SiDnodes);
97 Fn(SiDnodes,2) = idata.Fn(SiDnodes);
99 %%%% store result for RRE
101 Fnstore(:,RREpattern(i)) = Fn(:,2);
102 if RREpattern(i+1)==0 % Apply RRE extrapolation
104 fprintf(1,'\n**********\nRRE EXTRAPOLATION STEP\n**********\n');
106 Fn(:,2) = Urrextrapolation(Fnstore);
111 fprintf(1,'***\nupdating hole qfl\n');
114 mob = Ufielddepmob(Simesh,idata.up,Fp(:,1),idata.vsatp,idata.mubp);
116 p(:,3) =DDGOXThole_driftdiffusion(Simesh,SiDsides,[n(:,3),nold],[p(:,2),pold],...
118 idata.tn,idata.tp,idata.ni,idata.ni,weight);
120 Fp(:,2)= V(Sinodes,2) + log(p(:,3));
121 p(SiDnodes,3) = idata.p(SiDnodes);
122 Fp(SiDnodes,2) = idata.Fp(SiDnodes);
125 fprintf(1,'checking for convergence\n');
128 nrfn= norm(Fn(:,2)-Fn(:,1),inf);
129 nrfp= norm (Fp(:,2)-Fp(:,1),inf);
130 nrv = norm (V(:,2)-V(:,1),inf);
131 nrm(i) = max([nrfn;nrfp;nrv]);
134 fprintf (1,' max(|phin_(k+1)-phinn_(k)| ,...\n |phip_(k+1)-phip_(k)| ,...\n |v_(k+1)- v_(k)| )= %g\n',nrm(i));
153 fprintf(1,'\n***********\nDD simulation over:\n # of Gummel iterations = %d\n\n',it);
161 odata.Fn = Fn(:,end);
162 odata.Fp = Fp(:,end);