NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/matlab_cen/area.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 %
2 % Determine nn and ne
3 %
4 size(x);
5 nn=ans(1);
6 size(in);
7 ne=ans(1);
8 %
9 % Elemental areas
10 %
11 for nele=1:ne
12    i1=in(nele,1);
13    i2=in(nele,2);
14    i3=in(nele,3);
15    dy1=y(i2)-y(i3);
16    dy2=y(i3)-y(i1);
17    dy3=y(i1)-y(i2);
18    areae(nele)=0.5*(x(i1)*dy1+x(i2)*dy2+x(i3)*dy3);
19    xe(nele)=(x(i1)+x(i2)+x(i3))/3.0;
20    ye(nele)=(y(i1)+y(i2)+y(i3))/3.0;
21    ze(nele)=(z(i1)+z(i2)+z(i3))/3.0;
22 end
23 %
24 % Elemental deltax
25 %
26 dxele=sqrt(2.0*areae);
27 %
28 % Nodal areas
29 %
30 for i=1:nn
31    arean(i)=0.0;
32 end
33 for nele=1:ne
34    i1=in(nele,1);
35    i2=in(nele,2);
36    i3=in(nele,3);
37    arean(i1)=arean(i1)+areae(nele)/3.0;
38    arean(i2)=arean(i2)+areae(nele)/3.0;
39    arean(i3)=arean(i3)+areae(nele)/3.0;
40 end
41 %
42 % Nodal deltax
43 %
44 dxnod=sqrt(2.0*arean);
45 dxnod=dxnod';
Note: See TracBrowser for help on using the browser.