% Plots for StokesPoiseuilleSetup

% Last modified by Jing Lin in Apr. 2014

clf;
colormap(mk_colmap);

subplot(311);
surf(XP, YP, P(NodeP(2:app.Ny+1,2:app.Nx+1)), 'LineStyle', 'none');
TT(1)=xlabel('x(m)'); TT(2)=ylabel('y(m)'); TT(3)=zlabel('T(^oC)');
TT(4)=title(sprintf('Pressure (time=%0.2f, Nx=%g, Ny=%g)', T, app.Nx, app.Ny));
formatplot([],gca,TT);
view(2), colorbar, shading interp
SetPlot;

subplot(312);
surf(XU, YU, u(Nodeu(2:app.Ny+1,2:app.Nx)), 'LineStyle', 'none')
TT(1)=xlabel('x(m)'); TT(2)=ylabel('y(m)'); TT(3)=zlabel('T(^oC)');
TT(4)=title(sprintf('U velocity'));
formatplot([],gca,TT);
view(2), colorbar, shading interp
SetPlot;

subplot(313);
plot(Exact_u(YU(:,1)), YU(:,1), 'r');
hold on;
plot(u(Nodeu(2:end-1, 1+round(b*0.05/dx))), YU(:,1), 'go');
plot(u(Nodeu(2:end-1, 1+round(b*0.1/dx))), YU(:,1), 'bx');
plot(u(Nodeu(2:end-1, 1+round(b*0.25/dx))), YU(:,1), 'k+');
plot(u(Nodeu(2:end-1, 1+round(b*0.5/dx))), YU(:,1), 'm<');
plot(u(Nodeu(2:end-1, 1+round(b*1.0/dx))), YU(:,1), 'b.');
legend('Analytic Poiseuille', 'L=0.05Wid', 'L=0.10Wid', 'L=0.25Wid', 'L=0.50Wid',...
    'L=1.00Wid','Location','West');
TT(1)=xlabel('U velocity'); TT(2)=ylabel('y');
TT(4)=title(sprintf('U velocity profile (Nx=%g, Ny=%g)', app.Nx, app.Ny));
SetPlot;

drawnow;
