Mercurial > repos > public > sbplib
comparison +multiblock/DiffOp.m @ 534:55a7777dfcd0 feature/boundaryGroup
Implement boundary_condition for boundary groups
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 03 Aug 2017 18:07:27 +0200 |
parents | 06d1606d6977 |
children | b0386d2c180d |
comparison
equal
deleted
inserted
replaced
533:06d1606d6977 | 534:55a7777dfcd0 |
---|---|
149 % boundary of that block example: {1,'s'} or {3,'w'}. It | 149 % boundary of that block example: {1,'s'} or {3,'w'}. It |
150 % can also be a boundary group | 150 % can also be a boundary group |
151 function [closure, penalty] = boundary_condition(obj, boundary, type) | 151 function [closure, penalty] = boundary_condition(obj, boundary, type) |
152 switch class(boundary) | 152 switch class(boundary) |
153 case 'cell' | 153 case 'cell' |
154 [closure, penalty] = singleBoundaryCondition(obj, boundary, type); | 154 [closure, penalty] = obj.singleBoundaryCondition(boundary, type); |
155 case 'multiblock.BoundaryGroup' | 155 case 'multiblock.BoundaryGroup' |
156 error('not implemented') | 156 [n,m] = size(obj.D); |
157 closure = sparse(n,m); | |
158 penalty = []; | |
159 for i = 1:length(boundary) | |
160 [closurePart, penaltyPart] = obj.boundary_condition(boundary{i}, type); | |
161 closure = closure + closurePart; | |
162 penalty = [penalty, penaltyPart]; | |
163 end | |
157 otherwise | 164 otherwise |
158 error('Unknown boundary indentifier') | 165 error('Unknown boundary indentifier') |
159 end | 166 end |
160 | 167 |
161 end | 168 end |