Skip to content

Commit bcc8dce

Browse files
committed
Merge branch 'lr/revision' of https://github.com/PTsolvers/PseudoTransientStokes.jl into lr/revision
2 parents 95a1a20 + 0bd88d9 commit bcc8dce

File tree

5 files changed

+51
-13
lines changed

5 files changed

+51
-13
lines changed

scripts/stokes_3D/Stokes3D_ve_multixpu.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ end
264264
if (me==0) @printf("Total iters = %d (%d steps), time = %1.3e sec (@ T_eff = %1.2f GB/s) \n", ittot, nt, wtime, round(T_eff, sigdigits=2)) end
265265
# Visualisation
266266
if do_viz || do_save_viz
267-
Pt_inn .= inn(Pt); gather!(Pt_inn, Pt_v)
268-
Vz_inn .= av_zi(Vz); gather!(Vz_inn, Vz_v)
269-
Rz_inn .= av_za(Rz); gather!(Rz_inn, Rz_v)
270-
Mus_inn.= inn(Mus); gather!(Mus_inn, Mus_v)
271-
τxz_inn.= av_xza(τxz); gather!(τxz_inn, τxz_v)
267+
Pt_inn .= Array(inn(Pt)); gather!(Pt_inn, Pt_v)
268+
Vz_inn .= Array(av_zi(Vz)); gather!(Vz_inn, Vz_v)
269+
Rz_inn .= Array(av_za(Rz)); gather!(Rz_inn, Rz_v)
270+
Mus_inn.= Array(inn(Mus)); gather!(Mus_inn, Mus_v)
271+
τxz_inn.= Array(av_xza(τxz)); gather!(τxz_inn, τxz_v)
272272
if me==0 && do_viz
273273
p1 = heatmap(Xi_g, Zi_g, Pt_v[:,y_sl,:]', aspect_ratio=1, xlims=(Xi_g[1],Xi_g[end]), zlims=(Zi_g[1],Zi_g[end]), c=:viridis, title="Pressure")
274274
p2 = heatmap(Xi_g, Zi_g, Vz_v[:,y_sl,:]', aspect_ratio=1, xlims=(Xi_g[1],Xi_g[end]), zlims=(Zi_g[1],Zi_g[end]), c=:viridis, title="Vz")

scripts/stokes_3D/Stokes3D_ve_multixpu_perf.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ end
264264
if (me==0) @printf("Total iters = %d (%d steps), time = %1.3e sec (@ T_eff = %1.2f GB/s) \n", ittot, nt, wtime, round(T_eff, sigdigits=3)) end
265265
# Visualisation
266266
if do_viz || do_save_viz
267-
Pt_inn .= inn(Pt); gather!(Pt_inn, Pt_v)
268-
Vz_inn .= av_zi(Vz); gather!(Vz_inn, Vz_v)
269-
Rz_inn .= av_za(Rz); gather!(Rz_inn, Rz_v)
270-
Mus_inn.= inn(Mus); gather!(Mus_inn, Mus_v)
271-
τxz_inn.= av_xza(τxz); gather!(τxz_inn, τxz_v)
267+
Pt_inn .= Array(inn(Pt)); gather!(Pt_inn, Pt_v)
268+
Vz_inn .= Array(av_zi(Vz)); gather!(Vz_inn, Vz_v)
269+
Rz_inn .= Array(av_za(Rz)); gather!(Rz_inn, Rz_v)
270+
Mus_inn.= Array(inn(Mus)); gather!(Mus_inn, Mus_v)
271+
τxz_inn.= Array(av_xza(τxz)); gather!(τxz_inn, τxz_v)
272272
if me==0 && do_viz
273273
p1 = heatmap(Xi_g, Zi_g, Pt_v[:,y_sl,:]', aspect_ratio=1, xlims=(Xi_g[1],Xi_g[end]), zlims=(Zi_g[1],Zi_g[end]), c=:viridis, title="Pressure")
274274
p2 = heatmap(Xi_g, Zi_g, Vz_v[:,y_sl,:]', aspect_ratio=1, xlims=(Xi_g[1],Xi_g[end]), zlims=(Zi_g[1],Zi_g[end]), c=:viridis, title="Vz")

scripts/stokes_3D/previous_damp/Stokes3D0_multixpu.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ end
225225
if (me==0) @printf("Total steps = %d, err = %1.3e, time = %1.3e sec (@ T_eff = %1.2f GB/s) \n", iter, err, wtime, round(T_eff, sigdigits=2)) end
226226
# Visualisation
227227
if do_viz
228-
Pt_inn .= inn(Pt); gather!(Pt_inn, Pt_v)
229-
Vz_inn .= av_zi(Vz); gather!(Vz_inn, Vz_v)
230-
Rz_inn .= av_za(Rz); gather!(Rz_inn, Rz_v)
228+
Pt_inn .= Array(inn(Pt)); gather!(Pt_inn, Pt_v)
229+
Vz_inn .= Array(av_zi(Vz)); gather!(Vz_inn, Vz_v)
230+
Rz_inn .= Array(av_za(Rz)); gather!(Rz_inn, Rz_v)
231231
if (me==0)
232232
p1 = heatmap(Xi_g, Zi_g, Pt_v[:,y_sl,:]', aspect_ratio=1, xlims=(Xi_g[1],Xi_g[end]), zlims=(Zi_g[1],Zi_g[end]), c=:viridis, title="Pressure")
233233
p2 = heatmap(Xi_g, Zi_g, Vz_v[:,y_sl,:]', aspect_ratio=1, xlims=(Xi_g[1],Xi_g[end]), zlims=(Zi_g[1],Zi_g[end]), c=:viridis, title="Vz")
93.3 KB
Loading

visu/viz_stokes_param_aspect.m

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
clear;load('roma.mat')
2+
%setup
3+
fs = 10; % font size
4+
% figure parameters
5+
nt = 5;
6+
sims = {'aspect_ratio'};
7+
fact = [0.6, 0.5, 0.4, 0.3, 0.2, 0.1];
8+
subs = [1 2 4 8]; % number of grid subdivisions
9+
resol = [127, 255, 511, 1023, 2047];
10+
% vis
11+
for ifig = 1:numel(sims)
12+
figure(ifig);clf
13+
set(gcf,'Units','centimeters','Position',[(5+13*(ifig-1)) 2 8 18],'PaperUnits','centimeters','PaperPosition',[0 0 8 18]);
14+
data = readmatrix(sprintf('../output/out_Stokes2D_ve_%s_param.txt',sims{ifig}));
15+
% data = data(:,2:end);
16+
sz = [numel(fact),numel(subs),numel(resol)];
17+
nx = reshape(data(:,1),sz);
18+
ny = reshape(data(:,2),sz);
19+
nsub = reshape(data(:,3),sz);
20+
nfact = reshape(data(:,4),sz);
21+
iters = reshape(data(:,5),sz);
22+
error = reshape(data(:,7),sz);
23+
tiledlayout(numel(resol),1,'TileSpacing','compact','Padding','normal')
24+
for iSub = 1:numel(resol)
25+
nexttile
26+
plot(min(iters(:,:,iSub))./nt./min(nx(:,:,iSub)),'-o','LineWidth',1.6,'MarkerSize',3)
27+
xlim([0.9 4.1]); ylim([6 20]);
28+
yticks([8 12 16]); yticklabels([8 12 16])
29+
if iSub == numel(resol);xticks(1:4);xticklabels(subs);xlabel('\bfaspect ratio (lx/ly)');else; xticklabels([]); end
30+
text(0.02,0.88,['\bf(' char('a'+iSub-1) ')'],'Units','normalized','FontName','Courier')
31+
text(0.63,0.88,['\bfny = ' num2str(resol(iSub))],'Units','normalized','FontName','Courier')
32+
set(gca,'FontName','Courier','FontSize',fs,'YDir','normal','XAxisLocation','bottom','LineWidth',0.8)
33+
if iSub == 3; ylabel('\bfiter_{tot}/nt/nx'); end
34+
drawnow
35+
end
36+
% save figure
37+
print('-dpng',sprintf('fig_stokes_systematics_%s.png',sims{ifig}),'-r300')
38+
end

0 commit comments

Comments
 (0)