Mercurial > repos > public > sbplib
annotate +scheme/Scheme.m @ 25:791decafe6e4
Made calculateSolution save the discretization instead of a handle to contructor.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 25 Sep 2015 14:51:18 +0200 |
parents | 16bad7c459da |
children | ed6a704b028d |
rev | line source |
---|---|
0 | 1 % Start with all matrix returns. When that works see how we should generalize to non-matrix stuff/nonlinear |
2 classdef Scheme < handle | |
3 properties (Abstract) | |
4 m % Number of points in each direction, possibly a vector | |
5 order % Order accuracy for the approximation | |
6 | |
7 % vectors u,v,w depending on dim that gives were gridpoints are in each dimension | |
8 % vectors x,y,z containing the x,y,z values corresponding to each grid point | |
9 % matrices X,Y,Z with point coordinates as multi dimensional vectors | |
10 | |
11 D % non-stabalized scheme operator | |
12 H % Discrete norm | |
13 | |
14 % Should also containg: | |
15 % the grid points used | |
16 % the grid spacing | |
17 end | |
18 | |
19 methods (Abstract) | |
20 % Closure functions return the opertors applied to the own doamin to close the boundary | |
21 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. | |
22 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. | |
23 % type is a string specifying the type of boundary condition if there are several. | |
24 % data is a function returning the data that should be applied at the boundary. | |
25 % neighbour_scheme is an instance of Scheme that should be interfaced to. | |
26 % neighbour_boundary is a string specifying which boundary to interface to. | |
27 m = boundary_condition(obj,boundary,type,data) | |
28 m = interface(obj,boundary,neighbour_scheme,neighbour_boundary) | |
29 N = size(obj) % Returns the number of degrees of freedom. | |
30 | |
15
16bad7c459da
Added abstract methods to allow for comparing of solutions. Added a bunch of error functions.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
31 e = compareSolution(obj, p,v, p_ref, v_ref, errorFunction) % Use ismemeber(p,p_ref,'rows') and vector2cell() for winning |
16bad7c459da
Added abstract methods to allow for comparing of solutions. Added a bunch of error functions.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
32 e = compareSolutionAnalytical(obj, p, v, v_ref, errorFunction) |
0 | 33 |
34 end | |
35 | |
36 methods(Static) | |
37 % Calculates the matrcis need for the inteface coupling between boundary bound_u of scheme schm_u | |
38 % and bound_v of scheme schm_v. | |
39 % [uu, uv, vv, vu] = inteface_couplong(A,'r',B,'l') | |
40 function [uu, uv, vv, vu] = interface_coupling(schm_u,bound_u,schm_v,bound_v) | |
41 [uu,uv] = schm_u.interface(bound_u,schm_v,bound_v); | |
42 [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u); | |
43 end | |
44 end | |
45 end |