FEM-Course-Matlab/10.四节点八节点四边形单元悬臂梁的Matlab有限元编程/8_nodes/AssembleEleStif.m

22 lines
697 B
Matlab
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function AssembleEleStif( ie, Ke ) % 3级å­<C3A5>ç¨åº<C3A5>,整体定ä½?
%% å<>•元刚度矩阵æ¼è£…
global Elements gKA
ENodes( : , 1 ) = Elements( ie , : );
enm = size( ENodes , 1 ); % å<>•å…ƒçš„ç»“ç¹æ?»æ•°
iLR = 2 * enm; % å<>•元的æ?»è‡ªç”±åº¦æ•?
viDof = zeros( 2 * enm , 1 ); % å<>„结ç¹è‡ªç”±åº¦ç¼å<E28093>·
for il=1:enm
inod = ENodes( il );
viDof( 2 * il-1 : 2 * il) = 2 * inod-1 : 2 * inod;
end
% æ¼è£…:ir为行å±?部ç¼å<E28093>?, irg为对应整体ç¼å<E28093>?
for ir = 1 : iLR
irg = viDof( ir );
% ic为列å±?部ç¼å<E28093>?, icg为对应整体ç¼å<E28093>?
for ic = 1 : iLR
icg = viDof( ic );
gKA( irg , icg ) = gKA( irg , icg ) + Ke( ir , ic );
end
end