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

25 lines
561 B
Mathematica
Raw Normal View History

2024-01-28 16:46:36 +00:00
function [ed]=extract(edof,a)
% ed=extract(edof,a)
%-------------------------------------------------------------
% PURPOSE
% Extract element displacements from the global displacement
% vector according to the topology matrix edof.
%
% INPUT: a: the global displacement vector
%
% edof: topology matrix
%
% OUTPUT: ed: element displacement matrix
%-------------------------------------------------------------
[nie,n]=size(edof);
%
t=edof(:,2:n);
%
for i = 1:nie
ed(i,1:(n-1))=a(t(i,:))';
end
%--------------------------end--------------------------------