Mercurial > repos > public > sbplib
comparison +multiblock/DiffOp.m @ 216:8b10476b9bb7 feature/beams
multiblock: Fixed some problems in DiffOp and Grid.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 22 Jun 2016 14:44:03 +0200 |
parents | 39b7dcb2c724 |
children | 5df8d20281fe |
comparison
equal
deleted
inserted
replaced
215:7bb2ef637142 | 216:8b10476b9bb7 |
---|---|
62 continue | 62 continue |
63 end | 63 end |
64 | 64 |
65 [ii, ij] = obj.diffOps{i}.interface(intf{1}, obj.diffOps{j}, intf{2}); | 65 [ii, ij] = obj.diffOps{i}.interface(intf{1}, obj.diffOps{j}, intf{2}); |
66 D{i,i} = D{i,i} + ii; | 66 D{i,i} = D{i,i} + ii; |
67 D{i,j} = D{i,j} + ij; | 67 D{i,j} = ij; |
68 | 68 |
69 [jj, ji] = obj.diffOps{j}.interface(intf{2}, obj.diffOps{i}, intf{1}); | 69 [jj, ji] = obj.diffOps{j}.interface(intf{2}, obj.diffOps{i}, intf{1}); |
70 D{j,j} = D{j,j} + jj; | 70 D{j,j} = D{j,j} + jj; |
71 D{j,i} = D{j,i} + ji; | 71 D{j,i} = ji; |
72 end | 72 end |
73 end | 73 end |
74 obj.D = blockmatrix.toMatrix(D); | 74 obj.D = blockmatrix.toMatrix(D); |
75 | 75 |
76 obj.blockmatrixDiv = blockmatrix.getDivision(D); | 76 obj.blockmatrixDiv = blockmatrix.getDivision(D); |
106 | 106 |
107 % Creates the closere and penalty matrix for a given boundary condition, | 107 % Creates the closere and penalty matrix for a given boundary condition, |
108 % boundary -- the name of the boundary on the form [id][name] where | 108 % boundary -- the name of the boundary on the form [id][name] where |
109 % id is the number of a block and name is the name of a | 109 % id is the number of a block and name is the name of a |
110 % boundary of that block example: 1s or 3w | 110 % boundary of that block example: 1s or 3w |
111 function [closure, penalty] = boundary_condition(obj,boundary,type,data) | 111 function [closure, penalty] = boundary_condition(obj,boundary,type) |
112 I = boundary(1) | 112 I = boundary{1}; |
113 name = boundary(2:end); | 113 name = boundary{2}; |
114 | 114 |
115 % Get the closure and penaly matrices | 115 % Get the closure and penaly matrices |
116 [blockClosure, blockPenalty] = obj.diffOps{I}.boundary_condition(name, type, data); | 116 [blockClosure, blockPenalty] = obj.diffOps{I}.boundary_condition(name, type); |
117 | 117 |
118 % Expand to matrix for full domain. | 118 % Expand to matrix for full domain. |
119 div = obj.blockmatrixDiv; | 119 div = obj.blockmatrixDiv; |
120 closure = blockmatrix.zero(div); | 120 closure = blockmatrix.zero(div); |
121 closure{I,I} = blockClosure; | 121 closure{I,I} = blockClosure; |
124 penalty = blockmatrix.zero(div); | 124 penalty = blockmatrix.zero(div); |
125 penalty{I} = blockPenalty; | 125 penalty{I} = blockPenalty; |
126 | 126 |
127 % Convert to matrix | 127 % Convert to matrix |
128 closure = blockmatrix.toMatrix(closure); | 128 closure = blockmatrix.toMatrix(closure); |
129 penalty = blockmatrix.toMatrix(closure); | 129 penalty = blockmatrix.toMatrix(penalty); |
130 end | 130 end |
131 | 131 |
132 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) | 132 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) |
133 | 133 |
134 end | 134 end |