comparison +noname/printSolutions.m @ 20:c7efff913935

Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Sep 2015 17:35:58 +0200
parents
children 484b48e95c83
comparison
equal deleted inserted replaced
19:1644d000c304 20:c7efff913935
1 function printSolutions(filename)
2 sf = SolutionFile(filename);
3
4 method = {};
5 order = [];
6 m = [];
7 T = [];
8 t = [];
9 runtime = [];
10 k = [];
11
12 for i = 1:length(sf.keys)
13 key = sf.keys{i};
14 entry = sf.get(key);
15
16
17 method = [method key.method];
18 order = [order key.order];
19 m = [m key.m];
20 T = [T key.T];
21 t = [t entry.repr.t];
22 runtime = [runtime entry.runtime];
23 k = [k entry.k];
24 end
25
26 methodW = findFieldWidth('%s',method);
27 orderW = findFieldWidth('%d',order);
28 mW = findFieldWidth('%d',m);
29 TW = findFieldWidth('%d',T);
30 tW = findFieldWidth('%.3e',t);
31 runtimeW = findFieldWidth('%.3f',runtime);
32 kW = findFieldWidth('%.4f',k);
33
34 for i = 1:length(sf.keys)
35 fprintf('[%*s: o=%-*d, m=%-*d, T=%-*d]: t=%-*.3e, runtime=%*.3f, k=%*.4f\n',methodW, method{i}, orderW,order(i),mW,m(i),TW,T(i), tW, t(i), runtimeW,runtime(i), kW, k(i));
36 end
37
38 end