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

22 lines
677 B
Matlab
Raw Blame History

This file contains ambiguous Unicode characters

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 PlotResults2(Nodes,Elements,gNTu,SF) % 2级子程序结果显示
figure
% global gNdt gElt gNTu
%调整单元标号顺序
gElt_plot = zeros(size(Elements,1),size(Elements,2));
for i = 1:1:4
gElt_plot(:,2*i-1) = Elements(:,i);
gElt_plot(:,2*i) = Elements(:,i+4);
end
dFau = SF ; % 变形图放大系数
%% 绘制变形前网格
trisurf( gElt_plot , Nodes( : , 1 ) , Nodes( : , 2 ) , zeros(size(Nodes,1),1))
view(2); axis equal; axis off; axis tight; alpha(0.5);
hold on
%% 获取变形后数据
DDisp = Nodes + gNTu * dFau;
% pause( 3.0 );
trisurf( gElt_plot , DDisp( : , 1 ) , DDisp( : , 2 ) , zeros(size(DDisp,1),1));
view(2); axis equal; axis off; axis tight;alpha(0.5);