Mercurial > repos > public > sbplib
changeset 142:484b48e95c83
Removed ylim from setup1dPlot added some comments and fixed timestepper paramters.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 29 Feb 2016 15:00:52 +0100 |
parents | cb2b12246b7e |
children | 125c51e4dca8 8ca4f80fcdd3 |
files | +anim/setup_1d_plot.m +noname/Discretization.m +noname/printSolutions.m +time/Cdiff.m |
diffstat | 4 files changed, 13 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/+anim/setup_1d_plot.m Wed Feb 24 15:03:19 2016 +0100 +++ b/+anim/setup_1d_plot.m Mon Feb 29 15:00:52 2016 +0100 @@ -9,7 +9,7 @@ % be passed to functions in yfun. % plot_handles - Array of plot_handles. One for each yfun. % axis_handle - Handle to the axis plotted to. -function [update_data, plot_handles, axis_handle] = setup_1d_plot(x,y_lim,yfun) +function [update_data, plot_handles, axis_handle] = setup_1d_plot(x,yfun) default_arg('yfun',{@(y)y}); if isa(yfun,'function_handle') @@ -28,10 +28,6 @@ ylabel('y') xlim([x(1) x(end)]); - if ~isempty(y_lim) - ylim(y_lim); - end - function update(t,varargin) if ishandle(figure_handle) && ishandle(axis_handle) for i = 1:length(yfun)
--- a/+noname/Discretization.m Wed Feb 24 15:03:19 2016 +0100 +++ b/+noname/Discretization.m Mon Feb 29 15:00:52 2016 +0100 @@ -19,7 +19,7 @@ % the appropriate timestepper. It should also provide a default value. % k is a desired timestep % cfl is a choses cfl constant used to set the timestep. ignored if k is set. - ts = getTimestepper(obj, method, k, cfl) + ts = getTimestepper(obj, opt) % Calculates a timestep for the discretization and a given timestepping method. % Can take order, differnt types of scaling in h, or other parameters in Discr into
--- a/+noname/printSolutions.m Wed Feb 24 15:03:19 2016 +0100 +++ b/+noname/printSolutions.m Mon Feb 29 15:00:52 2016 +0100 @@ -1,7 +1,7 @@ function printSolutions(filename) sf = SolutionFile(filename); - method = {}; + name = {}; order = []; m = []; T = []; @@ -13,8 +13,7 @@ key = sf.keys{i}; entry = sf.get(key); - - method = [method key.method]; + name = [name key.name]; order = [order key.order]; m = [m key.m]; T = [T key.T]; @@ -23,16 +22,16 @@ k = [k entry.k]; end - methodW = findFieldWidth('%s',method); - orderW = findFieldWidth('%d',order); - mW = findFieldWidth('%d',m); - TW = findFieldWidth('%d',T); - tW = findFieldWidth('%.3e',t); - runtimeW = findFieldWidth('%.3f',runtime); - kW = findFieldWidth('%.4f',k); + nameW = findFieldWidth('%s', name); + orderW = findFieldWidth('%d', order); + mW = findFieldWidth('%d', m); + TW = findFieldWidth('%d', T); + tW = findFieldWidth('%.3e', t); + runtimeW = findFieldWidth('%.3f', runtime); + kW = findFieldWidth('%.4f', k); for i = 1:length(sf.keys) - 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)); + 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)); end end \ No newline at end of file