changeset 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 b29f04ab5d99
files +multiblock/Grid.m
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
diff -r 0cd7b8128e04 -r d5bc51537a8c +multiblock/Grid.m
--- a/+multiblock/Grid.m	Thu Aug 03 15:01:12 2017 +0200
+++ b/+multiblock/Grid.m	Thu Aug 03 15:49:32 2017 +0200
@@ -127,7 +127,23 @@
         % Find all non interface boundaries of all blocks.
         % Return their grid.boundaryIdentifiers in a cell array.
         function bs = getBoundaryNames(obj)
-            error('not implemented');
+            bs = {};
+            for i = 1:obj.nBlocks()
+                candidates = obj.grids{i}.getBoundaryNames();
+                for j = 1:obj.nBlocks()
+                    if ~isempty(obj.connections{i,j})
+                        candidates = setdiff(candidates, obj.connections{i,j}{1});
+                    end
+
+                    if ~isempty(obj.connections{j,i})
+                        candidates = setdiff(candidates, obj.connections{j,i}{2});
+                    end
+                end
+
+                for k = 1:length(candidates)
+                    bs{end+1} = {i, candidates{k}};
+                end
+            end
         end
 
         % Return coordinates for the given boundary/boundaryGroup