| MESH toolbox 0.1 Matlab/Octave mesh utils

- Main Page
- Related Pages
- Modules
- Files

- File List
- File Members

All Files Functions Groups Pages
BuildMeshP2.m
Go to the documentation of this file.
1 function [qf,mef]=BuildMeshP2(Th,e2q,e2t,e2n)
2 % Numerotation globale
3 qf=[Th.q (Th.q(:,e2q(:,1))+Th.q(:,e2q(:,2)))/2];
4
5 ned=length(e2q);
6
7 % Code vectorisé
8 me1=zeros(3,Th.nme);
9 %me1(1:3,:)=Th.me;
10 %me1=Th.me;
11 L=[1:ned]+Th.nq;
12 me1(3*(e2t(:,1)-1)+e2n(:,1))=L;
13 I=3*(e2t(:,2)-1)+e2n(:,2);
14 K=find(I~=-3);
15 me1(I(K))=L(K);
16
17 mef([1,3,6,2,5,4],:)=[Th.me;me1];
18
19 % Code non vectorisé
20 % mef=zeros(3,Th.nme);
21 % for l=1:ned
22 % mef(e2n(l,1),e2t(l,1))=Th.nq+l;
23 % if (e2t(l,2) ~= 0 )
24 % mef(e2n(l,2),e2t(l,2))=Th.nq+l;
25 % end
26 % end