Changeset 14800


Ignore:
Timestamp:
04/30/13 07:41:52 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: surface can be an argument of the function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/geometry/slope.m

    r13008 r14800  
    1 function [sx,sy,s]=slope(md)
     1function [sx,sy,s]=slope(md,surf)
    22%SLOPE - compute the surface slope
    33%
    44%   Usage:
    55%      [sx,sy,s]=slope(md)
     6%      [sx,sy,s]=slope(md,md.results.TransientSolution(1).Surface)
    67
    78%load some variables (it is much faster if the variab;es are loaded from md once for all)
     
    1819end
    1920
     21if nargin==1,
     22        surf=md.geometry.surface;
     23end
    2024%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
    2125[alpha beta]=GetNodalFunctionsCoeff(index,x,y);
    2226
    2327summation=[1;1;1];
    24 sx=(md.geometry.surface(index).*alpha)*summation;
    25 sy=(md.geometry.surface(index).*beta)*summation;
     28sx=(surf(index).*alpha)*summation;
     29sy=(surf(index).*beta)*summation;
    2630s=sqrt(sx.^2+sy.^2);
    2731
Note: See TracChangeset for help on using the changeset viewer.