FEM-Course-Matlab/3.1matlab矩形薄板小挠度弯曲有限元编程(边界条.../四边简支/assem.m

23 lines
635 B
Matlab

function [K]=assem(edof,K,Ke)
% K=assem(edof,K,Ke)
% [K]=assem(edof,K,Ke)
%-------------------------------------------------------------
% PURPOSE
% Assemble element matrices Ke into the global
% stiffness matrix K
% according to the topology matrix edof.
%
% INPUT: edof: dof topology matrix
% K : the global stiffness matrix
% Ke: element stiffness matrix
%
% OUTPUT: K : the new global stiffness matrix
%-------------------------------------------------------------
[nie,n]=size(edof);
t=edof(:,2:n);
for i = 1:nie
K(t(i,:),t(i,:)) = K(t(i,:),t(i,:))+Ke(:,:,i);
end
%--------------------------end--------------------------------