Mercurial > repos > public > sbplib
annotate +scheme/Scheme.m @ 200:ef41fde95ac4 feature/beams
Merged feature/grids into feature/beams.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 13 Jun 2016 16:59:02 +0200 |
parents | 001239c03eb2 fad5e81389c1 |
children | 15d604e4e1a1 |
rev | line source |
---|---|
185
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
1 % Start with all matrix returns. When that works see how we should generalize |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
2 % to non-matrix stuff/nonlinear |
0 | 3 classdef Scheme < handle |
4 properties (Abstract) | |
5 order % Order accuracy for the approximation | |
6 | |
185
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
7 grid |
0 | 8 |
9 D % non-stabalized scheme operator | |
10 H % Discrete norm | |
11 end | |
12 | |
13 methods (Abstract) | |
185
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
14 % Closure functions return the opertors applied to the own doamin to |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
15 % close the boundary Penalty functions return the opertors to force |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
16 % the solution. In the case of an interface it returns the operator |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
17 % applied to the other doamin. In some cases the penalty return value |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
18 % can be ommited and the closure function take care of both parts. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
19 % boundary is a string specifying the boundary e.g. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
20 % 'l','r' or 'e','w','n','s'. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
21 % type is a string specifying the type of |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
22 % boundary condition if there are several. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
23 % data is a function returning the data that |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
24 % should be applied at the boundary. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
25 % neighbour_scheme is an instance of Scheme that should be |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
26 % interfaced to. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
27 % neighbour_boundary is a string specifying which boundary to |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
28 % interface to. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
29 [closure, penalty] = boundary_condition(obj,boundary,type,data) |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
30 [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) |
0 | 31 |
185
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
32 % Returns the number of degrees of freedom. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
33 N = size(obj) |
0 | 34 end |
35 | |
36 methods(Static) | |
185
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
37 % Calculates the matrcis need for the inteface coupling between |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
38 % boundary bound_u of scheme schm_u and bound_v of scheme schm_v. |
fad5e81389c1
Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents:
178
diff
changeset
|
39 % [uu, uv, vv, vu] = inteface_coupling(A,'r',B,'l') |
0 | 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 | |
200
ef41fde95ac4
Merged feature/grids into feature/beams.
Jonatan Werpers <jonatan@werpers.com>
diff
changeset
|
45 end |