Mercurial > repos > public > sbplib
changeset 180:001239c03eb2 feature/beams
Merge with feature/grids.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 29 Feb 2016 15:08:01 +0100 |
parents | d095b5396103 (current diff) 8ca4f80fcdd3 (diff) |
children | 419ec303e97d |
files | +scheme/Scheme.m |
diffstat | 7 files changed, 19 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
diff -r d095b5396103 -r 001239c03eb2 +anim/setup_1d_plot.m --- a/+anim/setup_1d_plot.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+anim/setup_1d_plot.m Mon Feb 29 15:08:01 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)
diff -r d095b5396103 -r 001239c03eb2 +grid/equidistant.m --- a/+grid/equidistant.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+grid/equidistant.m Mon Feb 29 15:08:01 2016 +0100 @@ -19,9 +19,11 @@ end X = {}; + h = []; for i = 1:length(m) - X{i} = util.get_grid(varargin{i}{:},m(i)); + [X{i}, h(i)] = util.get_grid(varargin{i}{:},m(i)); end g = grid.Cartesian(X{:}); + g.h = h; end \ No newline at end of file
diff -r d095b5396103 -r 001239c03eb2 +grid/equidistantCurvilinear.m --- a/+grid/equidistantCurvilinear.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+grid/equidistantCurvilinear.m Mon Feb 29 15:08:01 2016 +0100 @@ -25,9 +25,11 @@ end X = {}; + h = []; for i = 1:length(m) - X{i} = util.get_grid(varargin{i}{:},m(i)); + [X{i}, h(i)] = util.get_grid(varargin{i}{:},m(i)); end g = grid.Curvilinear(mapping, X{:}); + g.h = h; end \ No newline at end of file
diff -r d095b5396103 -r 001239c03eb2 +noname/Discretization.m --- a/+noname/Discretization.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+noname/Discretization.m Mon Feb 29 15:08:01 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
diff -r d095b5396103 -r 001239c03eb2 +noname/printSolutions.m --- a/+noname/printSolutions.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+noname/printSolutions.m Mon Feb 29 15:08:01 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
diff -r d095b5396103 -r 001239c03eb2 +scheme/Scheme.m --- a/+scheme/Scheme.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+scheme/Scheme.m Mon Feb 29 15:08:01 2016 +0100 @@ -1,7 +1,6 @@ % Start with all matrix returns. When that works see how we should generalize to non-matrix stuff/nonlinear classdef Scheme < handle properties (Abstract) - m % Number of points in each direction, possibly a vector order % Order accuracy for the approximation % vectors u,v,w depending on dim that gives were gridpoints are in each dimension
diff -r d095b5396103 -r 001239c03eb2 +time/Cdiff.m --- a/+time/Cdiff.m Mon Feb 29 10:16:39 2016 +0100 +++ b/+time/Cdiff.m Mon Feb 29 15:08:01 2016 +0100 @@ -13,6 +13,7 @@ methods function obj = Cdiff(D, E, S, k, t0, n0, v, v_prev) + % Cdiff(D, E, S, k, t0, n0, v, v_prev) m = size(D,1); default_arg('E',sparse(m,m)); default_arg('S',sparse(m,1));