comparison +multiblock/stitchSchemes.m @ 498:324c927d8b1d feature/quantumTriangles

chnaged sbp interfacein 1d among many things
author Ylva Rydin <ylva.rydin@telia.com>
date Fri, 03 Mar 2017 16:19:41 +0100
parents 437fad4a47e1
children dd3e9a0f5032
comparison
equal deleted inserted replaced
497:4905446f165e 498:324c927d8b1d
9 % each field with a parameter array that is sent to schm.boundary_condition 9 % each field with a parameter array that is sent to schm.boundary_condition
10 % 10 %
11 % Output parameters are cell arrays and cell matrices. 11 % Output parameters are cell arrays and cell matrices.
12 % 12 %
13 % Ex: [schms, D, H] = stitchSchemes(schmHand, order, schmParam, blocks, ms, conn, bound) 13 % Ex: [schms, D, H] = stitchSchemes(schmHand, order, schmParam, blocks, ms, conn, bound)
14 function [schms, D, H] = stitchSchemes(schmHand, order, schmParam, grids, conn, bound,timeDep) 14 function [schms, D, H,penalty] = stitchSchemes(schmHand, order, schmParam, grids, conn, bound,timeDep)
15 default_arg('schmParam',[]); 15 default_arg('schmParam',[]);
16 default_arg('timeDep','N'); 16 default_arg('timeDep','N');
17 n_blocks = numel(grids); 17 n_blocks = numel(grids);
18 18
19 % Creating Schemes 19 % Creating Schemes
50 50
51 %% Total system matrix 51 %% Total system matrix
52 52
53 % Differentiation terms 53 % Differentiation terms
54 D = cell(n_blocks,n_blocks); 54 D = cell(n_blocks,n_blocks);
55 penalty = cell(n_blocks,n_blocks);
56
57
55 for i = 1:n_blocks 58 for i = 1:n_blocks
59 penalty{i,i}= @(t)0;
56 D{i,i} = schms{i}.D; 60 D{i,i} = schms{i}.D;
57 end 61 end
58 62
59 % Boundary penalty terms 63 % Boundary penalty terms
60 switch timeDep 64 switch timeDep
102 bc = bound{i}.(fn{j}); 106 bc = bound{i}.(fn{j});
103 if isempty(bc) 107 if isempty(bc)
104 continue 108 continue
105 end 109 end
106 110
107 [closure, ~] = schms{i}.boundary_condition(fn{j},bc{:}); 111 [closure, penaltyi] = schms{i}.boundary_condition(fn{j},bc{:});
108 D{i,i} =@(t) D{i,i}(t) + closure(t); 112 D{i,i} =@(t) D{i,i}(t) + closure(t);
113 penalty{i,i} = @(t) penalty{i,i}(t) + penaltyi(t);
109 end 114 end
110 end 115 end
111 116
112 % Interface penalty terms 117 % Interface penalty terms
113 for i = 1:n_blocks 118 for i = 1:n_blocks