assem.m

来自「基于matlab的有限元程序源代码」· M 代码 · 共 35 行

M
35
字号
 function [K,f]=assem(edof,K,Ke,f,fe)% K=assem(edof,K,Ke)% [K,f]=assem(edof,K,Ke,f,fe)%-------------------------------------------------------------% PURPOSE%  Assemble element matrices Ke ( and fe ) into the global%  stiffness matrix K ( and the global force vector f )%  according to the topology matrix edof.%% INPUT: edof:       dof topology matrix%        K :         the global stiffness matrix%        Ke:         element stiffness matrix%        f :         the global force vector%        fe:         element force vector%% OUTPUT: K :        the new global stiffness matrix%         f :        the new global force vector%-------------------------------------------------------------% LAST MODIFIED: M Ristinmaa   1993-10-06% Copyright (c)  Division of Structural Mechanics and%                Department of Solid Mechanics.%                Lund Institute of Technology%-------------------------------------------------------------    [nie,n]=size(edof);    t=edof(:,2:n);    for i = 1:nie      K(t(i,:),t(i,:)) = K(t(i,:),t(i,:))+Ke;      if nargin==5         f(t(i,:))=f(t(i,:))+fe;      end    end%--------------------------end--------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?