view +multiblock/Line.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 24b2487b01c2
children
line wrap: on
line source

classdef Line < handle
    properties
        grid
        lines

        YData
    end

    methods
        function obj = Line(g, gf)
            assertType(g, 'multiblock.Grid')
            obj.grid = g;

            X = obj.grid.splitFunc(obj.grid.points());
            Y = obj.grid.splitFunc(gf);

            holdState = ishold();
            hold on

            lines = cell(1, obj.grid.nBlocks);
            for i = 1:obj.grid.nBlocks
                lines{i} = plot(X{i}, Y{i});
            end

            if holdState == false
                hold off
            end

            obj.lines = [lines{:}];

            obj.YData = gf;
        end

        function set(obj, propertyName, propertyValue)
            set(obj.lines, propertyName, propertyValue);
        end

        function obj = set.YData(obj, gf)
            obj.YData = gf;

            Y = obj.grid.funcToPlotMatrices(gf);
            for i = 1:obj.grid.nBlocks
                obj.lines(i).YData = Y{i};
            end
        end
    end
end