52 lines
1.2 KiB
Matlab
52 lines
1.2 KiB
Matlab
function plot_SP_DP(k, r)
|
|
coordinate=r.coordinates;
|
|
nodes=r.nodes;
|
|
nz=r.nz;
|
|
nx=r.nx;
|
|
ny=r.ny;
|
|
nmc = size(nodes,1);
|
|
% nel = size(nodes,2);
|
|
nel = 4;
|
|
v = r.sigma;
|
|
% if type == 1
|
|
% % v = r.kx;
|
|
% v = OutputRs{i}.p;
|
|
% else
|
|
% v = 1-OutputRs{i}.sw;%º¬Æø±¥ºÍ¶È
|
|
% end
|
|
dis = zeros(nel, nx*ny);
|
|
x = zeros(nel, nx*ny);
|
|
y = zeros(nel, nx*ny);
|
|
for i = 1 :nx*ny
|
|
for j = 1 :nel
|
|
grid_numbering = i+(nz-k)*nx*ny;
|
|
x(j, i) = coordinate(nodes(grid_numbering,j), 1);
|
|
y(j, i) = coordinate(nodes(grid_numbering,j), 2);
|
|
if j == 3
|
|
x(j, i) = coordinate(nodes(grid_numbering,4), 1);
|
|
y(j, i) = coordinate(nodes(grid_numbering,4), 2);
|
|
end
|
|
if j == 4
|
|
x(j, i) = coordinate(nodes(grid_numbering,3), 1);
|
|
y(j, i) = coordinate(nodes(grid_numbering,3), 2);
|
|
end
|
|
dis(j, i) = v(grid_numbering);
|
|
end
|
|
end
|
|
% fill(x,y,dis,'EdgeAlpha',1);
|
|
figure('color','w');
|
|
fill(x,y,dis,'EdgeColor','interp');
|
|
xlabel('x, m','FontSize',14);
|
|
ylabel('y, m','FontSize',14);
|
|
ax = gca;
|
|
ax.FontSize = 14;
|
|
axis equal;
|
|
axis tight
|
|
% xlim([0,60]);
|
|
% ylim([0,60]);
|
|
% clim([10,15]);
|
|
colorbar
|
|
colormap jet
|
|
% fill(x,y,dis);
|
|
% axis off
|