This commit is contained in:
xinxiao
2026-03-13 11:24:41 +08:00
commit 04e2bb29c7
238 changed files with 29102 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
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