0001
0002
0003
0004
0005
0006
0007
0008 row_location=zeros(nel*3*3,1);
0009 col_location=zeros(nel*3*3,1);
0010 value=zeros(nel*3*3,1);
0011 right_hand_side=zeros(nel*3*3,1);
0012 col_elements=zeros(nel*3*3,1);
0013 epsilon=1;
0014 count=-nel+1;
0015 for j=1:3
0016 for i=1:3
0017 count=count+nel;
0018 row_location(count:count+nel-1)=index(:,i);
0019 col_location(count:count+nel-1)=index(:,j);
0020 col_elements(count:count+nel-1)=[1:nel]';
0021 value(count:count+nel-1)=area.*(alpha(:,i).*alpha(:,j)*epsilon ...
0022 + beta(:,i).*beta(:,j)*epsilon ...
0023 +( (i==j)/6 + (i~=j)/12 ) );
0024 right_hand_side(count:count+nel-1)=area/9;
0025 end
0026 end
0027 el2nod=sparse(row_location,col_location,value,nods,nods);
0028 el2nodRhs=sparse(row_location,col_elements,right_hand_side,nods,nel);