REORDER Reordering of the array of nodes of extended element. Lexicographic ordering is performed [p]=reorder(xyl,nex,ney); Input : xyl = nodes of the extended element nex = number of Q1 elements of the extended macro element, alobng x-direction ney = number of Q1 elements of the extended macro element, alobng y-direction Output : p = reordering array of nodes
0001 function [p]=reorder(xyl,nex,ney); 0002 % REORDER Reordering of the array of nodes of extended element. 0003 % Lexicographic ordering is performed 0004 % 0005 % [p]=reorder(xyl,nex,ney); 0006 % 0007 % Input : xyl = nodes of the extended element 0008 % nex = number of Q1 elements of the extended macro element, 0009 % alobng x-direction 0010 % ney = number of Q1 elements of the extended macro element, 0011 % alobng y-direction 0012 % 0013 % Output : p = reordering array of nodes 0014 0015 % Written by Paola Gervasio 0016 % $Date: 2007/04/01$ 0017 0018 npx=nex+1;npy=ney+1; 0019 noe=npx*npy; 0020 0021 ctx=sort(xyl(:,1)); 0022 ctx=ctx(1:npy:noe); 0023 cty=sort(xyl(:,2)); 0024 cty=cty(1:npx:noe); 0025 for i=1:npx 0026 for j=1:npy 0027 k=(j-1)*npx+i; 0028 trov=0; 0029 k1=0; 0030 while k1<=noe & trov==0 0031 k1=k1+1; 0032 if(ctx(i)==xyl(k1,1) & cty(j)==xyl(k1,2)) 0033 p(k)=k1;trov=1; 0034 end 0035 end 0036 end 0037 end 0038