


SHAPE - compute nodal functions coefficients and triangle area
this routine calculates the coefficients of all the nodal functions and the area of each
element with:
o N(x,y)=alpha*x+beta*y+gama
Usage:
[alpha,beta,gamma,area]=shape(index,x,y,nel,nods)

0001 function [alpha,beta,gamma,area]=shape(index,x,y,nel,nods) 0002 %SHAPE - compute nodal functions coefficients and triangle area 0003 % 0004 % this routine calculates the coefficients of all the nodal functions and the area of each 0005 % element with: 0006 % o N(x,y)=alpha*x+beta*y+gama 0007 % 0008 % Usage: 0009 % [alpha,beta,gamma,area]=shape(index,x,y,nel,nods) 0010 0011 alpha=zeros(nel,3); beta=zeros(nel,3); 0012 gamma=zeros(nel,3); area=zeros(nel,1); 0013 for n=1:nel 0014 X=inv([x(index(n,:)) y(index(n,:)) ones(3,1)]); 0015 alpha(n,:)=X(1,:); 0016 beta(n,:)=X(2,:); 0017 gamma(n,:)=X(3,:); 0018 area(n)=1/2 * det([1 1 1;x(index(n,:))';y(index(n,:))']); 0019 end 0020 clear X; 0021 area=abs(area);