annotate +scheme/Scheme.m @ 910:b9c98661ff5d feature/utux2D

Change the name of the last interface method argument from type to opts in all schemes.
author Martin Almquist <malmquist@stanford.edu>
date Fri, 23 Nov 2018 20:39:40 -0800
parents 459eeb99130f
children af397cc35239
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
3 classdef Scheme < handle
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
4 properties (Abstract)
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
5 order % Order accuracy for the approximation
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
6
185
fad5e81389c1 Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents: 178
diff changeset
7 grid
0
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
8
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
9 D % non-stabalized scheme operator
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
10 H % Discrete norm
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
11 end
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
12
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
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 % 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
24 % interfaced to.
fad5e81389c1 Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents: 178
diff changeset
25 % 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
26 % interface to.
220
5df8d20281fe Made scheme boundary_condition return a cell array of penalties if there are several of them.
Jonatan Werpers <jonatan@werpers.com>
parents: 213
diff changeset
27 % penalty may be a cell array if there are several penalties with different weights
568
12ee11893453 Add todo about method name change
Jonatan Werpers <jonatan@werpers.com>
parents: 539
diff changeset
28 [closure, penalty] = boundary_condition(obj,boundary,type) % TODO: Change name to boundaryCondition
905
459eeb99130f Include type as (optional) input parameter in the interface method of all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 568
diff changeset
29
910
b9c98661ff5d Change the name of the last interface method argument from type to opts in all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 905
diff changeset
30 % opts multiblock.InterfaceOptions object that specifies
b9c98661ff5d Change the name of the last interface method argument from type to opts in all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 905
diff changeset
31 % the details of the interface coupling.
b9c98661ff5d Change the name of the last interface method argument from type to opts in all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 905
diff changeset
32 % The format of opts is different for every scheme.
b9c98661ff5d Change the name of the last interface method argument from type to opts in all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 905
diff changeset
33 % Some schemes may only have one interface treatment
b9c98661ff5d Change the name of the last interface method argument from type to opts in all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 905
diff changeset
34 % implemented, in which case opts is a dummy.
b9c98661ff5d Change the name of the last interface method argument from type to opts in all schemes.
Martin Almquist <malmquist@stanford.edu>
parents: 905
diff changeset
35 [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts)
0
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
36
539
08b6281ba2a9 Add some todos
Jonatan Werpers <jonatan@werpers.com>
parents: 537
diff changeset
37 % TODO: op = getBoundaryOperator()??
08b6281ba2a9 Add some todos
Jonatan Werpers <jonatan@werpers.com>
parents: 537
diff changeset
38 % makes sense to have it available through a method instead of random properties
537
a70d5387d2ca Add note about a possible getBoundaryOperator method
Jonatan Werpers <jonatan@werpers.com>
parents: 220
diff changeset
39
185
fad5e81389c1 Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents: 178
diff changeset
40 % 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
41 N = size(obj)
0
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
42 end
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
43
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
44 methods(Static)
185
fad5e81389c1 Updated comments and definition to use introduced grid types.
Jonatan Werpers <jonatan@werpers.com>
parents: 178
diff changeset
45 % 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
46 % 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
47 % [uu, uv, vv, vu] = inteface_coupling(A,'r',B,'l')
0
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
48 function [uu, uv, vv, vu] = interface_coupling(schm_u,bound_u,schm_v,bound_v)
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
49 [uu,uv] = schm_u.interface(bound_u,schm_v,bound_v);
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
50 [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u);
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
51 end
48b6fb693025 Initial commit.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
52 end
200
ef41fde95ac4 Merged feature/grids into feature/beams.
Jonatan Werpers <jonatan@werpers.com>
parents: 180 185
diff changeset
53 end