view +grid/Grid.m @ 168:ba1ae5b2c45e feature/grids

grid.Cartesian: Added methods and test to fulfilll abstract class.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 24 Feb 2016 15:01:54 +0100
parents 772365e2cf96
children c2db0294f8ed
line wrap: on
line source

classdef Grid < handle
    % General d dimensional grid with n points
    methods (Abstract)
        % n returns the number of points in the grid
        o = N(obj)

        % d returns the spatial dimension of the grid
        o = D(obj)

        % points returns a n x d matrix containing the coordinates for all points.
        X = points(obj)

        % Restricts the grid function gf on obj to the subgrid g.
        gf = restrictFunc(obj, gf, g)

        % Projects the grid function gf on obj to the grid g.
        gf = projectFunc(obj, gf, g)
    end
end


%% Should it be able to return a cell size aswell? For an equidistant grid this would be know
%% for other grids the constructor would have to make something up.
%% For example the grid.Cartesian constructor would take a h (1 x d) vector as an in parameter.


%Should define boundaries somehow, look in stitchSchemes.