Mercurial > repos > public > sbplib
annotate +noname/printSolutions.m @ 577:e45c9b56d50d feature/grids
Add an Empty grid class
The need turned up for the flexural code when we may or may not have a grid for the open water and want to plot that solution.
In case there is no open water we need an empty grid to plot the empty gridfunction against to avoid errors.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 07 Sep 2017 09:16:12 +0200 |
parents | 484b48e95c83 |
children |
rev | line source |
---|---|
20
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 function printSolutions(filename) |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 sf = SolutionFile(filename); |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 |
142
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
4 name = {}; |
20
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 order = []; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
6 m = []; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
7 T = []; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
8 t = []; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
9 runtime = []; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
10 k = []; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
11 |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
12 for i = 1:length(sf.keys) |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
13 key = sf.keys{i}; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
14 entry = sf.get(key); |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
15 |
142
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
16 name = [name key.name]; |
20
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
17 order = [order key.order]; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
18 m = [m key.m]; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
19 T = [T key.T]; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
20 t = [t entry.repr.t]; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
21 runtime = [runtime entry.runtime]; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
22 k = [k entry.k]; |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
23 end |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
24 |
142
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
25 nameW = findFieldWidth('%s', name); |
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
26 orderW = findFieldWidth('%d', order); |
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
27 mW = findFieldWidth('%d', m); |
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
28 TW = findFieldWidth('%d', T); |
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
29 tW = findFieldWidth('%.3e', t); |
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
30 runtimeW = findFieldWidth('%.3f', runtime); |
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
31 kW = findFieldWidth('%.4f', k); |
20
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
32 |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
33 for i = 1:length(sf.keys) |
142
484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
Jonatan Werpers <jonatan@werpers.com>
parents:
20
diff
changeset
|
34 fprintf('[%*s: o=%-*d, m=%-*d, T=%-*d]: t=%-*.3e, runtime=%*.3f, k=%*.4f\n', nameW, name{i}, orderW,order(i),mW,m(i),TW,T(i), tW, t(i), runtimeW,runtime(i), kW, k(i)); |
20
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
35 end |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
36 |
c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
37 end |