1 function [jx,jy]=Ufvsgcurrent(omesh,n,psi,psith,coeffe);
3 % [jx,jy]=Udrawcurrent(omesh,n,psi,psith,coeffe);
7 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
8 % -------------------------------------------------------------------
9 % Copyright (C) 2004-2006 Carlo de Falco
13 % SECS2D is free software; you can redistribute it and/or modify
14 % it under the terms of the GNU General Public License as published by
15 % the Free Software Foundation; either version 2 of the License, or
16 % (at your option) any later version.
18 % SECS2D is distributed in the hope that it will be useful,
19 % but WITHOUT ANY WARRANTY; without even the implied warranty of
20 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 % GNU General Public License for more details.
23 % You should have received a copy of the GNU General Public License
24 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
26 Nelem = size(omesh.t,2);
27 jx = NaN*ones(Nelem,1);
32 K = sum(omesh.wjacdet(:,iel));
34 dpsi1 = psi(omesh.t(3,iel))-psi(omesh.t(2,iel));
35 dvth1 = psith(omesh.t(3,iel))-psith(omesh.t(2,iel));
36 vthm1 = Utemplogm(psith(omesh.t(3,iel)),psith(omesh.t(2,iel)));
37 [bp,bn] = Ubern((dpsi1-dvth1)/vthm1);
38 t1 = omesh.p(:,omesh.t(3,iel))-omesh.p(:,omesh.t(2,iel));
41 j1 = vthm1*(coeffe(iel)/l1) * ( n(omesh.t(3,iel)) * bp - ...
42 n(omesh.t(2,iel)) * bn) * t1;
44 gg1= omesh.shg(:,2,iel)'*omesh.shg(:,3,iel)*l1^2;
46 dpsi2 = psi(omesh.t(1,iel))-psi(omesh.t(3,iel));
47 dvth2 = psith(omesh.t(1,iel))-psith(omesh.t(3,iel));
48 vthm2 = Utemplogm(psith(omesh.t(1,iel)),psith(omesh.t(3,iel)));
49 [bp,bn] = Ubern((dpsi2-dvth2)/vthm2);
50 t2 = omesh.p(:,omesh.t(1,iel))-omesh.p(:,omesh.t(3,iel));
53 j2 = vthm2*(coeffe(iel)/l2) * ( n(omesh.t(1,iel)) * bp - ...
54 n(omesh.t(3,iel)) * bn) * t2;
56 gg2= omesh.shg(:,1,iel)'*omesh.shg(:,3,iel)*l2^2;
58 dpsi3 = psi(omesh.t(2,iel))-psi(omesh.t(1,iel));
59 dvth3 = psith(omesh.t(2,iel))-psith(omesh.t(1,iel));
60 vthm3 = Utemplogm(psith(omesh.t(2,iel)),psith(omesh.t(1,iel)));
61 [bp,bn] = Ubern((dpsi3-dvth3)/vthm3);
62 t3 = omesh.p(:,omesh.t(2,iel))-omesh.p(:,omesh.t(1,iel));
65 j3 = vthm3*(coeffe(iel)/l3) * ( n(omesh.t(2,iel)) * bp - ...
66 n(omesh.t(1,iel)) * bn) * t3;
68 gg3= omesh.shg(:,2,iel)'*omesh.shg(:,1,iel)*l3^2;
70 Jk = j1*gg1+j2*gg2+j3*gg3;