0001 function [xxA] = vb_calc_patch_area(V,F3,xxT)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 tic;
0013 vb_disp_nonl('Patch area: ');
0014
0015 Npatch = size(F3,1);
0016 Ndipole = size(V,1);
0017 FA = zeros(Npatch,1);
0018
0019 for i=1:Npatch,
0020 xpl = vb_cross2(V(F3(i,2),:)-V(F3(i,1),:), V(F3(i,3),:)-V(F3(i,1),:));
0021 FA(i) = sqrt(xpl*xpl')/2;
0022 end
0023
0024 ix = find(FA<eps);
0025
0026 if ~isempty(ix),
0027 vb_disp('!! There are some abnormal areas ');
0028 FA(ix)=0;
0029 end
0030
0031 vb_disp_nonl(sprintf('%f[sec]\n',toc));
0032
0033
0034
0035
0036 tic;
0037 vb_disp_nonl('Allocate triangle area to each vertex: ');
0038
0039 xxA=zeros(Ndipole,1);
0040
0041 for i=1:Ndipole,
0042 rix = xxT{i};
0043 xxA(i) = sum(FA(rix))/3;
0044
0045 end
0046