annotate +noname/plotSolutions.m @ 1031:2ef20d00b386 feature/advectionRV

For easier comparison, return both the first order and residual viscosity when evaluating the residual. Add the first order and residual viscosity to the state of the RungekuttaRV time steppers
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 17 Jan 2019 10:25:06 +0100
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