annotate +noname/plotSolutions.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 7bb2ef637142
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 plotSolutions(filename, figename_prefix, plot_type)
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 default_arg('figename_prefix',[]);
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 default_arg('plot_type','plot')
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
4
21
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
5 save_figures = ~isempty(figename_prefix);
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
6
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 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
8
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 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
10 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
11 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
12
215
7bb2ef637142 Fixed some typos in noname.
Jonatan Werpers <jonatan@werpers.com>
parents: 32
diff changeset
13 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
14 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
15 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
16 T = key.T;
21
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
17 repr = entry.repr;
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
18 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
19 k = entry.k;
32
ddfb98209aa2 Fixed a bunch of problems regarding convergence and saving solutions
Jonatan Werpers <jonatan@werpers.com>
parents: 21
diff changeset
20 discr = entry.discr;
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
21
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 [update, hand] = discr.setupPlot(plot_type);
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 update(repr);
21
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
24
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
25 if save_figures
215
7bb2ef637142 Fixed some typos in noname.
Jonatan Werpers <jonatan@werpers.com>
parents: 32
diff changeset
26 figname = sprintf('%s_%s_o%d_m%d_T%d',figename_prefix,name,order,m,i);
21
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
27 fprintf('Saving figure to ''%s''\n',figname);
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
28 saveeps(hand,figname);
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
29 end
b1e04c1f2b45 Added functionality for saveing to eps from plotSolutions.
Jonatan Werpers <jonatan@werpers.com>
parents: 20
diff changeset
30
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
31 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
32
215
7bb2ef637142 Fixed some typos in noname.
Jonatan Werpers <jonatan@werpers.com>
parents: 32
diff changeset
33 end