Mercurial > repos > public > sbplib
comparison +scheme/Beam.m @ 236:8592358a3935 feature/beams
Beam: Added tuning as a parameter to contructor.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 15 Jul 2016 11:22:12 +0200 |
parents | d6344b549081 |
children | ba56e0d621f2 |
comparison
equal
deleted
inserted
replaced
235:d6344b549081 | 236:8592358a3935 |
---|---|
13 d1_l, d1_r | 13 d1_l, d1_r |
14 d2_l, d2_r | 14 d2_l, d2_r |
15 d3_l, d3_r | 15 d3_l, d3_r |
16 gamm | 16 gamm |
17 delt | 17 delt |
18 interface_tuning | |
18 end | 19 end |
19 | 20 |
20 methods | 21 methods |
21 function obj = Beam(grid, order, alpha, opsGen) | 22 function obj = Beam(grid, order, alpha, opsGen, interface_tuning) |
22 default_arg('alpha', 1); | 23 default_arg('alpha', -1); |
24 default_arg('interface_tuning', 1.1); | |
25 | |
23 % default_arg('opsGen', @sbp.Higher); | 26 % default_arg('opsGen', @sbp.Higher); |
24 default_arg('opsGen', @sbp.HigherCompatibleVariable); % Supposed to be better | 27 default_arg('opsGen', @sbp.HigherCompatibleVariable); % Supposed to be better |
25 | 28 |
26 if ~isa(grid, 'grid.Cartesian') || grid.D() ~= 1 | 29 if ~isa(grid, 'grid.Cartesian') || grid.D() ~= 1 |
27 error('Grid must be 1d cartesian'); | 30 error('Grid must be 1d cartesian'); |
52 | 55 |
53 obj.D = alpha*D4; | 56 obj.D = alpha*D4; |
54 | 57 |
55 obj.gamm = h*ops.borrowing.N.S2/2; | 58 obj.gamm = h*ops.borrowing.N.S2/2; |
56 obj.delt = h^3*ops.borrowing.N.S3/2; | 59 obj.delt = h^3*ops.borrowing.N.S3/2; |
60 obj.interface_tuning = interface_tuning; | |
57 end | 61 end |
58 | 62 |
59 | 63 |
60 % Closure functions return the opertors applied to the own doamin to close the boundary | 64 % Closure functions return the opertors applied to the own doamin to close the boundary |
61 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. | 65 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. |
106 delt_u = obj.delt; | 110 delt_u = obj.delt; |
107 | 111 |
108 gamm_v = neighbour_scheme.gamm; | 112 gamm_v = neighbour_scheme.gamm; |
109 delt_v = neighbour_scheme.delt; | 113 delt_v = neighbour_scheme.delt; |
110 | 114 |
111 % tuning = 2; | 115 tuning = obj.interface_tuning; |
112 tuning = 1.1; | 116 |
113 % tuning = 0.5; | |
114 % tuning = 0.49998; | |
115 % tuning = 0.3; | |
116 | 117 |
117 alpha_u = obj.alpha; | 118 alpha_u = obj.alpha; |
118 alpha_v = neighbour_scheme.alpha; | 119 alpha_v = neighbour_scheme.alpha; |
119 | 120 |
120 tau1 = ((alpha_u/2)/delt_u + (alpha_v/2)/delt_v)/2*tuning; | 121 tau1 = ((alpha_u/2)/delt_u + (alpha_v/2)/delt_v)/2*tuning; |