function plot_compliance(aPhys,bPhys,cPhys) % load('ani_rmin1.5_cab.mat') % aPhys=a_log{347,2};bPhys=b_log{347,2};cPhys=c_log{347,2}; % load('iso_rmin1.5.mat') % cPhys=c_log{276,2}; nz=size(aPhys,1);ny=size(aPhys,2);nx=size(aPhys,3); % ch=interp_ch(aPhys,bPhys,cPhys); [ch,ch_da,ch_db,ch_dc]=fitting_val(aPhys,bPhys,cPhys); ke_all=lk_all(ch); U=FEM_Beam(nx,ny,nz,ke_all); comp =zeros(nz,ny,nx); for elz = 1:nz % z = nz*h - (elz-1)*h; for ely = 1:ny % y = (ely-1)*h + 0.5*h; for elx = 1:nx % x = (elx-1)*h + 0.5*h; n2 = (nz+1)*(ny+1)*elx + (nz+1)*(ely-1) + elz; n1 = n2-(nz+1)*(ny+1); n3 = n1 + (nz+1); n4 = n2 + (nz+1); n5 = n1 + 1; n6 = n2 + 1; n7 = n3 + 1; n8 = n4 + 1; Ue = U([3*n1-2; 3*n1-1; 3*n1; 3*n2-2; 3*n2-1; 3*n2; 3*n3-2; 3*n3-1; 3*n3; 3*n4-2; 3*n4-1; 3*n4; 3*n5-2; 3*n5-1; 3*n5; 3*n6-2; 3*n6-1; 3*n6; 3*n7-2; 3*n7-1; 3*n7; 3*n8-2; 3*n8-1; 3*n8]); comp(elz,ely,elx) = Ue'* ke_all(:,:,elz,ely,elx)*Ue; end end end figure(1) set(gcf,'position',[100 650 300 300]) cc = squeeze(comp(:,1,:)); colormap(1-gray); imagesc(cc); axis equal; axis tight; axis off; % title('Compliance Distribution') set(gca,'YDir','normal') pause(1e-6); end