1 function [current,divrg]=ThDDGOXddcurrent(Simesh,Sinodes,data,contacts);
3 % [current,divrg]=DDGOXddcurrent(Simesh,Sinodes,data,contacts);
8 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
9 % -------------------------------------------------------------------
10 % Copyright (C) 2004-2006 Carlo de Falco
14 % SECS2D is free software; you can redistribute it and/or modify
15 % it under the terms of the GNU General Public License as published by
16 % the Free Software Foundation; either version 2 of the License, or
17 % (at your option) any later version.
19 % SECS2D is distributed in the hope that it will be useful,
20 % but WITHOUT ANY WARRANTY; without even the implied warranty of
21 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 % GNU General Public License for more details.
24 % You should have received a copy of the GNU General Public License
25 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
27 load (file_in_path(path,'constants.mat'))
30 Nelements = size(mesh.t,2);
31 mobn0 = thermdata.mobn0([],Simesh,Sinodes,[],data);
32 mobp0 = thermdata.mobp0([],Simesh,Sinodes,[],data);
33 mobn1 = thermdata.mobn1([],Simesh,Sinodes,[],data);
34 mobp1 = thermdata.mobp1([],Simesh,Sinodes,[],data);
35 An = Uscharfettergummel3(Simesh,mobn0,mobn1,data.Tn,data.V(Sinodes)-data.Tn);
36 Ap = Uscharfettergummel3(Simesh,mobp0,mobp1,data.Tp,-data.V(Sinodes)-data.Tn);
37 divrg = An * data.n + Ap * data.p;
39 for con = 1:length(contacts)
42 cedges=[cedges,find(mesh.e(5,:)==contacts(con))];
43 cnodes = mesh.e(1:2,cedges);
44 cnodes = [cnodes(1,:) cnodes(2,:)];
45 cnodes = unique(cnodes);
47 current(con) = sum(divrg(cnodes));
51 Is = q*data.us*data.Vs*data.ns;
52 current = current * Is;