diff +multiblock/Grid.m @ 425:e56dbd9e4196 feature/grids

Merge feature/beams
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 07 Feb 2017 16:09:02 +0100
parents b8ee5212f651
children 819345fe7ff1
line wrap: on
line diff
--- a/+multiblock/Grid.m	Tue Feb 07 15:47:51 2017 +0100
+++ b/+multiblock/Grid.m	Tue Feb 07 16:09:02 2017 +0100
@@ -34,11 +34,20 @@
             n = length(obj.grids);
         end
 
-        % n returns the number of points in the grid
+        % N returns the number of points in the grid
         function o = N(obj)
             o = obj.nPoints;
         end
 
+        % Ns returns the number of points in each sub grid as a vector
+        function o = Ns(obj)
+            ns = zeros(1,obj.nBlocks);
+            for i = 1:obj.nBlocks;
+                ns(i) = obj.grids{i}.N();
+            end
+            o = ns;
+        end
+
         function n = nBlocks(obj)
             n = length(obj.grids);
         end
@@ -62,9 +71,9 @@
             nBlocks = length(obj.grids);
 
             % Collect number of points in each block
-            N = cell(1,nBlocks);
+            N = zeros(1,nBlocks);
             for i = 1:nBlocks
-                N{i} = obj.grids{i}.N();
+                N(i) = obj.grids{i}.N();
             end
 
             gfs = mat2cell(gf, N, 1);