changeset 1277:dc0ef82e3ec7 feature/poroelastic

Add better getBoundary method in grid/Staggered
author Martin Almquist <malmquist@stanford.edu>
date Sun, 07 Jun 2020 11:26:40 -0700
parents bc2be302df90
children ce422ba8964e
files +grid/Staggered.m
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/+grid/Staggered.m	Sun Jun 07 11:22:29 2020 -0700
+++ b/+grid/Staggered.m	Sun Jun 07 11:26:40 2020 -0700
@@ -94,9 +94,19 @@
         end
 
         % Return coordinates for the given boundary
-        function X = getBoundary(obj, name)
-            % Use boundaries of first grid
-            X = obj.gridGroups{1}{1}.getBoundary(name);
+        % gridGroup (scalar)    - grid group to return coordinates for
+        % subGrids (array)      - specifies which grids in the grid group to include (default: all grids in the grid group)
+        function X = getBoundary(obj, name, gridGroup, subGrids)
+
+            default_arg('gridGroup' , 1);
+            grids = obj.gridGroups{gridGroup};
+            default_arg('subGrids' , 1:numel(grids));
+
+            X = [];
+            for i = subGrids
+                X = [X; grids{i}.getBoundary(name)];
+            end
         end
+
     end
 end
\ No newline at end of file