jacobi.template
visualize_par_results.m
Go to the documentation of this file.
1 %% Visualize results
2 %
3 % flatpak run org.octave.Octave <filename>
4 % or
5 % octave --no-window-system --no-gui -qf <filename>
6 %
7 % or
8 %
9 % matlab -nosplash -nodesktop -r 'try visualize_par_results(4); catch; end; quit'
10 %
11 function visualize_par_results(nprocs)
12 %%
13 if nargin<1
14  nprocs = 4;
15 end
16 fprintf('# procs = %d\n',nprocs)
17 
18 pre = 'uv_';
19 post = '.txt';
20 
21 xc = []; nnodes = [];
22 ia = []; nelems = [];
23 v = [];
24 node_offset = 0;
25 elem_offset = 0;
26 for rank=0:nprocs-1
27  fname = [pre,num2str(rank,'%2u'),post];
28  [lxc,lia,lv] = ascii_read_meshvector(fname);
29 % whos lxc lia lv
30  nnodes = [nnodes size(lxc,1)];
31  nelems = [nelems size(lia,1)];
32  %[xc,ia,v]
33  xc = [xc; lxc];
34  v = [v ; lv ];
35  ia = [ia; lia+node_offset];
36 % node_offset
37 % lia = lia + node_offset
38 % ia = [ia; lia];
39  % index offsets for next subdomain
40  node_offset = node_offset + nnodes(end);
41  elem_offset = elem_offset + nelems(end);
42 end
43 
44 % fname = 'uv.txt';
45 % [xc,ia,v] = ascii_read_meshvector(fname);
46 
47 h = trisurf(ia, xc(:,1), xc(:,2), v);
48 xlabel('x'),ylabel('y'),zlabel('z')
49 
50 shading interp
51 
52 waitfor(h) % wait for closing the figure
end
end
Definition: visualize_par_results.m:9
u
u
Definition: laplacian.m:3
visualize_par_results
4 visualize_par_results()