📄 set_inho.sci
字号:
function [mat,grp]=set_inho(srf,%simp,vtx,mat_ref,val)mat=[];grp=[];//function [mat,grp] = set_inho(srf,simp,vtx,mat_ref,val);// //Auxiliary functions used to set small local inhomogeneities //in a volume (graphically).// // // //srf = The boundary (surface) faces//simp = The simplices matrix//vtx = The vertices matrix//mat_ref = The reference conductivity vector//val = The value to be asigned to the selected inhomogeneity//mat = The conductivity vector (updated) that contains the inhomogeneity//grp = Subset of the simplices matrix. The tets that have been selected. //figure; //!! Unknown function trimesh ,the original calling sequence is usedtrimesh(srf,vtx(:,1),vtx(:,2),vtx(:,3)); //!! Unknown function axis ,the original calling sequence is usedaxis('image'); //!! Scilab set function is a partial emulation of the Matlab oneset(xget('window'),'Colormap',[0,0,0]); //!! Unknown function hidden ,the original calling sequence is usedhidden('off'); mat = mat_ref; shifter = 1; beg_wm = %simp(1,:); for dd = 1:size(%simp,1) if %simp(dd,:)~=beg_wm then shifter = shifter+1; end if %simp(dd,:)==beg_wm then shifter = dd-1; break ; endend cnts = []; for i = 1:size(srf,1) a = srf(i,1); b = srf(i,2); c = srf(i,3); ccnx = (vtx(a,1)+vtx(b,1)+vtx(c,1))/3; ccny = (vtx(a,2)+vtx(b,2)+vtx(c,2))/3; ccnz = (vtx(a,3)+vtx(b,3)+vtx(c,3))/3; ccn = [ccnx,ccny,ccnz]; cnts = [cnts;ccn];end //Number of inho disp('Click on the figure to locate the inhomogeneity');halt();sel = laserbeam(vtx,srf,cnts); //sel is the index of the triangular surface in the srf matrix//From that we extract the tet element. for rr = 1:size(%simp,1) //!! Unknown function ismember ,the original calling sequence is used if ismember(srf(sel,:),%simp(rr,:))==[1,1,1] then the_x = %simp(rr+shifter,:); break ; end end //!! Unknown function setdiff ,the original calling sequence is usedthe_nd = setdiff(the_x,srf(sel,:));//The forth node grp = [];Ssimp = []; for qq = 1:size(%simp,1) //!! Unknown function ismember ,the original calling sequence is used //! mtlb_sum(ismember(%simp(qq,:),the_nd)) may be replaced by //! sum(ismember(%simp(qq,:),the_nd)) if ismember(%simp(qq,:),the_nd)is a vector //! sum(ismember(%simp(qq,:),the_nd),1) if ismember(%simp(qq,:),the_nd)is a matrix if mtlb_sum(ismember(%simp(qq,:),the_nd))==1 then grp = [grp;%simp(qq+shifter,:)]; Ssimp = [Ssimp;qq+shifter]; //! mat = mtlb_i(mat,qq+shifter,val) may be replaced by mat(qq+shifter) = val //! if mat is not a vector //! or if mat and val are both row or column vectors mat = mtlb_i(mat,qq+shifter,val) endend for cc = 1:size(grp,1) this_x = grp(cc,:); mtlb_hold('on'); if val>mat_ref(Ssimp(cc)) then //Patching f_a Xas = vtx(this_x(1:3),1); Yas = vtx(this_x(1:3),2); Zas = vtx(this_x(1:3),3); //!! Unknown function patch ,the original calling sequence is used patch(Xas,Yas,Zas,'r','EdgeColor','none'); Xbs = vtx(this_x([1,2,4]),1); Ybs = vtx(this_x([1,2,4]),2); Zbs = vtx(this_x([1,2,4]),3); //!! Unknown function patch ,the original calling sequence is used patch(Xbs,Ybs,Zbs,'r','EdgeColor','none'); Xcs = vtx(this_x([1,3,4]),1); Ycs = vtx(this_x([1,3,4]),2); Zcs = vtx(this_x([1,3,4]),3); //!! Unknown function patch ,the original calling sequence is used patch(Xcs,Ycs,Zcs,'r','EdgeColor','none'); Xds = vtx(this_x(2:4),1); Yds = vtx(this_x(2:4),2); Zds = vtx(this_x(2:4),3); //!! Unknown function patch ,the original calling sequence is used patch(Xds,Yds,Zds,'r','EdgeColor','none'); end if val<mat_ref(Ssimp(cc)) then Xas = vtx(this_x(1:3),1); Yas = vtx(this_x(1:3),2); Zas = vtx(this_x(1:3),3); //!! Unknown function patch ,the original calling sequence is used patch(Xas,Yas,Zas,'b','EdgeColor','none'); Xbs = vtx(this_x([1,2,4]),1); Ybs = vtx(this_x([1,2,4]),2); Zbs = vtx(this_x([1,2,4]),3); //!! Unknown function patch ,the original calling sequence is used patch(Xbs,Ybs,Zbs,'b','EdgeColor','none'); Xcs = vtx(this_x([1,3,4]),1); Ycs = vtx(this_x([1,3,4]),2); Zcs = vtx(this_x([1,3,4]),3); //!! Unknown function patch ,the original calling sequence is used patch(Xcs,Ycs,Zcs,'b','EdgeColor','none'); Xds = vtx(this_x(2:4),1); Yds = vtx(this_x(2:4),2); Zds = vtx(this_x(2:4),3); //!! Unknown function patch ,the original calling sequence is used patch(Xds,Yds,Zds,'b','EdgeColor','none'); end end //!! Unknown function view ,the original calling sequence is usedview(3); //!! Unknown function camlight ,the original calling sequence is usedcamlight('right'); //!! Unknown function lighting ,the original calling sequence is usedlighting('flat'); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%// This is part of the EIDORS suite.// Copyright (c) N. Polydorides 2001// Copying permitted under terms of GNU GPL// See enclosed file gpl.html for details.// EIDORS 3D version 1.0// MATLAB version 5.3 R11//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -