Mercurial > repos > public > sbplib
comparison +multiblock/Grid.m @ 531:d5bc51537a8c feature/boundaryGroup
Implement getBoundaryNames in multiblock.Grid
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 03 Aug 2017 15:49:32 +0200 |
parents | 0cd7b8128e04 |
children | 08b6281ba2a9 |
comparison
equal
deleted
inserted
replaced
530:0cd7b8128e04 | 531:d5bc51537a8c |
---|---|
125 end | 125 end |
126 | 126 |
127 % Find all non interface boundaries of all blocks. | 127 % Find all non interface boundaries of all blocks. |
128 % Return their grid.boundaryIdentifiers in a cell array. | 128 % Return their grid.boundaryIdentifiers in a cell array. |
129 function bs = getBoundaryNames(obj) | 129 function bs = getBoundaryNames(obj) |
130 error('not implemented'); | 130 bs = {}; |
131 for i = 1:obj.nBlocks() | |
132 candidates = obj.grids{i}.getBoundaryNames(); | |
133 for j = 1:obj.nBlocks() | |
134 if ~isempty(obj.connections{i,j}) | |
135 candidates = setdiff(candidates, obj.connections{i,j}{1}); | |
136 end | |
137 | |
138 if ~isempty(obj.connections{j,i}) | |
139 candidates = setdiff(candidates, obj.connections{j,i}{2}); | |
140 end | |
141 end | |
142 | |
143 for k = 1:length(candidates) | |
144 bs{end+1} = {i, candidates{k}}; | |
145 end | |
146 end | |
131 end | 147 end |
132 | 148 |
133 % Return coordinates for the given boundary/boundaryGroup | 149 % Return coordinates for the given boundary/boundaryGroup |
134 function b = getBoundary(obj, boundary) | 150 function b = getBoundary(obj, boundary) |
135 switch class(boundary) | 151 switch class(boundary) |