view +noname/plotSolutions.m @ 87:0a29a60e0b21

In Curve: Rearranged for speed. arc_length_fun is now a property of Curve. If it is not supplied, it is computed via the derivative and spline fitting. Switching to the arc length parameterization is much faster now. The new stuff can be tested with testArcLength.m (which should be deleted after that).
author Martin Almquist <martin.almquist@it.uu.se>
date Sun, 29 Nov 2015 22:23:09 +0100
parents ddfb98209aa2
children 7bb2ef637142
line wrap: on
line source

function plotSolutions(filename, figename_prefix, plot_type)
    default_arg('figename_prefix',[]);
    default_arg('plot_type','plot')

    save_figures = ~isempty(figename_prefix);

    sf = SolutionFile(filename);

    for i = 1:length(sf.keys)
        key = sf.keys{i};
        entry = sf.get(key);

        method  = key.method;
        order   = key.order;
        m       = key.m;
        T       = key.T;
        repr    = entry.repr;
        runtime = entry.runtime;
        k       = entry.k;
        discr = entry.discr;

        [update, hand] = discr.setupPlot(plot_type);
        update(repr);

        if save_figures
            figname = sprintf('%s_%s_o%d_m%d_T%d',figename_prefix,method,order,m,i);
            fprintf('Saving figure to ''%s''\n',figname);
            saveeps(hand,figname);
        end

    end

end