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,20]); colorbar colormap jet saveas(gcf, sprintf('第%d层压力分布.fig', k)); % fill(x,y,dis); % axis off