jacobi.template
Loading...
Searching...
No Matches
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%
11function visualize_par_results(nprocs)
12%%
13if nargin<1
14 nprocs = 4;
15end
16fprintf('# procs = %d\n',nprocs)
17
18pre = 'uv_';
19post = '.txt';
20
21xc = []; nnodes = [];
22ia = []; nelems = [];
23v = [];
24node_offset = 0;
25elem_offset = 0;
26for 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);
42end
43
44% fname = 'uv.txt';
45% [xc,ia,v] = ascii_read_meshvector(fname);
46
47h = trisurf(ia, xc(:,1), xc(:,2), v);
48xlabel('x'),ylabel('y'),zlabel('z')
49
50shading interp
51
52waitfor(h) % wait for closing the figure
u
Definition laplacian.m:3
4 visualize_par_results()