Files
3D_EDFM_SIM-X/算例3-单重双重离散裂缝混合模型/plot_2D_layer.m
T
2026-03-13 11:24:41 +08:00

51 lines
1.2 KiB
Matlab

function plot_2D_layer(i, k, r, OutputRs, type)
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;
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