|
1 | | - |
2 | 1 | clc; |
3 | 2 | clear; |
4 | 3 |
|
| 4 | +%% Check if running in CI environment |
| 5 | +isCI = strcmpi(getenv('CI'), 'true'); |
| 6 | +doPlot = ~isCI; |
| 7 | + |
5 | 8 | %% |
6 | 9 | addpath("distmesh/") |
7 | 10 |
|
|
99 | 102 |
|
100 | 103 |
|
101 | 104 | %% |
102 | | -figure; |
103 | | - |
104 | | - |
105 | | -scatter(xy(:,1),xy(:,2),'k.'); hold on; axis square; |
106 | | -scatter(boundary_in(:,1),boundary_in(:,2),'b+'); |
107 | | -scatter(boundary_y(:,1),boundary_y(:,2),'r+'); |
108 | | -scatter(boundary_out(:,1),boundary_out(:,2),'b+'); |
109 | | -scatter(boundary_c(:,1),boundary_c(:,2),'m+'); |
110 | | - |
111 | | -% |
112 | | -% scatter(xy_s(:,1),xy_s(:,2),'r.'); hold on; axis square; |
113 | | -% % |
114 | | -% scatter(boundary_in_s(:,1),boundary_in_s(:,2),'k*'); |
115 | | -% % |
116 | | -% scatter(boundary_out_s(:,1),boundary_out_s(:,2),'k*'); |
117 | | -% scatter(boundary_y_s(:,1),boundary_y_s(:,2),'b*'); |
118 | | -% scatter(boundary_c_s(:,1),boundary_c_s(:,2),'b .'); |
119 | | - |
120 | | -axis equal; |
121 | | - |
| 105 | +if doPlot |
| 106 | + figure; |
| 107 | + |
| 108 | + scatter(xy(:,1),xy(:,2),'k.'); hold on; axis square; |
| 109 | + scatter(boundary_in(:,1),boundary_in(:,2),'b+'); |
| 110 | + scatter(boundary_y(:,1),boundary_y(:,2),'r+'); |
| 111 | + scatter(boundary_out(:,1),boundary_out(:,2),'b+'); |
| 112 | + scatter(boundary_c(:,1),boundary_c(:,2),'m+'); |
| 113 | + |
| 114 | + % |
| 115 | + % scatter(xy_s(:,1),xy_s(:,2),'r.'); hold on; axis square; |
| 116 | + % % |
| 117 | + % scatter(boundary_in_s(:,1),boundary_in_s(:,2),'k*'); |
| 118 | + % % |
| 119 | + % scatter(boundary_out_s(:,1),boundary_out_s(:,2),'k*'); |
| 120 | + % scatter(boundary_y_s(:,1),boundary_y_s(:,2),'b*'); |
| 121 | + % scatter(boundary_c_s(:,1),boundary_c_s(:,2),'b .'); |
| 122 | + |
| 123 | + axis equal; |
| 124 | +end |
122 | 125 |
|
123 | 126 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
124 | 127 | % xy1: V-grid; xy1_s: P-grid. |
|
394 | 397 | % |
395 | 398 | nu =1/100; dt = 1e-2; |
396 | 399 |
|
| 400 | +% Set reduced number of time steps for CI environment |
| 401 | +Nt = 5000; |
| 402 | +if isCI |
| 403 | + Nt = 20; % Keep tests fast in CI |
| 404 | +end |
| 405 | + |
397 | 406 | % |
398 | 407 | L = L0; |
399 | 408 | L(length(xy)+1:end,:) = zeros(length(boundary),length(xy1)); |
|
434 | 443 | W0 = [U0;V0]; |
435 | 444 |
|
436 | 445 |
|
437 | | -Nt = 5000; |
438 | | - |
439 | 446 | W = zeros(length(xy1)*2,Nt+1); |
440 | 447 |
|
441 | 448 | W(:,1) = W0; |
|
486 | 493 |
|
487 | 494 | %% |
488 | 495 |
|
489 | | - |
490 | | -figure('Name','1/Re = 1e-2'); |
491 | | - |
492 | | - colormap(jet) |
493 | | - |
494 | | -% for j =1:1:5000 |
495 | | -j = Nt; |
496 | | - |
497 | | -% colormap(bluered) |
498 | | - |
499 | | -% j = (j1-1)* 1600 +3; |
500 | | -U = W(1:length(xy1),(j-1)*1+1); |
501 | | -V = W(length(xy1)+1:end,(j-1)*1+1); |
502 | | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
503 | | -subplot(2,1,1); |
504 | | -scatter(x1,y1,15*ones(length(xy1),1),1*(U-1),'.'); |
505 | | -axis equal, axis tight, hold on; |
506 | | -% colorbar |
507 | | -xlim([x_min x_max]); |
508 | | -ylim([y_min y_max]); |
509 | | -yticks([-5 0 5]) |
510 | | -xticks([-5 0 5 10 15]) |
511 | | -title(['u']); |
512 | | -ylabel('y'); |
513 | | -xlabel('x'); |
514 | | -shading interp; |
515 | | -caxis([-1e-0 1e-0]); |
516 | | - |
517 | | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
518 | | -subplot(2,1,2); |
519 | | -scatter(x1,y1,15*ones(length(xy1),1),1*V,'.'); |
520 | | -axis equal, axis tight, hold on; |
521 | | -% colorbar |
522 | | -shading interp; |
523 | | - |
524 | | -xlim([x_min x_max]); |
525 | | -ylim([y_min y_max]); |
526 | | -yticks([-5 0 5]) |
527 | | -xticks([-5 0 5 10 15]) |
528 | | -title(['v' ]); |
529 | | - |
530 | | -xlabel('x'); |
531 | | -ylabel('y'); |
532 | | -set(gca,'Ytick',[]); |
533 | | -caxis([-1e-0 1e-0]); |
534 | | - |
535 | | -drawnow; |
| 496 | +if doPlot |
| 497 | + figure('Name','1/Re = 1e-2'); |
| 498 | + |
| 499 | + colormap(jet) |
| 500 | + |
| 501 | + % for j =1:1:5000 |
| 502 | + j = Nt; |
| 503 | + |
| 504 | + % colormap(bluered) |
| 505 | + |
| 506 | + % j = (j1-1)* 1600 +3; |
| 507 | + U = W(1:length(xy1),(j-1)*1+1); |
| 508 | + V = W(length(xy1)+1:end,(j-1)*1+1); |
| 509 | + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 510 | + subplot(2,1,1); |
| 511 | + scatter(x1,y1,15*ones(length(xy1),1),1*(U-1),'.'); |
| 512 | + axis equal, axis tight, hold on; |
| 513 | + % colorbar |
| 514 | + xlim([x_min x_max]); |
| 515 | + ylim([y_min y_max]); |
| 516 | + yticks([-5 0 5]) |
| 517 | + xticks([-5 0 5 10 15]) |
| 518 | + title(['u']); |
| 519 | + ylabel('y'); |
| 520 | + xlabel('x'); |
| 521 | + shading interp; |
| 522 | + caxis([-1e-0 1e-0]); |
| 523 | + |
| 524 | + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 525 | + subplot(2,1,2); |
| 526 | + scatter(x1,y1,15*ones(length(xy1),1),1*V,'.'); |
| 527 | + axis equal, axis tight, hold on; |
| 528 | + % colorbar |
| 529 | + shading interp; |
| 530 | + |
| 531 | + xlim([x_min x_max]); |
| 532 | + ylim([y_min y_max]); |
| 533 | + yticks([-5 0 5]) |
| 534 | + xticks([-5 0 5 10 15]) |
| 535 | + title(['v' ]); |
| 536 | + |
| 537 | + xlabel('x'); |
| 538 | + ylabel('y'); |
| 539 | + set(gca,'Ytick',[]); |
| 540 | + caxis([-1e-0 1e-0]); |
| 541 | + |
| 542 | + drawnow; |
| 543 | +end |
536 | 544 |
|
537 | 545 | % end |
538 | 546 |
|
|
0 commit comments