1 function [omesh,onodes,oelements]=Usubmesh(imesh,intrfc,sdl,short)
4 # [omesh,onodes,oelements]=Usubmesh(imesh,intrfc,sdl,short)
6 # builds the mesh structure for
10 # NOTE: the intrfc parameter is unused and only kept
15 % This file is part of
17 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
18 % -------------------------------------------------------------------
19 % Copyright (C) 2004-2006 Carlo de Falco
23 % SECS2D is free software; you can redistribute it and/or modify
24 % it under the terms of the GNU General Public License as published by
25 % the Free Software Foundation; either version 2 of the License, or
26 % (at your option) any later version.
28 % SECS2D is distributed in the hope that it will be useful,
29 % but WITHOUT ANY WARRANTY; without even the implied warranty of
30 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 % GNU General Public License for more details.
33 % You should have received a copy of the GNU General Public License
34 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
43 # the shp field will remain unchanged
45 omesh.shp = imesh.shp;
49 # set list of output triangles
52 oelements = [oelements find(imesh.t(4,:)==sdl(isd))];
55 omesh.t = imesh.t(:,oelements);
58 # discard unneeded part of shg and wjacdet
60 omesh.shg= imesh.shg(:,:,oelements);
61 omesh.wjacdet = imesh.wjacdet(:,oelements);
65 # set list of output nodes
66 onodes = unique(reshape(imesh.t(1:3,oelements),1,[]));
67 omesh.p = imesh.p(:,onodes);
71 # use new node numbering in connectivity matrix
72 indx(onodes) = [1:length(onodes)];
73 iel = [1:length(oelements)];
74 omesh.t(1:3,iel) = indx(omesh.t(1:3,iel));
77 # set list of output edges
80 omesh.e = [omesh.e imesh.e(:,imesh.e(7,:)==sdl(isd))];
81 omesh.e = [omesh.e imesh.e(:,imesh.e(6,:)==sdl(isd))];
83 omesh.e=unique(omesh.e',"rows")';
86 # use new node numbering in boundary segment list
87 ied = [1:size(omesh.e,2)];
88 omesh.e(1:2,ied) = indx(omesh.e(1:2,ied));
92 % $Date: 2008-02-04 16:26:27 +0100 (man, 04 feb 2008) $