view +noname/Discretization.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 14bf01b7a068
children ceba6be0389f
line wrap: on
line source

classdef Discretization < handle
    properties (Abstract)
        name         %Short description
        description  %Longer description
        order        %Order of accuracy
        % h            % scalar desciribing the grid spacing.. (IS THIS THE RIGHT PLACE FOR THIS?)
    end

    methods (Abstract)
        % Prints some info about the discretisation
        printInfo()

        % Return the number of DOF
        n = size(obj)

        % Returns a timestepper for integrating the discretisation in time
        %     method is a string that states which timestepping method should be used.
        %          The implementation should switch on the string and deliver
        %          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)

        % 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
        % account.  opt is a struct that among other things may contain
        %   method -- time stepping method for which to give a timestep.
        %   cfl    -- [optioanal] a cfl constant to use to calculate the timetep.
        %             if skipped getTimestep should use a precomputed value.
        %   k      -- timestep to use
        k = getTimestep(obj, opt)

        % getTimeSnapshot returns a struct which represents the solution in ts at current time.
        % if ts is empty or 0 a representation of the initial conditions be returned.
        repr = getTimeSnapshot(obj, ts)


        % Sets up movie recording to a given file.
        %     saveFrame is a function_handle with no inputs that records the current state
        %               as a frame in the moive.
        saveFrame = setupMov(obj, file)

        % Sets up a plot of the discretisation
        %     update is a function_handle accepting a timestepper that updates the plot to the
        %            state of the timestepper
        %     type allows for different kinds of plots. Some special values are used by the lib. 'animate' and 'plot' for example
        [update,hand] = setupPlot(obj, type)

    end
end