accumulatematrix.m
来自「五点差分型多重网格方法:各种插值算子的比较)」· M 代码 · 共 20 行
M
20 行
function KK = AccumulateMatrix(Ae,ia)
% Accumulates the f.e. matrices to a global f.e. matrix
% INPUT:
% element matrices Ae[loc,loc,nelem],
% element connectivity ia[loc,nelem] for local to global node numbering.
% The node numbering starts with 1 (Fortran style).
%
nnode = max(max(ia)); % number of nodes
KK = zeros(nnode,nnode);
for i=1:size(Ae,3)
for k=1:size(Ae(:,:,i),1)
ik = ia(k,i);
for l=1:size(Ae(:,:,i),2)
il = ia(l,i);
KK(ik,il) = KK(ik,il) + Ae(k,l,i);
end;
end;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?