comparison +noname/Discretization.m @ 64:7067bf8adbfa

Fixed some typing and added function to plot eigen values of a matrix.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 18 Nov 2015 17:14:19 +0100
parents ed6a704b028d
children 14bf01b7a068
comparison
equal deleted inserted replaced
63:21b18edb9667 64:7067bf8adbfa
1 classdef Discretization < handle 1 classdef Discretization < handle
2 properties (Abstract) 2 properties (Abstract)
3 name %Short description 3 name %Short description
4 description %Longer description 4 description %Longer description
5 order %Order of accuracy 5 order %Order of accuracy
6 h % scalar desciribing the grid spacing.. (IS THIS THE RIGHT PLACE FOR THIS?) 6 % h % scalar desciribing the grid spacing.. (IS THIS THE RIGHT PLACE FOR THIS?)
7 end 7 end
8 8
9 methods (Abstract) 9 methods (Abstract)
10 % Prints some info about the discretisation 10 % Prints some info about the discretisation
11 printInfo() 11 printInfo()
17 % method is a string that states which timestepping method should be used. 17 % method is a string that states which timestepping method should be used.
18 % The implementation should switch on the string and deliver 18 % The implementation should switch on the string and deliver
19 % the appropriate timestepper. It should also provide a default value. 19 % the appropriate timestepper. It should also provide a default value.
20 % k is a desired timestep 20 % k is a desired timestep
21 % cfl is a choses cfl constant used to set the timestep. ignored if k is set. 21 % cfl is a choses cfl constant used to set the timestep. ignored if k is set.
22 ts = getTimestepper(obj,method,k,cfl) 22 ts = getTimestepper(obj, method, k, cfl)
23 23
24 % Calculates a timestep for the discretization and a given timestepping method. 24 % Calculates a timestep for the discretization and a given timestepping method.
25 % Can take order, differnt types of scaling in h, or other parameters in Discr into 25 % Can take order, differnt types of scaling in h, or other parameters in Discr into
26 % account. 26 % account.
27 % method -- time stepping method for which to give a timestep. 27 % method -- time stepping method for which to give a timestep.
29 % if skipped getTimestep should use a precomputed value. 29 % if skipped getTimestep should use a precomputed value.
30 k = getTimestep(obj, method, cfl) 30 k = getTimestep(obj, method, cfl)
31 31
32 % getTimeSnapshot returns a struct which represents the solution in ts at current time. 32 % getTimeSnapshot returns a struct which represents the solution in ts at current time.
33 % if ts is empty or 0 a representation of the initial conditions be returned. 33 % if ts is empty or 0 a representation of the initial conditions be returned.
34 repr = getTimeSnapshot(obj,ts) 34 repr = getTimeSnapshot(obj, ts)
35 35
36 36
37 % Sets up movie recording to a given file. 37 % Sets up movie recording to a given file.
38 % saveFrame is a function_handle with no inputs that records the current state 38 % saveFrame is a function_handle with no inputs that records the current state
39 % as a frame in the moive. 39 % as a frame in the moive.