Rev | Line | |
---|
[1] | 1 | function [sx,sy,s]=slope(md)
|
---|
| 2 | %SLOPE - compute the surface slope
|
---|
| 3 | %
|
---|
| 4 | % Usage:
|
---|
| 5 | % [sx,sy,s]=slope(md)
|
---|
| 6 |
|
---|
| 7 | %load some variables (it is much faster if the variab;es are loaded from md once for all)
|
---|
[9719] | 8 | if (md.mesh.dimension==2),
|
---|
[9725] | 9 | numberofelements=md.mesh.numberofelements;
|
---|
| 10 | numberofnodes=md.mesh.numberofvertices;
|
---|
[9733] | 11 | index=md.mesh.elements;
|
---|
[9451] | 12 | x=md.x; y=md.y;
|
---|
[1] | 13 | else
|
---|
[9725] | 14 | numberofelements=md.mesh.numberofelements2d;
|
---|
| 15 | numberofnodes=md.mesh.numberofvertices2d;
|
---|
[9731] | 16 | index=md.mesh.elements2d;
|
---|
| 17 | x=md.mesh.x2d; y=md.mesh.y2d;
|
---|
[1] | 18 | end
|
---|
| 19 |
|
---|
| 20 | %compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
|
---|
[1236] | 21 | [alpha beta]=GetNodalFunctionsCoeff(index,x,y);
|
---|
[1] | 22 |
|
---|
| 23 | summation=[1;1;1];
|
---|
[9691] | 24 | sx=(md.geometry.surface(index).*alpha)*summation;
|
---|
| 25 | sy=(md.geometry.surface(index).*beta)*summation;
|
---|
[1] | 26 | s=sqrt(sx.^2+sy.^2);
|
---|
| 27 |
|
---|
[9719] | 28 | if md.mesh.dimension==3,
|
---|
[1] | 29 | sx=project3d(md,sx,'element');
|
---|
| 30 | sy=project3d(md,sy,'element');
|
---|
| 31 | s=sqrt(sx.^2+sy.^2);
|
---|
| 32 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.