Code covered by the BSD License  

Highlights from
FEM toolbox for solid mechanics

image thumbnail
from FEM toolbox for solid mechanics by Anton Zaicenco
The finite element toolbox for solid mechanics with GUI.

plot_dyn_3Dtruss(in_data,D,ind,dof, XXX,YYY,ZZZ, NF)
function plot_dyn_3Dtruss(in_data,D,ind,dof, XXX,YYY,ZZZ, NF)


figure(NF)

% plot deformed -----------------------------------------------------------------
maxX = max(in_data.ND(:,2)); minX = min(in_data.ND(:,2));
maxY = max(in_data.ND(:,3)); minY = min(in_data.ND(:,3));
maxZ = max(in_data.ND(:,4)); minZ = min(in_data.ND(:,4));
dof = size(in_data.ND,1)*6;
labx = (maxX / 6); laby = (maxY / 6); labz = (maxZ / 6);
labx = min([labx laby labz]); laby = labx;  labz=labx;

deN = max([XXX  YYY  ZZZ]);
dx = labx *D(1:3:end) /deN;
dy = laby *D(2:3:end) /deN;
dz = labz *D(3:3:end) /deN;

plot3(in_data.ND(:,2)+dx',in_data.ND(:,3)+dy', in_data.ND(:,4)+dz','r.');
axis equal; axis off; hold on; view(3);
ND_d = in_data.ND;
ND_d(:,2) = in_data.ND(:,2)+dx';
ND_d(:,3) = in_data.ND(:,3)+dy';
ND_d(:,4) = in_data.ND(:,4)+dz';
for i=1:size(in_data.EL)
   node1 = find(ND_d(:,1)==in_data.EL(i,3));
   node2 = find(ND_d(:,1)==in_data.EL(i,4));
   plot3([ND_d(node1,2) ND_d(node2,2)], [ND_d(node1,3) ND_d(node2,3)], ... 
      [ND_d(node1,4) ND_d(node2,4)],'r-');
end;



axis([(minX-labx) (maxX+labx) (minY-laby) (maxY+laby) (minZ-labz)    (maxZ+labz)]);

Contact us at files@mathworks.com